/* Alviti Product Template Styles */

/* CSS Variables - Add these if not already in your theme */
:root {
    --primary-burgundy: #8B2635;
    --primary-burgundy-dark: #6B1D28;
    --gold: #D4AF37;
    --gold-light: #E5C158;
    --navy: #0F1419;
    --navy-medium: #252B38;
    --cream: #E8DED0;
    --gray-200: #DEE2E6;
    --gray-300: #CED4DA;
    --gray-400: #ADB5BD;
    --gray-500: #6C757D;
    --gray-600: #495057;
    --gray-700: #343A40;
}



/* Ensure container has proper width */
.product-detail-hero .container,
.product-detail-container .container,
.related-products .container,
.product-archive-hero .container,
.product-archive-container .container {
    max-width: 1280px;
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    width: 100%;
}

/* Product Detail Specific Styles */
.product-detail-hero {
    background: #e9ded1 !important;
	background-image: linear-gradient(140deg, #2A2B26 50%, #68202B 80%) !important;
    padding: 110px 0 100px !important;
    width: 100%;
}

.product-hero-title {
    color: #ffffff !important;
    font-size: 48px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    text-align: center !important;
    line-height: 1.2 !important;
    font-family: 'Cormorant Garamond', serif !important;
}

.breadcrumb,
.product-archive-hero .breadcrumb,
.product-detail-hero .breadcrumb {
    display: none !important;
}

.breadcrumb a,
.product-archive-hero .breadcrumb a,
.product-detail-hero .breadcrumb a {
    color: #D4AF37 !important;
    color: var(--gold) !important;
    text-decoration: none !important;
    transition: color 0.3s ease;
}

.breadcrumb a:hover,
.product-archive-hero .breadcrumb a:hover,
.product-detail-hero .breadcrumb a:hover {
    color: #E5C158 !important;
    color: var(--gold-light) !important;
}

.breadcrumb span,
.product-archive-hero .breadcrumb span,
.product-detail-hero .breadcrumb span {
    color: #6C757D !important;
    color: var(--gray-500) !important;
}

.product-detail-container {
    padding: 60px 0;
    background: var(--cream);
    width: 100%;
}

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

.product-gallery {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.main-image {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.main-image img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top:20px;
}

.thumbnail {
    background: white;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--gold);
    transform: translateY(-2px);
}

.thumbnail img {
    width: 100%;
    height: 80px;
    object-fit: contain;
}

.product-info {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.product-category {
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.product-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    color: var(--navy);
    margin-bottom: 15px;
    line-height: 1.2;
}

.product-sku {
    color: var(--gray-600);
    font-size: 0.95rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.product-price {
    margin-bottom: 25px;
}

.product-price,
.product-price .woocommerce-Price-amount,
.product-price .amount,
.product-price bdi,
.product-price .woocommerce-Price-currencySymbol {
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: var(--primary-burgundy) !important;
    font-family: 'Cormorant Garamond', serif !important;
    line-height: 1.2 !important;
}

/* For products with sale prices */
.product-price .price,
.product-price p.price {
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: var(--primary-burgundy) !important;
    font-family: 'Cormorant Garamond', serif !important;
    margin: 0 !important;
}

.product-price del,
.product-price del .woocommerce-Price-amount,
.product-price del .amount,
.product-price del bdi {
    font-size: 1.5rem !important;
    color: var(--gray-500) !important;
    margin-right: 15px !important;
    opacity: 0.7 !important;
    font-weight: 500 !important;
}

.product-price ins {
    text-decoration: none !important;
    background: none !important;
}

.product-price ins .woocommerce-Price-amount,
.product-price ins .amount,
.product-price ins bdi {
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: var(--primary-burgundy) !important;
    font-family: 'Cormorant Garamond', serif !important;
}

.product-description {
    color: var(--gray-700);
    line-height: 1.8;
    margin-bottom: 30px;
    font-size: 1.05rem;
}

.product-specifications {
    border-top: 1px solid var(--gray-300);
    border-bottom: 1px solid var(--gray-300);
    padding: 30px 0;
    margin-bottom: 30px;
}

.spec-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 20px;
}

.spec-list {
    display: grid;
    gap: 15px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-label {
    font-weight: 600;
    color: var(--navy);
    min-width: 150px;
}

.spec-value {
    color: var(--gray-700);
    text-align: right;
}

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

.features-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 15px;
}

.features-list {
    list-style: none;
    padding: 0;
}

.features-list li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    color: var(--gray-700);
    line-height: 1.6;
}

.features-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--gold);
    font-weight: bold;
    font-size: 1.2rem;
}

