:root {
    --primary-color: #007bff;
    /* Lab Blue */
    --secondary-color: #0056b3;
    /* Darker Blue */
    --accent-color: #00d4ff;
    /* Cyan accent */
    --bg-color: #f8f9fa;
    /* Light Gray Background */
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --nav-height: 70px;
    --transition-speed: 0.3s;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header & Nav */
header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    height: var(--nav-height);
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -1px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color var(--transition-speed);
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Language Switcher */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 20px;
}

.lang-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-light);
    transition: color 0.2s;
    padding: 2px 5px;
}

.lang-btn:hover,
.lang-btn.active {
    color: var(--primary-color);
}

.divider {
    color: #ccc;
    font-size: 0.9rem;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: all var(--transition-speed);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.55)), url('../img/hatter.webp') center/cover no-repeat;
    padding-top: var(--nav-height);
    position: relative;
}

.hero-content {
    max-width: 800px;
    padding: 20px;
    animation: fadeIn 1s ease-out;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    font-weight: 500;
}

.cta-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.6);
    background-color: var(--secondary-color);
}

/* Sections General */
section {
    padding: 80px 20px;
}

h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: var(--text-color);
}

/* Products Grid */
.catalog-container {
    text-align: center;
    margin-bottom: 40px;
}

.catalog-container p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.catalog-download-btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.catalog-download-btn:hover {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    width: 100%;
    height: 250px;
    /* Force height so placeholders look good */
    object-fit: cover;
    background-color: #eaeaea;
}

.product-info {
    padding: 25px;
}

.product-info h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.product-info p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Certifications */
.cert-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.cert-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    flex: 1 1 300px;
    max-width: 400px;
    transition: transform var(--transition-speed);
}

.cert-card:hover {
    transform: scale(1.02);
}

.cert-icon {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 15px;
    display: inline-block;
    /* Removed circle styles */
}

.cert-card {
    cursor: pointer;
    /* Indicate clickable */
}

/* Image Viewer Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2001;
    /* Higher than product modal */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    /* Flex to center */
    align-items: center;
    justify-content: center;
    pointer-events: none;
    /* Ignore clicks when hidden */
}

.image-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.image-modal-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.image-modal.show .image-modal-content {
    transform: scale(1);
}

.close-image-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 2002;
}

.close-image-modal:hover,
.close-image-modal:focus {
    color: var(--primary-color);
}

/* Contact */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
}

.info-item h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.info-item p {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 50px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Hide by default on mobile */
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background-color: white;
        padding: 20px;
        box-shadow: var(--shadow);
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: flex;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    position: relative;
    transform: translateY(50px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.show .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    position: absolute;
    top: 20px;
    right: 25px;
    z-index: 10;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary-color);
}

.modal-body {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.modal-image-gallery {
    flex: 1 1 350px;
}

.modal-main-img {
    width: 100%;
    height: 400px;
    /* Increased height for better visibility */
    object-fit: contain;
    /* Show full image without cropping */
    border-radius: 10px;
    margin-bottom: 15px;
    background-color: #ffffff;
    /* White bg for transparent/partial images */
    border: 1px solid #eee;
}

.modal-thumbnails {
    display: flex;
    gap: 10px;
}

.modal-thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s;
    border: 1px solid #ddd;
    background-color: #fff;
}

.modal-thumbnails img:hover,
.modal-thumbnails img.active {
    opacity: 1;
    border-color: var(--primary-color);
}

.modal-details {
    flex: 1 1 350px;
}

.modal-details h2 {
    text-align: left;
    margin-bottom: 20px;
    color: var(--secondary-color);
    word-wrap: break-word;
}

#modalDescription {
    word-wrap: break-word;
    max-width: 100%;
}

.modal-dynamic-content {
    margin-top: 25px;
}

.modal-section {
    margin-bottom: 25px;
}

.modal-section h3 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 10px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    display: inline-block;
}

.modal-text {
    font-size: 0.95rem;
    color: var(--text-light);
    white-space: pre-line;
    /* Handle newlines in text */
    line-height: 1.6;
    word-wrap: break-word;
    max-width: 100%;
}

.table-container {
    overflow-x: auto;
    margin-top: 10px;
}

.variants-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
    /* Ensure table doesn't get too squashed */
    font-size: 0.9rem;
}

.variants-table th,
.variants-table td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.variants-table th {
    background-color: #f9f9f9;
    color: var(--text-light);
    font-weight: 600;
}

.variants-table tr:hover {
    background-color: #f8f9fa;
}

/* Mobile responsive modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 15% auto;
        padding: 20px;
        width: 95%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .modal-body {
        flex-direction: column;
        gap: 20px;
        max-width: 100%;
    }

    .modal-details, .modal-image-gallery {
        max-width: 100%;
        width: 100%;
    }

    .table-container {
        max-width: 100%;
        width: 100%;
    }

    .modal-main-img {
        height: 250px;
    }
}