/* Kusum Furniture - Components */

/* Sticky Sidebar */
.sticky-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1400;
    display: flex;
    flex-direction: column;
    background: var(--color-black);
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
}

.sticky-sidebar__tab {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: all var(--transition);
    text-decoration: none;
}

.sticky-sidebar__tab:last-child { border-bottom: none; }

.sticky-sidebar__tab:hover,
.sticky-sidebar__tab.active {
    background: var(--color-white);
    color: var(--color-black);
}

/* Side Panel */
.side-panel {
    position: fixed;
    inset: 0;
    z-index: 2500;
    pointer-events: none;
    visibility: hidden;
}

.side-panel.active {
    pointer-events: auto;
    visibility: visible;
}

.side-panel__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.side-panel.active .side-panel__backdrop { opacity: 1; }

.side-panel__drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: min(400px, 100vw);
    height: 100%;
    max-height: 100dvh;
    background: var(--color-white);
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
    padding: 32px 28px 28px;
    box-shadow: -8px 0 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
}

.side-panel.active .side-panel__drawer {
    transform: translateX(0);
}

.side-panel__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    border-radius: 50%;
    transition: background var(--transition);
}

.side-panel__close:hover { background: var(--color-cream); }

.side-panel__content[hidden] {
    display: none !important;
}

.side-panel__content:not([hidden]) {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-right: 8px;
    animation: panelIn 0.3s ease;
}

@keyframes panelIn {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

.side-panel__content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    padding-right: 40px;
    flex-shrink: 0;
}

.side-panel__form--compact {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.side-panel__form--compact .form-group {
    margin-bottom: 14px;
}

.side-panel__form--compact label {
    font-size: 12px;
    margin-bottom: 6px;
}

.side-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.side-panel__cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.side-panel__cards--grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.side-panel__card {
    display: block;
    padding: 20px;
    background: var(--color-cream);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-text);
    transition: all var(--transition);
    border: 1px solid var(--color-border);
}

.side-panel__card:hover {
    border-color: var(--color-gold);
    transform: translateY(-2px);
}

.side-panel__card--gold {
    background: var(--color-gold);
    border-color: var(--color-gold);
    color: var(--color-black);
}

.side-panel__card--static {
    cursor: default;
}

.side-panel__card strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.side-panel__card span {
    font-size: 0.95rem;
    color: var(--color-text-light);
}

.side-panel__card--gold span { color: rgba(0,0,0,0.7); }

.side-panel__info { margin-bottom: 32px; }

.side-panel__info-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border);
}

.side-panel__info-item strong {
    display: block;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-gold);
    margin-bottom: 8px;
}

.side-panel__info-item p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--color-text);
}

.side-panel__info-item a:hover { color: var(--color-gold); }

.form-control--line {
    border: none;
    border-bottom: 2px solid var(--color-border);
    border-radius: 0;
    padding: 12px 0;
    background: transparent;
    font-size: 1rem;
    width: 100%;
    display: block;
    color: var(--color-text);
}

.form-control--line:focus {
    border-bottom-color: var(--color-gold);
    outline: none;
}

select.form-control--line {
    cursor: pointer;
}

.form-control--line:focus {
    border-bottom-color: var(--color-gold);
    outline: none;
}

@media (max-width: 768px) {
    /* Hide floating sidebar on mobile – bottom nav handles actions */
    .sticky-sidebar { display: none !important; }

    .side-panel__drawer { padding: 32px 20px 24px; width: 100%; max-width: 100%; }
    .side-panel__content h2 { font-size: 1.75rem; }
    .side-form-row { grid-template-columns: 1fr; }
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26,26,26,0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    padding: 16px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--color-white);
    border-radius: 16px;
    max-width: 520px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 64px rgba(0,0,0,0.28);
    border: 1px solid rgba(197,160,89,0.2);
}

.modal--luxury {
    display: flex;
    flex-direction: column;
    max-height: min(92vh, 92dvh);
    overflow: hidden;
}