.product-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.btn-contact {
    flex: 1;
    padding: 16px 32px;
    background: var(--primary-burgundy);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    font-size: 1rem;
    display: inline-block;
}

.btn-contact:hover {
    background: var(--primary-burgundy-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 38, 53, 0.3);
    color: white;
}

.btn-catalog {
    flex: 1;
    padding: 16px 32px;
    background: transparent;
    color: var(--gold);
    border: 2px solid var(--gold);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    font-size: 1rem;
    display: inline-block;
}

.btn-catalog:hover {
    background: var(--gold);
    color: var(--navy);
    transform: translateY(-2px);
}

.product-note {
    background: rgba(212, 175, 55, 0.1);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--gold);
    color: var(--gray-700);
    line-height: 1.6;
}

.related-products {
    padding: 60px 0;
    background: white;
    width: 100%;
}

.related-header {
    text-align: center;
    margin-bottom: 50px;
}

.related-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    color: var(--navy);
    margin-bottom: 15px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.product-card .product-image {
    background: #fff;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 320px;
    overflow: hidden;
    border-bottom: 1px solid #000;
}

.product-card .product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.product-card .product-content {
    padding: 25px;
}

.product-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--navy);
}

.product-card h3 a {
    color: var(--navy);
    text-decoration: none;
}

.product-card h3 a:hover {
    color: var(--primary-burgundy);
}

.product-card p {
    color: var(--gray-600);
    margin-bottom: 15px;
}

.product-card .product-link {
    display: inline-block !important;
    padding: 12px 24px !important;
    background: var(--primary-burgundy) !important;
    color: white !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
}

.product-card .product-link:hover {
    background: var(--primary-burgundy-dark) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(139, 38, 53, 0.3) !important;
}

@media (max-width: 968px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .product-gallery {
        position: relative;
        top: 0;
    }

    .product-title {
        font-size: 2rem;
    }

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

@media (max-width: 640px) {
    .thumbnail-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .product-info {
        padding: 25px;
    }

    .product-detail-hero {
        padding: 120px 0 40px;
    }
}

/* ========================================
   PRODUCT ARCHIVE / CATEGORY PAGE STYLES
   ======================================== */

.product-archive-hero,
section.product-archive-hero {
    background: linear-gradient(135deg, #0F1419 0%, #252B38 100%) !important;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-medium) 100%) !important;
    padding: 140px 0 60px !important;
    width: 100% !important;
    position: relative;
    z-index: 1;
}

.archive-title,
.product-archive-hero .archive-title,
h1.archive-title {
    font-family: 'Cormorant Garamond', serif !important;
    font-size: 65px !important;
    font-weight: 500;
    color: white !important;
    margin-bottom: 15px !important;
    text-align: center !important;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    animation-delay: 0.2s;
}

.archive-description,
.product-archive-hero .archive-description {
    color: #ADB5BD !important;
    color: var(--gray-400) !important;
    text-align: center !important;
    max-width: 800px !important;
    margin: 0 auto !important;
    line-height: 1.8 !important;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    animation-delay: 0.4s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-archive-container {
    padding: 60px 0;
    background: var(--cream);
    width: 100%;
    min-height: 500px;
}

/* Archive Layout with Sidebar */
.archive-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/* Product Sidebar */
.product-sidebar {
    position: sticky;
    top: 120px;
    height: 100vh;
    overflow-y: scroll;
}

.sidebar-widget {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.widget-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    color: var(--navy);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gold);
}

.product-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-categories li {
    margin-bottom: 8px;
}

.product-categories li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.product-categories li a:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--primary-burgundy);
    transform: translateX(5px);
}

.product-categories li.current-cat a,
.product-categories li.all-products a:hover {
    background: var(--primary-burgundy);
    color: white;
}

.product-categories li.current-cat a:hover {
    transform: translateX(0);
}

.product-categories .count {
    font-size: 0.85rem;
    color: var(--gray-500);
    background: var(--gray-200);
    padding: 2px 8px;
    border-radius: 12px;
}

.product-categories li.current-cat .count,
.product-categories li.all-products a:hover .count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Main Content Area */
.archive-main-content {
    min-width: 0;
}

