/* ==========================================
   PRODUCTS SECTION STYLES - REVISED
   Add this to your style.css file
   ========================================== */

/* Product Tabs */
.product-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.product-tab {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
}

.product-tab:hover {
    border-color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-tab.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: white;
}

.product-tab svg {
    flex-shrink: 0;
}

/* Type Panels */
.product-type-panels {
    position: relative;
}

.product-type-panel {
    display: none;
    animation: fadeIn 0.4s ease;
}

.product-type-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Subtype Grid */
.subtype-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.subtype-card {
    background: #d7d7d7;
    border: 2px solid #ccc;
    border-radius: 16px;
    padding: 1rem 1rem;
    max-width: 400px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.subtype-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #1a1a1a, #444);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.subtype-card:hover {
    background: #b7b7b7;
    border-color: #1a1a1a;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.subtype-card:hover::before,
.subtype-card.active::before {
    transform: scaleX(1);
}

.subtype-card.active {
    border-color: #1a1a1a;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.subtype-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.subtype-card:hover .subtype-icon {
    background: #1a1a1a;
}

.subtype-card:hover .subtype-icon svg {
    stroke: white;
}

.subtype-card h4 {
    font-family: 'Open Runde', 'Montserrat', sans-serif;
    font-size: 1rem;
    color: #333333;
    margin-bottom: 0.25rem;
}

.subtype-card p {
    font-size: 1rem;

}

.subtype-desc {
    color: #444444;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.product-count {
    font-size: 0.8rem;
    color: #777777;
    font-weight: 500;
}

/* Products Container */
.products-container {
    display: none;
    animation: slideUp 0.4s ease;
}

.products-container.visible {
    display: block;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* FIXED: Products Header - Title on LEFT, Button on RIGHT */
.products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row-reverse;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.back-to-subtypes {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.back-to-subtypes:hover {
    background: #1a1a1a;
    color: white;
}

.current-subtype-title {
    font-family: 'Open Runde', 'Montserrat', sans-serif;
    font-size: 1.5rem;
    color: #1a1a1a;
    margin: 0;
}

/* Products Grid */
.products-grid {
    display: none; /* Hidden by default, shown via JS */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    padding: 1rem;
    
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.product-image {
    position: relative;
    height: 300px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.product-image img {
    width: 100%;
    border-radius: 1rem;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}


.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 1rem 0.75rem;
    background: #1a1a1a;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-badge.featured {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-info h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    color: #1a1a1a;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    text-align: center;
    text-transform: uppercase;
}

.product-info p {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    text-align: left;
}

.product-actions {
    display: flex;
    gap: 0.75rem;

    margin-top: auto;
    margin-bottom: 0px;
}

.btn-details {
    flex: 1;
    padding: 0.75rem 1rem;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-details:hover {
    background: #333;
    transform: translateY(-2px);
}

.btn-inquiry {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-inquiry:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.btn-inquiry:hover svg {
    stroke: white;
}

/* ==========================================
   PRODUCT MODAL STYLES
   ========================================== */

.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 2rem;
}

.product-modal.active {
    opacity: 1;
    visibility: visible;
}

.product-modal .modal-content {
    background: white;
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.3s ease;
}

.product-modal.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #1a1a1a;
    color: white;
    transform: rotate(90deg);
}

.modal-image {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit:fill;
}

.modal-details {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
}

.modal-details h2 {
    font-family: 'Open Runde', 'Montserrat', sans-serif;
    font-size: 1.75rem;
    color: #1a1a1a;
    margin-bottom: 1rem;
    text-align: left;
}

.modal-details > p {
    font-size: 1rem;
    color: #666;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    text-align: left;
}

.modal-specs {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.modal-specs h4 {
    font-size: 1rem;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.modal-specs ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-specs li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #555;
    font-size: 0.9rem;
}

.modal-specs li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #1a1a1a;
    font-weight: bold;
}

.btn-inquiry-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: auto;
}

.btn-inquiry-large:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* ==========================================
   RESPONSIVE STYLES
   ========================================== */

@media (max-width: 1024px) {
    .product-tabs {
        gap: 0.75rem;
    }
    
    .product-tab {
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
    }
    
    .product-tab svg {
        width: 20px;
        height: 20px;
    }
    
    .subtype-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .product-tabs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .product-tab {
        justify-content: center;
        padding: 1rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .subtype-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .subtype-card {
        padding: 1.5rem 1rem;
    }
    
    .subtype-icon {
        width: 50px;
        height: 50px;
    }
    
    .subtype-card h4 {
        font-size: 0.95rem;
    }
    
    .subtype-desc {
        font-size: 0.8rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    /* Mobile: Stack title on top, button below */
    .products-header {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    
    .back-to-subtypes {
        justify-content: center;
    }
    
    .current-subtype-title {
        text-align: center;
    }
    
    .product-modal .modal-content {
        grid-template-columns: 1fr;
        max-height: 95vh;
    }
    
    .modal-image {
        min-height: 250px;
    }
    
    .modal-details {
        padding: 1.5rem;
    }
    
    .modal-details h2 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .product-tab span {
        font-size: 0.75rem;
    }
    
    .subtype-grid {
        grid-template-columns: 1fr;
    }
    
    .product-info h4 {
        font-size: 1rem;
    }
    
    .product-info p {
        font-size: 0.85rem;
    }
    
    .current-subtype-title {
        font-size: 1.2rem;
    }
}