/* ================ BASE STYLES ================ */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #f5f5f0;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-text: #777;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --max-width: 1440px; /* Increased from 1200px */
    --container-padding: 2rem;
    --header-height: 80px;
    --mobile-breakpoint: 768px;
    --tablet-breakpoint: 992px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;

}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--secondary-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover; /* Better image handling */
}

button, input, textarea {
    font-family: inherit;
    font-size: inherit;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Fluid typography */
@media screen and (min-width: 768px) {
    html {
        font-size: calc(16px + (18 - 16) * ((100vw - 768px) / (1440 - 768)));
    }
}

@media screen and (min-width: 1440px) {
    html {
        font-size: 18px;
    }
}

/* ================ HEADER STYLES ================ */
.main-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transition: var(--transition);
    height: var(--header-height);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--container-padding);
    height: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 180px; /* Prevent logo from shrinking too much */
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    font-weight: 700;
    border-radius: 50%;
    font-family: 'Inter', sans-serif;
    flex-shrink: 0;
}

.logo-text {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.25rem;
    white-space: nowrap;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-link {
    position: relative;
    font-weight: 500;
    color: var(--text-color);
    padding: 0.5rem 0;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 220px;
    background-color: white;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
    padding: 0.5rem 0;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    transition: var(--transition);
    font-size: 0.95rem;
}

.dropdown-link:hover {
    background-color: var(--secondary-color);
    color: var(--accent-color);
    padding-left: 1.75rem;
}

.dropdown-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Header Contact */
.header-contact {
    display: flex;
    flex-direction: column;
    margin-left: 2rem;
    min-width: 160px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--light-text);
    transition: var(--transition);
    white-space: nowrap;
}

.contact-link:hover {
    color: var(--accent-color);
}

.contact-icon {
    fill: currentColor;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 2rem;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.action-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.action-button svg {
    width: 20px;
    height: 20px;
    fill: var(--text-color);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-color);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    margin-left: 1rem;
}

.menu-bar {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--primary-color);
    margin: 5px 0;
    transition: var(--transition);
    transform-origin: center;
}

/* ================ MAIN CONTENT ================ */
.main-content {
    padding-top: calc(var(--header-height) + 1rem);
    background-color: var(--secondary-color);
    min-height: calc(100vh - var(--header-height) - 200px); /* Footer height approximation */
}

.products-section {
    padding: 3rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 0 var(--container-padding);
}

.section-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem); /* Fluid typography */
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--light-text);
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    max-width: 700px;
    margin: 0 auto;
}

/* Mouse Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 2rem;
    padding: 0 var(--container-padding);
    max-width: var(--max-width);
    margin: 0 auto;
}

.mouse-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.mouse-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Mouse image container with responsive heights */
.mouse-image-container {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    width: 100%;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    border-bottom: 1px solid #eaeaea;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.mouse-image {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover; /* ensures fills entire curved container */
    transition: transform 0.5s ease;
    border-radius: var(--border-radius) var(--border-radius) 0 0; /* matches container */
}

.mouse-image.active {
    display: block;
}

.mouse-card:hover .mouse-image {
    transform: scale(1.05);
}


.mouse-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 2;
}

.mouse-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.mouse-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1.3;
}

.mouse-specs {
    color: var(--light-text);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.6;
    flex-grow: 1;
}

.mouse-features {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.mouse-feature {
    background-color: var(--secondary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-color);
    white-space: nowrap;
}

.mouse-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 0.5rem;
}