/* Product Search Form */
.product-search-container {
    background: white;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.product-search-form {
    width: 100%;
}

.search-wrapper {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-field {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    color: var(--navy);
}

.search-field:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.search-field::placeholder {
    color: var(--gray-500);
}

.search-submit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--primary-burgundy);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-submit:hover {
    background: var(--primary-burgundy-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 38, 53, 0.3);
}

.search-submit svg {
    flex-shrink: 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Product Card Styles for Archive */
.products-grid .product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.products-grid .product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.products-grid .product-card .product-image {
    background: #1f2530;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    position: relative;
    overflow: hidden;
}

.products-grid .product-card .product-image img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

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

.products-grid .product-card .product-content {
    padding: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.products-grid .product-card .product-category {
    color: var(--gold);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.products-grid .product-card h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--navy);
    line-height: 1.3;
}

.products-grid .product-card h3 a {
    color: var(--navy);
    text-decoration: none;
    transition: color 0.3s ease;
}

.products-grid .product-card h3 a:hover {
    color: var(--primary-burgundy);
}

.products-grid .product-card .product-sku {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.products-grid .product-card .product-excerpt {
    color: var(--gray-700);
    margin-bottom: 20px;
    line-height: 1.6;
    flex: 1;
}

.products-grid .product-card .btn-view-details {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-burgundy);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.products-grid .product-card .btn-view-details:hover {
    background: var(--primary-burgundy-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 38, 53, 0.3);
    color: white;
}

/* WooCommerce Result Count & Ordering */
.woocommerce-result-count,
.woocommerce-ordering {
    margin-bottom: 20px !important;
    color: var(--gray-700) !important;
}

.woocommerce-ordering select {
    padding: 10px 15px !important;
    border: 1px solid var(--gray-300) !important;
    border-radius: 8px !important;
    background: white !important;
    color: var(--navy) !important;
    font-size: 0.95rem !important;
}

/* Fix WooCommerce toolbar layout */
.woocommerce-before-shop-loop {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin-bottom: 30px !important;
    flex-wrap: wrap !important;
}

.woocommerce .woocommerce-result-count {
    margin: 0 !important;
    flex: 0 0 auto !important;
}

.woocommerce .woocommerce-ordering {
    margin: 0 !important;
    flex: 0 0 auto !important;
}

/* Ensure products grid displays correctly */
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 30px !important;
    width: 100% !important;
    clear: both !important;
}

/* Pagination */
.woocommerce-pagination {
    margin-top: 50px;
    text-align: center;
}

.woocommerce-pagination ul {
    display: inline-flex;
    gap: 10px;
    list-style: none;
    padding: 0;
}

.woocommerce-pagination ul li {
    margin: 0;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: block;
    padding: 10px 16px;
    background: white;
    color: var(--navy);
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

.woocommerce-pagination ul li a:hover,
.woocommerce-pagination ul li span.current {
    background: var(--primary-burgundy);
    border-color: var(--primary-burgundy);
    color: white;
}

/* No Products Found */
.no-products-found {
    text-align: center;
    padding: 80px 20px;
}

.no-products-found h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    color: var(--navy);
    margin-bottom: 20px;
}

.no-products-found p {
    color: var(--gray-700);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.no-products-found .btn-primary {
    display: inline-block;
    padding: 16px 32px;
    background: var(--primary-burgundy);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.no-products-found .btn-primary:hover {
    background: var(--primary-burgundy-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 38, 53, 0.3);
}

/* Archive Page Responsive */
@media (max-width: 968px) {
    .archive-title {
        font-size: 2.5rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 25px;
    }

    .product-archive-hero {
        padding: 120px 0 50px;
    }

    /* Stack sidebar on top for tablets and reorder for mobile using CSS Grid */
    .archive-layout {
        display: grid;
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Use display: contents to flatten main-content children to archive-layout level */
    .archive-main-content {
        display: contents;
    }

    /* Grid Row 1: Search form first */
    .product-search-container {
        grid-row: 1;
    }

    /* Grid Row 2: Categories sidebar second */
    .product-sidebar {
        position: relative;
        top: 0;
        grid-row: 2;
    }

    /* Grid Row 3: WooCommerce toolbar (result count and sorting) */
    .woocommerce-before-shop-loop {
        grid-row: 3;
    }

    /* Grid Row 4: Products grid */
    .products-grid {
        grid-row: 4;
    }

    /* Grid Row 5: Pagination */
    .woocommerce-after-shop-loop,
    .woocommerce-pagination {
        grid-row: 5;
    }

    /* Ensure no products found message has correct order */
    .no-products-found {
        grid-row: 4;
    }

    /* Hide result count on mobile */
    .woocommerce-result-count {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .archive-title {
        font-size: 2rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .products-grid .product-card .product-content {
        padding: 20px;
    }

    .product-archive-hero {
        padding: 100px 0 40px;
    }

    /* Mobile search form */
    .product-search-container {
        padding: 20px;
    }

    .search-wrapper {
        flex-direction: column;
        gap: 10px;
    }

    .search-field,
    .search-submit {
        width: 100%;
    }

    .search-submit {
        justify-content: center;
    }
}