/* ==============================================================================
   SAI INDIRABALA FURNITURE - PUBLIC CATALOG STYLES
   Warm wood, cream, and gold luxury craftsmanship design system.
   Mobile-first responsive architecture.
   ============================================================================== */

/* --------------------------------------------------------------------------
   01. PAGE HERO & BREADCRUMBS
   -------------------------------------------------------------------------- */
.page-hero {
    position: relative;
    background: linear-gradient(135deg, var(--wood-dark) 0%, #2a1a11 60%, var(--wood-brown) 100%);
    color: var(--cream);
    padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(2rem, 4vw, 3.5rem);
    border-bottom: 2px solid var(--accent);
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(196, 154, 91, 0.15) 0%, transparent 55%);
    pointer-events: none;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--beige);
    margin-bottom: 1rem;
}

.breadcrumbs a {
    color: var(--beige);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumbs a:hover {
    color: var(--accent-light);
}

.breadcrumbs span.separator {
    color: var(--accent);
    font-size: 0.8rem;
}

.breadcrumbs span.current {
    color: var(--accent-light);
    font-weight: 600;
}

.page-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.4rem);
    color: var(--cream);
    line-height: 1.15;
    margin-bottom: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.page-subtitle {
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    color: var(--beige);
    max-width: 680px;
    line-height: 1.6;
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   02. CATALOG TOOLBAR (SEARCH & CATEGORIES)
   -------------------------------------------------------------------------- */
.catalog-section {
    padding: clamp(2rem, 4vw, 4rem) 0 clamp(3rem, 6vw, 6rem);
    background-color: var(--cream);
    min-height: 60vh;
}

.catalog-toolbar {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-subtle);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.toolbar-top-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .toolbar-top-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.search-box-wrap {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--charcoal-muted);
    pointer-events: none;
}

.catalog-search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.75rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--cream-light);
    color: var(--charcoal);
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.catalog-search-input:focus {
    outline: none;
    border-color: var(--accent);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(196, 154, 91, 0.18);
}

.search-clear-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--charcoal-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.search-clear-btn:hover {
    color: var(--wood-dark);
}

/* Category Filter Pills */
.category-pills-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.category-pills-wrap::-webkit-scrollbar {
    height: 4px;
}

.category-pills-wrap::-webkit-scrollbar-thumb {
    background: var(--beige-dark);
    border-radius: 4px;
}

.cat-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.95rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--wood-brown);
    background: var(--cream-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.cat-pill-btn:hover {
    border-color: var(--accent);
    color: var(--wood-dark);
    background: var(--white);
}

.cat-pill-btn.active {
    background: var(--wood-dark);
    border-color: var(--wood-dark);
    color: var(--accent-light);
    box-shadow: 0 2px 10px rgba(31, 20, 13, 0.2);
}

.cat-pill-count {
    font-size: 0.75rem;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
}

.cat-pill-btn.active .cat-pill-count {
    background: rgba(223, 186, 131, 0.2);
    color: var(--accent-light);
}

/* Results Summary */
.catalog-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--charcoal-muted);
}

.catalog-results-count strong {
    color: var(--wood-dark);
}

/* --------------------------------------------------------------------------
   03. PRODUCTS GRID & PRODUCT CARD
   -------------------------------------------------------------------------- */
.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 576px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.product-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-subtle);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card);
    border-color: var(--accent-light);
}

.product-card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f5f1e8;
    overflow: hidden;
    cursor: pointer;
}

.product-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.product-card:hover .product-card-img {
    transform: scale(1.05);
}

.product-card-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(31, 20, 13, 0.85);
    color: var(--accent-light);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.03em;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(196, 154, 91, 0.35);
}

.product-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card-title {
    font-family: var(--font-heading);
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--wood-dark);
    margin-bottom: 0.45rem;
    line-height: 1.3;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.product-card-title:hover {
    color: var(--accent-dark);
}

.product-card-desc {
    font-size: 0.86rem;
    color: var(--charcoal-muted);
    line-height: 1.5;
    margin-bottom: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* Specifications Chips */
.product-specs-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.spec-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--surface-tint);
    border: 1px solid rgba(74, 45, 28, 0.08);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.74rem;
    color: var(--wood-brown);
    font-weight: 600;
}

.spec-chip strong {
    color: var(--wood-dark);
    font-weight: 700;
}

/* Card Actions */
.product-card-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color);
}

.btn-card-details {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--wood-dark);
    color: var(--cream);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--wood-dark);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-card-details:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--wood-dark);
}