.add-to-cart {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-to-cart:hover {
    background: #1a2a3a;
    transform: translateY(-2px);
}

.add-to-cart svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ================ FOOTER ================ */
.main-footer {
    background-color: var(--primary-color);
    color: white;
    padding: 4rem 0 0;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    padding: 0 var(--container-padding) 3rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: block;
}

.footer-tagline {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-heading {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--accent-color);
}

.footer-nav {
    list-style: none;
}

.footer-link {
    display: block;
    padding: 0.5rem 0;
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
    font-size: 0.95rem;
}

.footer-link:hover {
    color: white;
    transform: translateX(5px);
}

.footer-contact address p {
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: normal;
    font-size: 0.95rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem var(--container-padding);
    text-align: center;
}

.copyright {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
}

.social-icon {
    fill: white;
    width: 18px;
    height: 18px;
}

/* ================ RESPONSIVE STYLES ================ */
@media (max-width: 1200px) {
    :root {
        --container-padding: 1.5rem;
    }
    
    .header-contact {
        margin-left: 1rem;
        min-width: auto;
    }
    
    .header-actions {
        margin-left: 1rem;
    }
}

@media (max-width: 992px) {
    .header-contact {
        display: none;
    }
    
    .nav-list {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    :root {
        --container-padding: 1rem;
    }
    
    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: white;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        padding: 1.5rem var(--container-padding);
        transform: translateY(-150%);
        opacity: 0;
        transition: var(--transition);
        overflow-y: auto;
    }
    
    .main-nav.active {
        transform: translateY(0);
        opacity: 1;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 1rem;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding-left: 1rem;
        margin-top: 0.5rem;
        display: none;
        background-color: var(--secondary-color);
        border-radius: var(--border-radius);
        margin-bottom: 0.5rem;
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-menu-toggle.active .menu-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    
    .mobile-menu-toggle.active .menu-bar:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active .menu-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    
    .header-actions {
        margin-left: auto;
    }
    
    .main-content {
        padding-top: var(--header-height);
    }
}

@media (max-width: 576px) {
    :root {
        --container-padding: 0.75rem;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-brand {
        max-width: 100%;
    }
}

/* ================ PRODUCT FILTERS & SEARCH ================ */
.product-filters {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 3rem;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    width: calc(100% - 2 * var(--container-padding));
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-option {
    display: flex;
    align-items: center;
    position: relative;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.filter-option label {
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.6rem 1.2rem;
    background: #f8f8f8;
    border-radius: 30px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid #eaeaea;
}

.filter-option input:checked + label {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.15);
}

.filter-option label:hover {
    background: #f0f0f0;
}

.product-search {
    margin-bottom: 2.5rem;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    width: calc(100% - 2 * var(--container-padding));
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3rem;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    background: white url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23777" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>') no-repeat 20px center;
    background-size: 18px;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.2);
}

/* ================ IMAGE SLIDER ================ */
.image-slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 2;
}

.image-slider-controls button {
    background: rgba(255, 255, 255, 0.7);
    color: var(--primary-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    font-weight: bold;
    font-size: 1rem;
}

.image-slider-controls button:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.image-slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.image-slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-slider-dot.active {
    background: white;
    transform: scale(1.2);
}

/* ================ FULLSCREEN IMAGE VIEWER ================ */
.fullscreen-image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.fullscreen-image-viewer.active {
    opacity: 1;
    pointer-events: all;
}

.fullscreen-image-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    animation: fadeIn 0.3s ease;
}

.close-fullscreen {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.close-fullscreen svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.close-fullscreen:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 2;
}

.fullscreen-nav button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fullscreen-nav button svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.fullscreen-nav button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.fullscreen-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ================ UTILITY CLASSES ================ */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ================ LOADING STATES ================ */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ================ TOAST NOTIFICATIONS ================ */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    max-width: 350px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

.toast.warning {
    background: #ffc107;
    color: var(--text-color);
}

/* ================ PAGINATION ================ */
.pagination {
    display: flex;
    justify-content: center;
    margin: 3rem 0;
    gap: 0.5rem;
}

.pagination-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e0e0e0;
    color: var(--text-color);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.pagination-button:hover {
    background: var(--secondary-color);
    border-color: var(--primary-color);
}

.pagination-button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-button.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ================ RESPONSIVE TABLES ================ */
.responsive-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.responsive-table th,
.responsive-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.responsive-table th {
    background: var(--secondary-color);
    font-weight: 600;
}

@media (max-width: 768px) {
    .responsive-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

a, button, input, textarea, select, .nav-link, .dropdown-toggle {
  -webkit-tap-highlight-color: transparent;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); /* fallback for older WebKit */
  background-color: transparent; /* ensure no default gray highlight from OS */
  outline: none;
}
