/* Catalogue Page Styles */

/* Sidebar */
.cat-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: #4c4238;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.cat-link:hover {
    background: #f5ede3;
    color: #3a2916;
}

.cat-link.active {
    background: #3a2916;
    color: white;
}

.cat-link.active i {
    color: white;
}

.cat-link.cat-sub {
    font-size: 13px;
    padding: 6px 10px;
}

.cat-sub-list {
    border-left: 2px solid #e8e0d4;
    margin-left: 8px;
}

/* Gallery */
.gallery-header {
    grid-column: 1 / -1;
    margin-bottom: 8px;
}

.gallery-title {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #3a2916;
}

.gallery-subtitle {
    font-size: 14px;
    color: #8a7e6e;
    margin-top: 4px;
}

.gallery-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(58, 41, 22, 0.12);
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    display: block;
}

/* Lazy load fade-in effect */
.gallery-item img.lazy {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.gallery-item img.lazy.loaded {
    opacity: 1;
}

/* Hover overlay with zoom icon */
.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(58, 41, 22, 0);
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.gallery-item:hover::after {
    background: rgba(58, 41, 22, 0.15);
}

.gallery-item .zoom-icon {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.gallery-item:hover .zoom-icon {
    opacity: 1;
    transform: scale(1);
}

.gallery-placeholder {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, #f5ede3 0%, #e8d5c0 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #b8966a;
}

.gallery-placeholder i {
    width: 40px;
    height: 40px;
    opacity: 0.4;
}

.placeholder-label {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.6;
}

/* Gallery empty state */
.gallery-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-content img.loaded {
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: -48px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev {
    left: -64px;
}

.lightbox-next {
    right: -64px;
}

.lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-family: 'Be Vietnam Pro', sans-serif;
}

/* Mobile lightbox nav */
@media (max-width: 768px) {
    .lightbox-prev {
        left: 8px;
    }
    .lightbox-next {
        right: 8px;
    }
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
}

/* Mobile sidebar */
@media (max-width: 1023px) {
    #sidebar-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 40;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.25s ease;
        opacity: 0;
        background: rgba(250, 246, 241, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: 0 0 16px 16px;
        padding: 0 16px;
        margin-top: 64px;
    }

    #sidebar-nav.mobile-open {
        display: block !important;
        max-height: 75vh;
        overflow-y: auto;
        opacity: 1;
        padding: 16px;
        box-shadow: 0 12px 40px rgba(58, 41, 22, 0.15);
    }

    /* Hamburger animation */
    #sidebar-toggle.active #bar1 {
        transform: translateY(8px) rotate(45deg);
    }
    #sidebar-toggle.active #bar2 {
        opacity: 0;
        transform: translateX(-10px);
    }
    #sidebar-toggle.active #bar3 {
        width: 24px;
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Overlay */
    #sidebar-overlay.visible {
        display: block !important;
        opacity: 1;
    }

    .cat-link[data-toggle] {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}