.btn-card-wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1a8a3c;
    color: var(--white);
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    border: 1px solid #1a8a3c;
    transition: background-color var(--transition-fast);
}

.btn-card-wa:hover {
    background: #15742f;
    border-color: #15742f;
}

.btn-card-wa svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* --------------------------------------------------------------------------
   04. PRODUCT DETAIL MODAL
   -------------------------------------------------------------------------- */
.product-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 10, 6, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 3vw, 2rem);
    overflow-y: auto;
}

.product-modal-dialog {
    position: relative;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    animation: modalPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalPopIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.product-modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 38px;
    height: 38px;
    background: rgba(249, 246, 240, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--wood-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all var(--transition-fast);
}

.product-modal-close-btn:hover {
    background: var(--accent);
    color: var(--wood-dark);
    transform: rotate(90deg);
}

.product-modal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: clamp(1.25rem, 3vw, 2.5rem);
}

@media (min-width: 768px) {
    .product-modal-grid {
        grid-template-columns: 1.1fr 1fr;
        gap: 2.25rem;
    }
}

.modal-gallery-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-main-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    background: #f5f1e8;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.modal-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal-thumbnails-strip {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.modal-thumb-btn {
    flex: 0 0 68px;
    height: 52px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    padding: 0;
    overflow: hidden;
    background: #f5f1e8;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.modal-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-thumb-btn.active {
    border-color: var(--accent);
}

.modal-info-column {
    display: flex;
    flex-direction: column;
}

.modal-cat-badge {
    display: inline-block;
    align-self: flex-start;
    background: var(--surface-tint);
    border: 1px solid var(--accent);
    color: var(--wood-brown);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-product-title {
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 2.5vw, 1.85rem);
    font-weight: 700;
    color: var(--wood-dark);
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.modal-product-desc {
    font-size: 0.92rem;
    color: var(--charcoal);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    white-space: pre-line;
}

/* Specifications Table */
.modal-specs-wrap {
    margin-bottom: 1.5rem;
}

.modal-specs-heading {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--wood-dark);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.35rem;
}

.modal-specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.modal-specs-table tr {
    border-bottom: 1px solid rgba(74, 45, 28, 0.08);
}

.modal-specs-table th {
    text-align: left;
    padding: 0.45rem 0.5rem;
    color: var(--charcoal-muted);
    font-weight: 600;
    width: 38%;
}

.modal-specs-table td {
    padding: 0.45rem 0.5rem;
    color: var(--wood-dark);
    font-weight: 600;
}

/* Modal Actions CTA Group */
.modal-actions-group {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

@media (min-width: 576px) {
    .modal-actions-group {
        flex-direction: row;
    }
}

.btn-modal-wa {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #1a8a3c;
    color: var(--white);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.8rem 1.25rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background-color var(--transition-fast);
}

.btn-modal-wa:hover {
    background: #15742f;
}

.btn-modal-call {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--wood-dark);
    color: var(--cream);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.8rem 1.25rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background-color var(--transition-fast);
}

.btn-modal-call:hover {
    background: var(--wood-brown);
}

/* --------------------------------------------------------------------------
   05. STATES (LOADING, EMPTY, OFFLINE)
   -------------------------------------------------------------------------- */
.catalog-state-box {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: clamp(2.5rem, 6vw, 4.5rem) 2rem;
    text-align: center;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-subtle);
}

.state-spinner {
    width: 44px;
    height: 44px;
    border: 3.5px solid rgba(196, 154, 91, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: stateSpin 0.9s linear infinite;
    margin: 0 auto 1.25rem;
}

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

.catalog-state-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--wood-dark);
    margin-bottom: 0.5rem;
}

.catalog-state-text {
    font-size: 0.92rem;
    color: var(--charcoal-muted);
    max-width: 520px;
    margin: 0 auto 1.25rem;
    line-height: 1.55;
}

/* Offline Notice Banner */
.catalog-offline-banner {
    background: linear-gradient(135deg, #2b1d14 0%, var(--wood-dark) 100%);
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    color: var(--cream);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .catalog-offline-banner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.offline-banner-content h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--accent-light);
    margin-bottom: 0.35rem;
}

.offline-banner-content p {
    font-size: 0.88rem;
    color: var(--beige);
    margin: 0;
    line-height: 1.45;
}

.offline-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   06. ACCESSIBILITY: REDUCED MOTION PREFERENCES
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-card:hover,
    .product-card-img,
    .product-modal-dialog {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
    .state-spinner {
        animation-duration: 3s !important;
    }
}
