/* ============================================================================
   Tasiang Kitchen & Taps - Gallery Showcase Styles
   Extends the base design system from style.css
   ============================================================================ */

/* ---------- Gallery Layout ---------- */
.gallery-page {
    background: linear-gradient(180deg, #fffcf7 0%, #fdf8f0 40%, #fffaf4 100%);
    min-height: 100vh;
}

.gallery-intro {
    text-align: center;
    margin: var(--space-xl) 0;
}

.gallery-intro h1 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

.gallery-intro p {
    color: var(--color-text-light);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ---------- Category Tabs ---------- */
.category-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.category-tab {
    padding: 10px 22px;
    border-radius: 100px;
    border: 2px solid #E5E7EB;
    background: var(--color-surface);
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--color-text-light);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.category-tab:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(178, 92, 46, 0.04);
}

.category-tab.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(178, 92, 46, 0.25);
}

/* ---------- Product Grid ---------- */
.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-xxl);
}

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

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

/* ---------- Product Card ---------- */
.product-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(46, 46, 46, 0.06);
    border: 1px solid rgba(178, 92, 46, 0.08);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 16px 48px rgba(178, 92, 46, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--color-primary);
}

/* Image container */
.product-card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #f3ede4, #e8ddd0);
    position: relative;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

/* Placeholder when no image */
.product-card-image .placeholder-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: rgba(178, 92, 46, 0.2);
}

/* Card body */
.product-card-body {
    padding: 18px 20px 20px;
}

.product-card-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 6px;
    line-height: 1.3;
}

.product-card-desc {
    font-size: 0.88rem;
    color: var(--color-text-light);
    line-height: 1.5;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-card-price {
    font-weight: 700;
    color: var(--color-primary);
    font-family: var(--font-body);
    font-size: 1rem;
}

.product-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.product-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.product-tag.signature {
    background: rgba(178, 92, 46, 0.1);
    color: var(--color-primary);
    border-color: rgba(178, 92, 46, 0.2);
}

/* ---------- Lightbox / Detail Modal ---------- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.lightbox-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.lightbox-overlay.active .lightbox-content {
    transform: translateY(0) scale(1);
}

.lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.75);
}

.lightbox-hero {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #f3ede4, #e8ddd0);
    overflow: hidden;
}

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

.lightbox-hero .placeholder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 5rem;
    color: rgba(178, 92, 46, 0.15);
}

.lightbox-body {
    padding: 28px 32px 32px;
}

.lightbox-name {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--color-primary);
    margin: 0 0 4px;
}

.lightbox-name-zh {
    font-size: 1rem;
    color: var(--color-text-light);
    margin: 0 0 16px;
}

.lightbox-desc {
    font-size: 1rem;
    color: var(--color-text);
    line-height: 1.7;
    margin: 0 0 20px;
}

.lightbox-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.lightbox-price {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.4;
}

.lightbox-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-primary);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
}

.lightbox-cta:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(178, 92, 46, 0.3);
    text-decoration: none;
    color: white;
}

/* Gallery grid inside lightbox */
.lightbox-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    margin: 16px 0;
}

.lightbox-gallery img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity 0.2s;
}

.lightbox-gallery img:hover {
    opacity: 0.8;
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: var(--space-xxl) var(--space-lg);
    color: var(--color-text-light);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state h2 {
    font-family: var(--font-display);
    color: var(--color-text);
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.empty-state h2::after {
    display: none;
}

.empty-state p {
    font-size: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

/* ---------- Loading State ---------- */
.loading-state {
    display: flex;
    justify-content: center;
    padding: var(--space-xxl);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ---------- Back to Home Link ---------- */
.gallery-nav {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.gallery-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-light);
    font-size: 0.92rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.gallery-nav a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

/* ---------- Footer ---------- */
.gallery-footer {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    margin-top: var(--space-xl);
}

.gallery-footer .order-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--color-primary), #D97706);
    color: white;
    padding: 16px 36px;
    border-radius: var(--radius-md);
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(178, 92, 46, 0.25);
    transition: all 0.3s ease;
}

.gallery-footer .order-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(178, 92, 46, 0.35);
    text-decoration: none;
    color: white;
}

.gallery-footer p {
    color: var(--color-text-light);
    font-size: 0.85rem;
    margin-top: var(--space-md);
}

/* ---------- Mobile Tweaks ---------- */
@media (max-width: 480px) {
    .gallery-intro h1 {
        font-size: 1.75rem;
    }

    .category-tabs {
        gap: 6px;
    }

    .category-tab {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .lightbox-body {
        padding: 20px;
    }

    .lightbox-name {
        font-size: 1.3rem;
    }

    .lightbox-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}
