/* Products Section Styles */

/* Products Section */
.products {
    padding: 6rem 0;
    background: #f8f6f3;
    overflow: visible !important;
/* Mobile Dropdown Overlay */
.dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
}

.dropdown-overlay.active {
    display: block;
}

/* Close button for mobile dropdown */
.dropdown-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(139, 69, 19, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
}

@media (max-width: 768px) {
    .dropdown-close {
        display: flex;
    }
}

.products-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #8B4513, #D2691E);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c1810;
    font-family: 'Playfair Display', serif;
}

.section-description {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    overflow: visible !important;
}

/* Product Card */
.product-card {
    position: relative;
    height: 600px;
    perspective: 1000px;
    overflow: visible !important;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    overflow: visible !important;
}

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

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: visible !important;
}

.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #f8f6f3 0%, #ede4d3 100%);
}

/* Product Image */
.product-image-container {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 20px 20px 0 0; /* Round only top corners */
}

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

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

.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #8B4513, #D2691E);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Product Content */
.product-content {
    padding: 1.5rem;
    height: calc(100% - 250px);
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    color: #2c1810;
    font-family: 'Playfair Display', serif;
}

.product-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.btn-origins {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, #8B4513, #D2691E);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-origins:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

.btn-origins.active .arrow-icon {
    transform: rotate(180deg);
}

.arrow-icon {
    transition: transform 0.3s ease;
}

/* Origins Dropdown */
.origins-dropdown {
    position: absolute;
    top: calc(7% + 0.5rem);
    left: 0;
    right: 0;
    background: white !important;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(139, 69, 19, 0.1);
    display: none;
    z-index: 9999 !important;
    min-height: 200px;
    width: 100%;
}

.origins-dropdown.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.origins-container {
    padding: 1.5rem;
    max-height: 450px;
    overflow-y: auto;
    background: white;
    border-radius: 20px;
}

.origin-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.8rem;
    border: 1px solid transparent;
}

.origin-option:hover {
    background: linear-gradient(135deg, #f8f6f3, #f0ede6);
    transform: translateX(5px);
    border-color: rgba(139, 69, 19, 0.1);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.05);
}

.origin-option:last-child {
    margin-bottom: 0;
}

.origin-flag {
    font-size: 2rem;
    width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.origin-details {
    flex: 1;
    min-width: 0;
}

.origin-country {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c1810;
    margin-bottom: 0.2rem;
}

.origin-manufacturer {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.3;
    word-wrap: break-word;
}

/* Back Side Content */
.inquiry-content {
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.inquiry-icon {
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.inquiry-content h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #2c1810;
    font-family: 'Playfair Display', serif;
}

.inquiry-content p {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.selected-origin {
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    width: 100%;
    border: 1px solid rgba(139, 69, 19, 0.2);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.origin-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

.origin-display .flag {
    font-size: 1.8rem;
    line-height: 1;
}

.origin-display .info {
    text-align: center;
    flex: 1;
}

.origin-display .info h5 {
    font-size: 1.1rem;
    color: #2c1810;
    margin: 0 0 0.3rem 0;
    font-weight: 600;
    line-height: 1.2;
}

.origin-display .info p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    line-height: 1.3;
}

.btn-inquiry {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
    max-width: 250px;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #8B4513, #D2691E);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.btn-inquiry:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.4);
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: transparent;
    color: #8B4513;
    border: 2px solid #8B4513;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #8B4513;
    color: white;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .product-card {
        margin-bottom: 3rem; /* Add space for dropdowns */
    }
}

@media (max-width: 768px) {
    .products {
        padding: 4rem 0;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 3rem; /* Increased gap to prevent overlap */
    }
    
    .product-card {
        height: 550px;
        margin-bottom: 4rem; /* Extra space for mobile dropdowns */
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-description {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    /* Mobile specific dropdown styles */
    .origins-dropdown {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: calc(100vw - 2rem);
        max-width: 400px;
        max-height: 70vh;
        z-index: 10000 !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        margin: 0;
    }
    
    .origins-dropdown.active {
        display: block !important;
    }
    
    .origins-container {
        max-height: calc(70vh - 3rem);
        padding: 1rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    .origin-option {
        padding: 0.8rem;
        margin-bottom: 0.6rem;
        gap: 0.8rem;
    }
    
    .origin-option:hover {
        transform: none; /* Remove hover transform on mobile */
        background: #f8f6f3;
    }
    
    .origin-flag {
        font-size: 1.5rem;
        width: 40px;
    }
    
    .origin-country {
        font-size: 1rem;
    }
    
    .origin-manufacturer {
        font-size: 0.85rem;
    }
    
    .inquiry-content {
        padding: 1.5rem;
    }
    
    .inquiry-content h4 {
        font-size: 1.3rem;
    }
    
    .inquiry-content p {
        font-size: 0.9rem;
    }
    
    .btn-inquiry {
        font-size: 0.9rem;
        padding: 0.9rem 1.3rem;
        max-width: 200px;
    }
    
    .btn-back {
        font-size: 0.9rem;
        padding: 0.7rem 1.2rem;
    }
    
    .selected-origin {
        padding: 0.8rem;
    }
    
    .origin-display .flag {
        font-size: 1.5rem;
    }
    
    .origin-display .info h5 {
        font-size: 1rem;
    }
    
    .origin-display .info p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .products {
        padding: 3rem 0;
    }
    
    .products-grid {
        gap: 2.5rem;
    }
    
    .product-card {
        height: 500px;
        margin-bottom: 3rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .product-title {
        font-size: 1.2rem;
    }
    
    .product-description {
        font-size: 0.9rem;
    }
    
    .btn-origins {
        padding: 0.7rem;
        font-size: 0.85rem;
    }
    
    /* Even more mobile-friendly dropdown */
    .origins-dropdown {
        width: calc(100vw - 1rem);
        max-width: 350px;
        max-height: 80vh;
    }
    
    .origins-container {
        max-height: calc(80vh - 2rem);
        padding: 0.8rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .origin-option {
        padding: 0.7rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .origin-flag {
        font-size: 2rem;
        width: auto;
    }
    
    .origin-details {
        text-align: center;
    }
    
    .inquiry-content {
        padding: 1rem;
    }
    
    .btn-inquiry {
        max-width: 180px;
        font-size: 0.85rem;
    }
}
}