/* Hero Section */
.products-hero {
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url("/static/images/products-hero.jpg");
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero-content {
    text-align: center;
    color: white;
    max-width: 800px;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    margin-bottom: 1rem;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Modern Product Card Variables */
:root {
    --card-radius: 12px;
    --card-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --card-hover-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
    --card-transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --overlay-bg: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.4));
    --badge-bg: var(--accent, #d5b100);
    --badge-color: #fff;
    --button-radius: 8px;
    --primary-button-bg: var(--primary-dark, #1b1464);
    --secondary-button-bg: var(--accent, #d5b100);
    --button-text: #ffffff;
    --button-hover-transform: translateY(-3px);
    --info-box-bg: rgba(255, 255, 255, 0.95);
    --info-box-dark-bg: rgba(30, 30, 45, 0.9);
    --info-border: 3px solid var(--accent, #d5b100);
    --info-shadow: 0 4px 15px rgba(27, 20, 100, 0.25);
    --info-box-text: var(--primary-dark, #1b1464);
    --section-bg: #f9f9f9;
    --dark-section-bg: #1c1c24;
}

/* Vertical Products with Popup Styles */
.vertical-products-section {
    padding: 4rem 0;
    background-color: var(--section-bg);
    border-top: 1px solid rgba(120, 109, 60, 0.2);
    border-bottom: 1px solid rgba(120, 109, 60, 0.2);
}

.vertical-products-section .section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.vertical-products-section .section-header h2 {
    color: var(--primary-dark);
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
    letter-spacing: -0.5px;
}

.vertical-products-section .section-header h2::after {
    content: "";
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background-color: var(--accent);
    border-radius: 2px;
}

.vertical-products-section .section-header p {
    color: #555;
    font-size: 1.3rem;
    max-width: 700px;
    margin: 1.5rem auto 0;
    line-height: 1.6;
}

.vertical-products-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.vertical-product-card {
    position: relative;
    width: 100%;
    height: 450px;
    perspective: 1000px;
    cursor: pointer;
}

.product-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: var(--card-transition);
    transform-style: preserve-3d;
}

.vertical-product-card:hover .product-card-inner {
    transform: rotateY(180deg);
}

.product-card-front, .product-card-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--card-radius);
    overflow: hidden;
}

.product-card-front {
    box-shadow: var(--card-shadow);
    z-index: 1;
}

.product-card-overlay {
    background: var(--overlay-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem;
    color: white;
    transform: rotateY(180deg);
    box-shadow: var(--card-hover-shadow);
}

.vertical-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.5s ease;
}

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

.product-card-badge {
    position: absolute;
    top: 20px;
    left: -5px;
    background-color: var(--badge-bg);
    color: var(--badge-color);
    padding: 8px 15px;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

.product-card-badge::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 5px;
    height: 5px;
    background-color: rgba(0, 0, 0, 0.3);
    border-top-left-radius: 5px;
}

/* Product Info Box Styles */
.product-info-box {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: var(--info-box-bg);
    border-radius: 10px;
    padding: 14px;
    box-shadow: var(--info-shadow);
    z-index: 5;
    border-left: var(--info-border);
    min-width: 160px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.product-card-front:hover .product-info-box {
    transform: translateX(-5px) translateY(-3px);
    box-shadow: 0 8px 20px rgba(27, 20, 100, 0.4);
}

.product-price, .product-state {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.product-state {
    margin-bottom: 0;
}

.price-label, .state-label {
    font-weight: 600;
    color: var(--primary-dark);
}

.price-value {
    font-weight: 700;
    color: var(--accent);
}

.state-value {
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    text-align: center;
}

.in-stock {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
}

.low-stock {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.out-stock {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

/* Dark mode styles for product info box */
.dark-mode .product-info-box {
    background-color: rgba(30, 30, 45, 0.9);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border-left: 3px solid var(--accent);
}

.dark-mode .price-label, 
.dark-mode .state-label {
    color: #e0e0e0;
}

.dark-mode .price-value {
    color: var(--accent);
}

.dark-mode .in-stock {
    background-color: rgba(40, 167, 69, 0.25);
}

.dark-mode .low-stock {
    background-color: rgba(255, 193, 7, 0.25);
}

.dark-mode .out-stock {
    background-color: rgba(220, 53, 69, 0.25);
}

.product-features {
    margin: 1.5rem 0;
}

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

.product-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 1rem;
}

.product-features li i {
    color: var(--accent);
    font-size: 1.1rem;
}

.vertical-product-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.vertical-product-description {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    line-height: 1.6;
    max-height: 7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.vertical-product-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    width: 100%;
}

.vertical-product-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    color: var(--button-text);
    text-decoration: none;
    border-radius: var(--button-radius);
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    flex: 1;
    text-align: center;
}

.vertical-product-button.primary {
    background-color: var(--primary-button-bg);
}

.vertical-product-button.secondary {
    background-color: var(--secondary-button-bg);
}

.vertical-product-button:hover {
    transform: var(--button-hover-transform);
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.2);
}

.vertical-product-button.primary:hover {
    background-color: var(--accent);
}

.vertical-product-button.secondary:hover {
    background-color: var(--primary-dark);
}

/* Product Popup Styles */
.product-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    backdrop-filter: blur(3px);
}

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

.product-popup {
    position: relative;
    background-color: white;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.product-popup-overlay.active .product-popup {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.product-popup-header {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.product-popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.product-popup-close:hover {
    background-color: var(--primary-dark);
}

.product-popup-content {
    padding: 2rem;
    overflow-y: auto;
}

.product-popup-title {
    color: var(--primary-dark);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 3px solid var(--accent);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.product-popup-details {
    margin-bottom: 2rem;
}

.product-popup-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 1.5rem;
}

.product-popup-specs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.product-popup-spec {
    background-color: #f5f5f5;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}

.product-popup-spec h4 {
    color: var(--primary-dark);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.product-popup-spec p {
    color: #555;
    font-size: 1rem;
}

.product-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.product-popup-button {
    padding: 0.85rem 1.5rem;
    background-color: var(--primary-dark);
    color: white;
    text-decoration: none;
    border-radius: var(--button-radius);
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 180px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.product-popup-button:hover {
    background-color: var(--accent);
    transform: var(--button-hover-transform);
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.2);
}

.product-popup-button.secondary {
    background-color: var(--secondary-button-bg);
}

.product-popup-button.secondary:hover {
    background-color: var(--primary-dark);
}

.product-popup-button i {
    font-size: 1.1rem;
}

/* Status and Trend Indicators */
.status-container {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.trend {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.trend.up {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.trend.down {
    background-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.trend.neutral {
    background-color: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

/* Dark Mode Styles */
.dark-mode .vertical-products-section {
    background-color: var(--dark-section-bg);
    border-color: rgba(200, 200, 200, 0.1);
}

.dark-mode .section-header h2 {
    color: #ffffff;
}

.dark-mode .section-header p {
    color: #aaaaaa;
}

.dark-mode .product-popup {
    background-color: #202030;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.dark-mode .product-popup-title,
.dark-mode .product-popup-spec h4 {
    color: #ffffff;
}

.dark-mode .product-popup-description,
.dark-mode .product-popup-spec p {
    color: #dddddd;
}

.dark-mode .product-popup-spec {
    background-color: #2a2a3a;
    border-color: var(--accent);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .vertical-products-container {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .vertical-product-card {
        height: 400px;
    }
    
    .vertical-product-title {
        font-size: 1.8rem;
    }
    
    .product-popup-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .vertical-products-container {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
    
    .vertical-product-card {
        height: 350px;
    }
    
    .vertical-product-title {
        font-size: 1.5rem;
    }
    
    .vertical-product-description {
        font-size: 1rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
    
    .product-popup-header {
        height: 220px;
    }
    
    .product-popup-specs {
        grid-template-columns: 1fr;
    }
    
    .product-popup-actions {
        justify-content: center;
    }
    
    .product-popup-button {
        flex: 1 1 45%;
    }
    
    .product-info-box {
        top: 15px;
        right: 15px;
        padding: 10px;
        min-width: 130px;
    }
    
    .price-label, .state-label, .price-value, .state-value {
        font-size: 0.85rem;
    }
    
    .product-card-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .vertical-products-section .section-header h2 {
        font-size: 2.2rem;
    }
    
    .vertical-products-section .section-header p {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .vertical-products-container {
        grid-template-columns: 1fr;
        max-width: 360px;
    }
    
    .vertical-product-card {
        height: 400px;
    }
    
    .product-card-overlay {
        padding: 1.5rem;
    }
    
    .vertical-product-title {
        font-size: 1.5rem;
    }
    
    .product-popup-header {
        height: 180px;
    }
    
    .product-popup-content {
        padding: 1.5rem;
    }
    
    .product-popup-title {
        font-size: 1.5rem;
    }
    
    .product-info-box {
        min-width: 110px;
    }
    
    .price-label, .state-label, .price-value, .state-value {
        font-size: 0.75rem;
    }
    
    .vertical-products-section .section-header h2 {
        font-size: 1.8rem;
    }
    
    .vertical-products-section .section-header p {
        font-size: 1rem;
    }
    
    .vertical-product-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .vertical-product-card {
        height: 350px;
    }
    
    .product-card-overlay {
        padding: 1.25rem;
    }
    
    .vertical-product-title {
        font-size: 1.3rem;
    }
    
    .vertical-product-description {
        font-size: 0.9rem;
    }
    
    .product-features li {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .product-popup {
        width: 95%;
    }
    
    .product-popup-actions {
        flex-direction: column;
    }
    
    .product-popup-button {
        width: 100%;
    }
}