.modal--luxury .modal__scroll {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    max-height: calc(min(92vh, 92dvh) - 4px);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

html.scroll-locked,
html.scroll-locked body {
    overflow: hidden !important;
    height: 100%;
}

.modal-overlay.active {
    touch-action: none;
    overscroll-behavior: none;
}

.side-panel.active .side-panel__drawer {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.modal__accent {
    height: 4px;
    background: linear-gradient(90deg, var(--color-gold-dark), var(--color-gold), var(--color-gold-light));
}

.modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    background: rgba(255,255,255,0.9);
    transition: all var(--transition);
    z-index: 3;
    border: 1px solid var(--color-border);
}
.modal__close:hover {
    background: var(--color-cream);
    color: var(--color-black);
    border-color: var(--color-gold);
}

.modal__content { padding: 0; }

.modal--luxury .modal__scroll {
    padding: 0 36px 36px;
}

.modal__top {
    text-align: center;
    padding: 32px 36px 24px;
    background: linear-gradient(180deg, var(--color-cream) 0%, var(--color-white) 100%);
    margin: 0 -36px 28px;
    border-bottom: 1px solid var(--color-border);
}

.modal__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--color-white);
    border: 2px solid var(--color-gold);
    color: var(--color-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(197,160,89,0.2);
}

.modal__header h3 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    color: var(--color-black);
}

.modal__header p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    line-height: 1.55;
    max-width: 360px;
    margin: 0 auto;
}

.modal__form .form-group { margin-bottom: 16px; }

.modal-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal__submit {
    margin-top: 8px;
    padding: 16px;
    font-size: 13px;
    letter-spacing: 0.1em;
}

.modal__trust {
    text-align: center;
    font-size: 11px;
    color: var(--color-text-light);
    margin-top: 14px;
    line-height: 1.5;
}

.modal__form .form-control {
    border-radius: 8px;
    padding: 14px 16px;
    border-color: #e0d8c8;
}

.modal__form .form-control:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(197,160,89,0.12);
}

.modal__form textarea.form-control { min-height: 96px; }

.form-loading .modal__submit {
    opacity: 0.7;
    pointer-events: none;
}

/* Image Mask Reveal */
.mask-reveal {
    overflow: hidden;
    position: relative;
}

.mask-reveal img {
    transform: scale(1.2);
    transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mask-reveal.revealed img {
    transform: scale(1);
}

/* Parallax wrapper */
.parallax-wrap {
    overflow: hidden;
    position: relative;
}

/* Luxury divider */
.luxury-divider {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
}

.luxury-divider::before,
.luxury-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.luxury-divider span {
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-gold);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-light);
}

.breadcrumb a:hover { color: var(--color-gold); }
.breadcrumb span { color: var(--color-gold); }

/* Product detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.product-detail__gallery {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-cream);
}

.product-detail__gallery img {
    width: 100%;
    height: auto;
}

.product-detail__info h2 {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.product-detail__price {
    font-family: var(--font-elegant);
    font-size: 1.4rem;
    color: var(--color-gold);
    margin-bottom: 24px;
}

.product-detail__desc {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-text-light);
    margin-bottom: 32px;
}

.product-features {
    margin-bottom: 32px;
}

.product-features li {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-features li::before {
    content: '◆';
    color: var(--color-gold);
    font-size: 8px;
}

/* Service detail */
.service-detail-hero {
    height: 50vh;
    min-height: 400px;
    position: relative;
    overflow: hidden;
    margin-top: calc(var(--topbar-height) + var(--nav-height));
}

.service-detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-detail-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    display: flex;
    align-items: flex-end;
    padding: 60px;
}

.service-detail-hero__overlay h1 {
    color: var(--color-white);
    font-size: 3rem;
}

/* Loading spinner */
.form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-gold);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Overlay backdrop for mobile drawer */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}
.drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Accordion */
.accordion-item {
    border-bottom: 1px solid var(--color-border);
}

.accordion-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    text-align: left;
    color: var(--color-black);
}

.accordion-header svg {
    transition: transform var(--transition);
    flex-shrink: 0;
}

.accordion-item.active .accordion-header svg {
    transform: rotate(180deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.accordion-body__inner {
    padding-bottom: 20px;
    font-size: 0.95rem;
    color: var(--color-text-light);
    line-height: 1.7;
}

.accordion-item.active .accordion-body {
    max-height: 300px;
}

/* Map placeholder */
.map-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 400px;
    background: var(--color-cream);
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Preloader */
.preloader {
    position: fixed;
    inset: 0;
    background: var(--color-black);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader__logo {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    letter-spacing: 0.3em;
    color: var(--color-gold);
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@media (max-width: 768px) {
    .product-detail { grid-template-columns: 1fr; }
    .service-detail-hero__overlay { padding: 32px; }
    .service-detail-hero__overlay h1 { font-size: 2rem; }
}
