* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: transparent;
    min-height: 100vh;
    color: rgb(45, 45, 45);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: rgb(255, 255, 255);
    background-color: rgb(1, 109, 182);
    padding: 20px 0;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
}

.search-input {
    padding: 12px 20px;
    font-size: 16px;
    border: 1px solid rgb(1, 109, 182);
    border-radius: 5px;
    width: 300px;
    box-shadow: none;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: rgb(235, 110, 31);
    box-shadow: 0 0 5px rgba(235, 110, 31, 0.5);
    transform: none;
}

.clear-btn {
    padding: 12px 20px;
    background: rgb(1, 109, 182);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: rgb(235, 110, 31);
    transform: none;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.category-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgb(1, 109, 182);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.category-card.heating::before {
    background: rgb(235, 110, 31);
}

.category-card.ventilation::before {
    background: rgb(0, 102, 78);
}

.category-card.refrigeration::before {
    background: rgb(192, 32, 38);
}

.category-card.control::before {
    background: rgb(33, 46, 132);
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}



.category-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: rgb(45, 45, 45);
}

.category-description {
    color: rgb(102, 102, 102);
    margin-bottom: 20px;
    line-height: 1.6;
}

.subcategories {
    display: none;
    margin-top: 20px;
}

.subcategories.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subcategory {
    margin-bottom: 15px;
    padding: 15px;
    background: #ffffff;
    border-radius: 8px;
    border-left: 4px solid rgb(1, 109, 182);
}

.subcategory-header {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.subcategory-name {
    flex-grow: 1;
}


.product-count {
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.products-list {
    display: none;
    margin-top: 10px;
}

.products-list.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.product-item {
    padding: 12px;
    margin: 8px 0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.product-item:hover {
    background: #e3f2fd;
    border-left-color: #2196f3;
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.product-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.product-desc {
    color: #7f8c8d;
    font-size: 0.85rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-header-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.expand-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #3498db;
    transition: transform 0.3s ease;
}

.expand-btn.rotated {
    transform: rotate(180deg);
}

.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0; 
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex; /* Show when active */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: absolute; /* Changed to absolute */
    top: 50%; /* Center vertically */
    left: 50%; /* Center horizontally */
    transform: translate(-50%, -50%); /* Adjust for element's own size */
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .search-input {
        width: 250px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .category-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .search-container {
        flex-direction: column;
        align-items: center;
    }
    
    .search-input {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 1rem;
    }
}



.broadest-portfolio-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgb(235, 110, 31); /* A contrasting color from Amphenol's palette */
    margin-top: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}


/* Contact Button */
.contact-btn {
    background: rgb(1, 109, 182);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-left: 10px;
    transition: background-color 0.3s ease;
}

.contact-btn:hover {
    background: rgb(0, 89, 152);
}

/* Contact Modal Styles */
.contact-modal-content {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
}

.contact-modal-content h2 {
    color: rgb(1, 109, 182);
    margin-bottom: 20px;
    text-align: center;
}

.contact-modal-content iframe {
    border: none;
    width: 100%;
    min-height: 600px;
}

/* Responsive adjustments for contact modal */
@media (max-width: 768px) {
    .contact-modal-content {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .search-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .contact-btn {
        margin-left: 0;
        width: 100%;
    }
}



/* Product Dropdown Styles */
.product-dropdown {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-dropdown.active {
    max-height: 1000px; /* Increased for longer content */
    opacity: 1;
    overflow: visible; /* Allow content to be fully visible */
}

.product-dropdown.closing {
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.4s ease, opacity 0.4s ease;
}

.product-dropdown-content {
    padding: 15px;
}

.product-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    border-bottom: 2px solid rgb(1, 109, 182);
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.product-dropdown-header h3 {
    color: rgb(1, 109, 182);
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    flex: 1;
    min-width: 0; /* Allow text to wrap */
    word-wrap: break-word;
    line-height: 1.3;
}

.dropdown-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.dropdown-close-btn:hover {
    background-color: #e9ecef;
    color: #333;
}

.product-dropdown-body {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.product-dropdown-image {
    flex: 0 0 180px;
    max-width: 180px;
}

.product-dropdown-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 100%;
}

.product-dropdown-info {
    flex: 1;
    min-width: 250px; /* Ensure minimum width for text */
    word-wrap: break-word;
}

.product-dropdown-info p {
    margin: 0 0 15px 0;
    line-height: 1.6;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-dropdown-link {
    margin-top: 15px;
}

.product-link-btn {
    display: inline-block;
    background: rgb(1, 109, 182);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    word-wrap: break-word;
}

.product-link-btn:hover {
    background: rgb(0, 89, 152);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Mobile responsive for dropdown */
@media (max-width: 768px) {
    .product-dropdown-content {
        padding: 12px;
    }
    
    .product-dropdown-body {
        flex-direction: column;
        gap: 12px;
    }
    
    .product-dropdown-image {
        flex: none;
        align-self: center;
        max-width: 200px;
    }
    
    .product-dropdown-info {
        min-width: auto;
        width: 100%;
    }
    
    .product-dropdown-header h3 {
        font-size: 1.1rem;
        line-height: 1.4;
    }
    
    .product-dropdown.active {
        max-height: 1500px; /* More space for mobile stacked layout */
    }
}

@media (max-width: 480px) {
    .product-dropdown-content {
        padding: 10px;
    }
    
    .product-dropdown-header h3 {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .product-dropdown-image {
        max-width: 150px;
    }
    
    .product-link-btn {
        padding: 8px 16px;
        font-size: 13px;
        width: 100%;
        text-align: center;
    }
    
    .product-dropdown.active {
        max-height: 2000px; /* Even more space for very small screens */
    }
}

/* Animation for smooth dropdown */
.product-dropdown {
    transform: translateY(-5px);
    transition: max-height 0.4s ease, opacity 0.4s ease, transform 0.4s ease;
}

.product-dropdown.active {
    transform: translateY(0);
}


/* Make dropdown content appear clickable */
.product-dropdown-content {
    cursor: pointer;
    user-select: none; /* Prevent text selection when clicking to close */
}

.product-dropdown-content:hover {
    background: #f0f1f2;
}

/* Keep normal cursor for text areas */
.product-dropdown-info p {
    cursor: text;
    user-select: text;
}

/* Keep normal cursor and prevent closing for the product link */
.product-link-btn {
    cursor: pointer;
    user-select: none;
}

/* Visual feedback for clickable areas */
.product-dropdown-header {
    cursor: pointer;
}

.product-dropdown-header:hover {
    background: rgba(1, 109, 182, 0.05);
    border-radius: 4px;
    margin: -5px;
    padding: 5px 5px 15px 5px;
}