/* Responsive gallery */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Lazy load */
.lazy {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.lazy.loaded {
    opacity: 1;
}

/* Gallery "Xem thêm" button */
.gallery-more {
    text-align: center;
    margin-top: 24px;
}

.btn-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #3a2916;
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-more:hover {
    background: #5a4530;
    transform: translateY(-1px);
}

.btn-more:active {
    transform: translateY(0);
}

/* Product Detail Layout */
.product-detail {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
    align-items: start;
    width: 100%;
}

.product-gallery {
    position: sticky;
    top: 100px;
    max-width: 450px;
}

.main-image {
    position: relative;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f0eb;
}

.main-image img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.main-image:hover img {
    transform: scale(1.02);
}

.thumbnail-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.thumb-item {
    position: relative;
    flex: 0 0 80px;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.thumb-item:hover {
    opacity: 1;
}

.thumb-item.active {
    border-color: #3a2916;
    opacity: 1;
}

.thumb-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

/* "+N" overlay on the last visible thumbnail when there are more images */
.thumb-item.thumb-more {
    opacity: 1;
}

.thumb-more-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(58, 41, 22, 0.55);
    color: #fff;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: background 0.2s ease;
}

.thumb-more:hover .thumb-more-overlay {
    background: rgba(58, 41, 22, 0.72);
}

/* Product Info */
.product-info {
    padding: 8px 0;
}

.product-info-glass {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.product-name {
    font-size: 28px;
    font-weight: 700;
    color: #3a2916;
    margin-bottom: 8px;
    font-family: 'Be Vietnam Pro', sans-serif;
}

.product-category {
    font-size: 14px;
    color: #5a4530;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-divider {
    height: 1px;
    background: #e8e0d4;
    margin: 20px 0;
}

.product-desc {
    color: #5a5a5a;
    line-height: 1.7;
    font-size: 15px;
}

.product-desc-glass {
    background: rgba(250, 246, 241, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    padding: 16px 20px;
    border: 1px solid rgba(232, 224, 212, 0.5);
}

.product-desc p {
    margin-bottom: 12px;
    text-align: justify;
    text-justify: inter-word;
}

/* Mobile: căn giữa cho dễ đọc trên màn hẹp */
@media (max-width: 768px) {
    .product-desc p {
        text-align: center;
    }
}

.product-price {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding: 16px 20px;
    background: #faf6f1;
    border-radius: 10px;
    border: 1px solid #e8e0d4;
}

.price-label {
    font-size: 14px;
    color: #8b7355;
    font-weight: 500;
}

.price-value {
    font-size: 20px;
    font-weight: 700;
    color: #3a2916;
}

.product-cta {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

.btn-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 10px;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    flex: 1;
    border: 2px solid transparent;
}

.btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Instagram — Primary style */
.btn-ig {
    background: #3a2916;
    color: white;
    border-color: #3a2916;
}

.btn-ig:hover {
    background: #5a4530;
    border-color: #5a4530;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(58, 41, 22, 0.25);
}

/* Facebook — Secondary/Outlined style */
.btn-fb {
    background: white;
    color: #3a2916;
    border-color: #d4c8b8;
}

.btn-fb:hover {
    border-color: #3a2916;
    background: #faf6f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(58, 41, 22, 0.1);
}

.btn-contact:active {
    transform: translateY(0);
}

/* Mobile Product Detail */
@media (max-width: 1023px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .product-gallery {
        position: static;
    }

    .product-name {
        font-size: 22px;
    }

    .product-cta {
        flex-direction: column;
    }

    .thumbnail-strip {
        gap: 6px;
    }

    .thumb-item {
        flex: 0 0 64px;
    }
}

@media (max-width: 480px) {
    .thumb-item {
        flex: 0 0 56px;
    }
}

/* Coming soon — danh mục chưa có ảnh */
.coming-soon {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 460px;
    padding: 48px 28px;
    border-radius: 16px;
    background: linear-gradient(150deg, #faf6f1 0%, #f0e5d6 55%, #e6d2b8 100%);
    border: 1px solid #e8d5c0;
}

.coming-soon-logo {
    width: 160px;
    height: auto;
    opacity: 0.9;
    margin-bottom: 24px;
}

.coming-soon-cat {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #b8966a;
    margin-bottom: 10px;
}

.coming-soon-title {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    color: #3a2916;
    margin: 0 0 14px;
}

.coming-soon-desc {
    max-width: 460px;
    color: #6b5f4f;
    font-size: 15px;
    line-height: 1.7;
    margin: 0 0 28px;
}

.coming-soon-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.coming-soon-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 10px;
    background: #3a2916;
    color: #fff;
    border: 1px solid #3a2916;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.coming-soon-cta:hover {
    background: #5a4530;
    border-color: #5a4530;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(58, 41, 22, 0.25);
}

/* Facebook — biến thể viền, nền trong */
.coming-soon-cta.is-outline {
    background: transparent;
    color: #3a2916;
    border-color: #d4c8b8;
}

.coming-soon-cta.is-outline:hover {
    background: #fff;
    border-color: #3a2916;
}

.coming-soon-cta .btn-icon {
    width: 20px;
    height: 20px;
}
