/* ============================================
   Products Page - Premium Catalog Design
   Sweet Makers 2026
   ============================================ */

/* === Premium Hero Section === */
.products-hero {
    background: linear-gradient(135deg, #1a0f0a 0%, #2C1810 50%, #4A2C1A 100%);
    position: relative;
    overflow: hidden;
    min-height: 500px;
}

.products-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../assets/images/catalog/1.jpg') center/cover no-repeat;
    opacity: 0.3;
    z-index: 0;
}

.products-hero::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -10%;
    width: 120%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(139, 90, 60, 0.4) 0%, transparent 70%);
    z-index: 1;
}

.products-hero .container {
    position: relative;
    z-index: 2;
}

.page-hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    background: linear-gradient(135deg, var(--color-gold) 0%, #F4E4C1 50%, var(--color-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    animation: shimmerText 3s infinite;
}

@keyframes shimmerText {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.page-hero-subtitle {
    color: var(--color-cream);
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: 0.9;
}

/* === Category Tabs Section === */
.category-tabs-section {
    background: var(--gradient-chocolate);
    padding: var(--spacing-lg) 0;
    position: sticky;
    top: 70px;
    z-index: var(--z-sticky);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--spacing-sm);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(212, 175, 55, 0.15);
    max-width: 900px;
    margin: 0 auto;
}

.category-tab {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: transparent;
    color: var(--color-cream);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.category-tab:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--color-gold);
    transform: translateY(-2px);
}

.category-tab.active {
    background: var(--gradient-gold);
    color: var(--color-dark-chocolate);
    border-color: var(--color-gold);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
}

.tab-icon {
    font-size: 1.2rem;
}

.tab-count {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    margin-left: 4px;
}

.category-tab.active .tab-count {
    background: rgba(44, 24, 16, 0.2);
}

/* === Products Grid Section === */
.products-grid-section {
    background: linear-gradient(180deg, #1a0f0a 0%, #2C1810 100%);
    min-height: 80vh;
    padding: var(--spacing-3xl) 0;
    position: relative;
}

.products-grid-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg, rgba(74, 44, 26, 0.5) 0%, transparent 100%);
    pointer-events: none;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-xl);
    position: relative;
    z-index: 1;
}

/* === Premium Product Card === */
.product-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.15);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, 0.1) 50%, transparent 100%);
    transition: left 0.6s ease;
    z-index: 1;
    pointer-events: none;
}

.product-card:hover::before {
    left: 100%;
}

.product-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.4);
}

/* Product Image */
.product-image-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: linear-gradient(135deg, #2C1810 0%, #1a0f0a 100%);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

/* Product Overlay */
.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(26, 15, 10, 0.95) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: var(--spacing-lg);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-overlay .btn {
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease 0.1s;
}

.product-card:hover .product-overlay .btn {
    transform: translateY(0);
    opacity: 1;
}

/* Product Info */
.product-info {
    padding: var(--spacing-md);
    background: rgba(0, 0, 0, 0.3);
}

.product-name {
    font-family: var(--font-heading);
    font-size: var(--font-size-xl);
    color: var(--color-gold);
    margin-bottom: var(--spacing-xs);
    line-height: 1.3;
}

.product-flavor {
    font-size: var(--font-size-sm);
    color: var(--color-cream);
    opacity: 0.8;
    margin-bottom: var(--spacing-xs);
}

.product-description {
    font-size: var(--font-size-sm);
    color: var(--color-gray-300);
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-specs {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-sm);
}

.product-spec {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-xs);
    color: var(--color-cream);
    background: rgba(212, 175, 55, 0.15);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.product-spec-icon {
    font-size: 0.9rem;
}

/* Category Badge */
.product-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--gradient-gold);
    color: var(--color-dark-chocolate);
    font-size: var(--font-size-xs);
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Product Modal === */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.product-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(145deg, #2C1810 0%, #1a0f0a 100%);
    border-radius: var(--radius-xl);
    max-width: 1100px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.product-modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 50px;
    height: 50px;
    background: rgba(212, 175, 55, 0.2);
    border: 2px solid var(--color-gold);
    border-radius: 50%;
    color: var(--color-gold);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-close:hover {
    background: var(--color-gold);
    color: var(--color-dark-chocolate);
    transform: rotate(90deg);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-image-section {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: var(--spacing-sm);
    max-height: 80vh;
    overflow: hidden;
}

.modal-image {
    width: 100%;
    height: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.modal-details-section {
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    max-height: 80vh;
}


.modal-product-name {
    font-family: var(--font-heading);
    font-size: var(--font-size-4xl);
    color: var(--color-gold);
    margin-bottom: var(--spacing-xs);
}

.modal-product-flavor {
    font-size: var(--font-size-xl);
    color: var(--color-cream);
    opacity: 0.8;
    margin-bottom: var(--spacing-md);
}

.modal-product-description {
    font-size: var(--font-size-base);
    color: var(--color-gray-300);
    line-height: 1.8;
    margin-bottom: var(--spacing-lg);
}

.modal-specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.modal-spec-item {
    background: rgba(212, 175, 55, 0.1);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.modal-spec-label {
    font-size: var(--font-size-xs);
    color: var(--color-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.modal-spec-value {
    font-size: var(--font-size-lg);
    color: var(--color-cream);
    font-weight: 600;
}

.modal-cta-buttons {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

/* === B2B CTA Section === */
.b2b-cta-section {
    background: linear-gradient(135deg, #2C1810 0%, #1a0f0a 100%);
    position: relative;
    overflow: hidden;
}

.b2b-cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.b2b-cta-card {
    text-align: center;
    padding: var(--spacing-3xl);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-xl);
    position: relative;
    z-index: 1;
}

.b2b-cta-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    background: linear-gradient(135deg, var(--color-gold) 0%, #F4E4C1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-md);
}

.b2b-cta-text {
    font-size: var(--font-size-lg);
    color: var(--color-cream);
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto var(--spacing-xl);
    opacity: 0.9;
}

.b2b-cta-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* === Loading Animation === */
.product-card.loading {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: var(--spacing-3xl);
    color: var(--color-cream);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state-text {
    font-size: var(--font-size-xl);
    opacity: 0.7;
}

/* === Responsive Design === */
@media (max-width: 968px) {
    .category-tabs-section {
        position: static;
    }

    .category-tabs {
        padding: var(--spacing-xs);
        gap: var(--spacing-xs);
    }

    .category-tab {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-xs);
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: var(--spacing-lg);
    }

    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-image-section {
        min-height: 250px;
    }

    .modal-details-section {
        padding: var(--spacing-lg);
    }

    .modal-specs-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-image-wrapper {
        height: 220px;
    }

    .b2b-cta-card {
        padding: var(--spacing-xl);
    }

    .b2b-cta-buttons {
        flex-direction: column;
    }

    .b2b-cta-buttons .btn {
        width: 100%;
    }

    .modal-cta-buttons {
        flex-direction: column;
    }

    .modal-cta-buttons .btn {
        width: 100%;
    }
}

/* === Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.6s ease backwards;
}

.product-card:nth-child(1) {
    animation-delay: 0.05s;
}

.product-card:nth-child(2) {
    animation-delay: 0.1s;
}

.product-card:nth-child(3) {
    animation-delay: 0.15s;
}

.product-card:nth-child(4) {
    animation-delay: 0.2s;
}

.product-card:nth-child(5) {
    animation-delay: 0.25s;
}

.product-card:nth-child(6) {
    animation-delay: 0.3s;
}

.product-card:nth-child(7) {
    animation-delay: 0.35s;
}

.product-card:nth-child(8) {
    animation-delay: 0.4s;
}

.product-card:nth-child(9) {
    animation-delay: 0.45s;
}

.product-card:nth-child(10) {
    animation-delay: 0.5s;
}

.product-card:nth-child(11) {
    animation-delay: 0.55s;
}

.product-card:nth-child(12) {
    animation-delay: 0.6s;
}

/* === Scrollbar Styling === */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--color-gold);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-gold-light);
}