@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Professional Tech Palette */
    --primary: #2563eb;
    /* Royal Blue */
    --primary-dark: #1e40af;
    /* Deep Blue */
    --secondary: #10b981;
    /* Emerald Green */
    --accent: #f59e0b;
    /* Amber */
    --danger: #ef4444;
    /* Red */
    --background: #f1f5f9;
    /* Light Slate Background */
    --surface: #ffffff;
    /* White Surface */
    --surface-hover: #f8fafc;
    /* Hover State */
    --text: #0f172a;
    /* Dark Slate Text */
    --text-light: #64748b;
    /* Muted Text */
    --border: #e2e8f0;
    /* Light Border */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --radius: 0.75rem;
    --skeleton: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
}

.skeleton {
    background: var(--skeleton);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite linear;
    border-radius: 8px;
    color: transparent !important;
}

.skeleton * {
    visibility: hidden;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

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

html,
body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    /* Prevent horizontal scroll */
}

/* Base Responsive Elements */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

button,
a {
    min-height: 44px;
    /* Universal touch target */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo .accent {
    color: var(--primary);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.mobile-only {
    display: none;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
}

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

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--surface);
        flex-direction: column;
        padding: 1.5rem;
        gap: 0.5rem;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 2000;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        align-items: flex-start;
        display: flex;
        transform: translateX(100%);
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(4px);
        z-index: 1999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-only {
        display: flex;
        width: 100%;
    }

    .menu-header {
        justify-content: space-between;
        align-items: center;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--border);
        margin-bottom: 1rem;
    }

    .menu-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--text-light);
        cursor: pointer;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a,
    .nav-links button {
        width: 100%;
        justify-content: flex-start;
        font-size: 1.1rem;
    }
}

.btn-primary {
    background: var(--gradient);
    color: white !important;
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.4);
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(37, 99, 235, 0.3);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Hero */
.hero {
    position: relative;
    padding: 8rem 0 6rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    overflow: hidden;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.gradient-text {
    background: var(--gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.btn-lg {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--text);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-lg:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
}

/* Products */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4rem 0 3rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        text-align: center;
    }
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Search Bar */
.search-container {
    position: relative;
    flex: 1;
    min-width: 300px;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-light);
    font-size: 1rem;
    pointer-events: none;
}

#product-search {
    width: 100%;
    padding: 0.6rem 2.5rem 0.6rem 2.5rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: var(--transition);
}

#product-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.clear-search {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search:hover {
    color: var(--danger);
    background-color: rgba(239, 68, 68, 0.05);
}

@media (max-width: 768px) {
    .search-container {
        min-width: 100%;
        order: -1;
        /* Search first on mobile */
    }
}

.filter-select {
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    transition: var(--transition);
    min-width: 200px;
}

.filter-select:hover {
    border-color: var(--primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--background);
}

.product-grid {
    display: grid;
    /* 2 columns for ALL mobile and tablet devices */
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    /* Tighter gap for mobile */
    padding-bottom: 6rem;
    width: 100%;
    /* Prevent overflow */
    box-sizing: border-box;
}

/* Desktop: 3 columns (at 992px and above) */
@media (min-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        gap: 0.5rem;
        /* Even tighter for very small screens */
    }
}

/* Homepage Grid Limits */
.home-product-grid .product-card:nth-child(n+13) {
    display: none !important;
}

@media (max-width: 991px) {
    .home-product-grid .product-card:nth-child(n+9) {
        display: none !important;
    }
}

/* Product Card */
.product-card {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
    transition: var(--transition);
    width: 100%;
    max-width: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.product-image-container {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #ffffff;
    /* Clean white background for tech products */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 640px) {
    .product-image-container {
        height: 140px;
    }
}

.product-image {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    /* Prevents cropping */
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-info {
    padding: 0.75rem;
}

@media (max-width: 480px) {
    .product-info {
        padding: 0.5rem;
    }
}

.product-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: calc(1.3 * 1.1rem * 3);
    /* Fixed height for 3 lines on desktop */
}

@media (max-width: 768px) {
    .product-title {
        font-size: 0.95rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        height: calc(1.3 * 0.95rem * 2);
        /* Fixed height for 2 lines on mobile */
    }
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-bottom: 1rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-video,
.btn-buy {
    flex: 1;
    padding: 0.7rem 0.5rem;
    font-size: 0.85rem;
    white-space: nowrap;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-video {
    background: var(--background);
    color: var(--text);
    border: 1px solid var(--border) !important;
}

.btn-video:hover {
    background: #e2e8f0;
}

.btn-buy {
    background: var(--text);
    color: white;
}

.btn-buy:hover {
    background: var(--primary);
}

@media (max-width: 768px) {
    .product-actions {
        flex-direction: column;
        gap: 0.4rem;
    }

    .btn-video,
    .btn-buy {
        width: 100%;
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
        min-height: 40px;
    }
}

/* About Section */
.about-section {
    padding: 6rem 0;
    background-color: white;
    border-top: 1px solid var(--border);
}

.about-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--text);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.7;
}

.about-features {
    list-style: none;
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.about-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text);
}

.about-features li i {
    color: var(--secondary);
    font-size: 1.25rem;
}

.about-image {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-hover);
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.about-image:hover img {
    transform: scale(1.03);
}

@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-image {
        order: -1;
    }
}

/* Footer (Updated) */
footer {
    background: #0f172a;
    /* Darker slate */
    color: white;
    padding: 5rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-brand h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: white;
}

.footer-links h4,
.footer-social h4 {
    color: var(--text-light);
    /* Actually light for dark bg context it might need adjustment but sticking to simple for now */
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    color: #94a3b8;
}

.footer-links a,
.footer-social a {
    display: block;
    color: white;
    text-decoration: none;
    margin-bottom: 0.75rem;
    opacity: 0.8;
    transition: var(--transition);
}

.footer-links a:hover,
.footer-social a:hover {
    opacity: 1;
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 2rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        padding: 6rem 1rem 4rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .hero .btn-lg {
        margin: 0.5rem 0 !important;
        display: flex;
        width: 100%;
    }

    .section-header {
        flex-direction: column;
        text-align: center;
        margin: 2rem 0;
    }

    .filter-controls {
        width: 100%;
        justify-content: center;
        gap: 0.75rem;
        padding: 0;
    }

    .search-container {
        min-width: 100%;
        order: -1;
    }

    .filter-select {
        min-width: 140px;
        flex: 1;
    }

    .fav-btn-nav {
        display: block !important;
        margin: 1rem 0;
    }
}

/* Favorites Heart Styles */
.btn-fav {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 5;
    transition: var(--transition);
    color: #94a3b8;
}

.btn-fav:hover {
    transform: scale(1.15);
    color: #ef4444;
    background: white;
}

.btn-fav.active {
    color: #ef4444;
    background: white;
    border-color: #fee2e2;
}

.modal-fav-btn {
    background: #f8fafc;
    border: 1px solid var(--border);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition);
    color: var(--text-light);
}

.modal-fav-btn.active {
    background: #fee2e2;
    border-color: #fecaca;
    color: #ef4444;
}

.modal-fav-btn:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

/* Consolidated Grid System Above */

/* Product Details View */
.product-details-view {
    padding: 2rem 0;
    max-width: 1000px;
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

/* ===== PRODUCT MODAL ===== */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.product-modal.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
}

.modal-container {
    position: relative;
    width: 95%;
    max-width: 1100px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    display: flex;
    flex-direction: column;
    animation: modalScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    color: var(--text);
    box-shadow: var(--shadow-md);
}

.modal-close-btn:hover {
    background: #f8fafc;
    transform: rotate(90deg) scale(1.1);
    color: var(--danger);
    border-color: var(--danger);
}

.product-details-content {
    padding: 3rem;
    max-width: 100%;
}

.details-content {
    display: flex;
    flex-wrap: wrap;
    gap: 4rem;
}

.details-image-col {
    flex: 1 1 400px;
    max-width: 100%;
    position: sticky;
    top: 2rem;
}

.details-info-col {
    flex: 1.2 1 400px;
    max-width: 100%;
}

.main-image-container {
    background: #f8fafc;
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
}

.detail-main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}



.detail-thumbnails {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.thumbnail:hover {
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: var(--primary);
}

.detail-category {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    display: block;
}

.details-info-col h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.detail-price {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1.5rem;
    font-family: 'Outfit', sans-serif;
}

.detail-short-desc {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.detail-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    width: 100%;
}

.detail-actions button,
.detail-actions .btn-video {
    flex: 1 1 240px;
    min-height: 56px;
    font-size: 1.05rem;
    padding: 0.75rem 1.5rem;
    white-space: normal;
    text-align: center;
}

@media (max-width: 480px) {

    .detail-actions button,
    .detail-actions .btn-video {
        flex: 1 1 100%;
    }
}

.share-section {
    margin-bottom: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.share-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.share-copy {
    background: white;
    color: var(--text);
}

.share-copy:hover {
    background: #f8fafc;
    border-color: var(--primary);
    color: var(--primary);
}

.share-fb {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

.share-fb:hover {
    background: #166fe5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

@media (max-width: 600px) {
    .share-btn {
        flex: 1;
        justify-content: center;
    }
}

.detail-specs-container h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.detail-long-desc {
    color: var(--text-light);
    line-height: 1.7;
}

.detail-features-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.detail-features-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text);
}

.detail-features-list li::before {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--secondary);
}

.detail-specs-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-specs-table tr {
    border-bottom: 1px solid #f1f5f9;
}

.detail-specs-table td {
    padding: 0.75rem 0;
    font-size: 0.95rem;
}

.detail-specs-table td:first-child {
    font-weight: 600;
    color: var(--text-light);
    width: 40%;
}


/* Inner Zoom Effect - Global Styles */
.main-image-container {
    background: #f8fafc;
    border-radius: 20px;
    padding: 0;
    border: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
    width: 100%;
}

.detail-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease-out;
    transform-origin: center center;
    will-change: transform;
}

@media (min-width: 1024px) {
    .main-image-container:hover .detail-main-image {
        transform: scale(2);
    }
}

.zoom-hint {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.3s;
}

.main-image-container:hover .zoom-hint {
    opacity: 0;
}

.zoom-text-hint {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.7);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.main-image-container:hover .zoom-text-hint {
    opacity: 0;
}

/* === STICKY & RESPONSIVE REFACTOR === */

@media (max-width: 992px) {
    .details-content {
        display: block;
        padding: 0;
    }

    .details-image-col,
    .details-info-col {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .modal-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
        overflow-x: hidden;
    }

    .product-details-content {
        padding: 5rem 1rem 3rem;
    }

    .details-content {
        gap: 1.5rem;
    }

    .details-info-col h1 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }

    .detail-price {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .detail-actions {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .detail-actions button,
    .detail-actions .btn-video {
        width: 100%;
        height: 52px;
        flex: none;
    }

    .main-image-container {
        aspect-ratio: auto;
        height: auto;
        max-height: 35vh;
        background: none;
        border: none;
        padding: 0;
    }

    .detail-main-image {
        max-height: 35vh;
        width: 100%;
        object-fit: contain;
        transform: none !important;
    }

    .zoom-hint,
    .zoom-text-hint {
        display: none !important;
    }

    .modal-close-btn {
        top: 1rem !important;
        right: 1rem !important;
        background: white !important;
        box-shadow: var(--shadow-lg) !important;
        width: 44px;
        height: 44px;
        z-index: 100;
    }
}

/* Floating Mobile Action Bar */
.mobile-action-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    padding: 1rem 1.25rem;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
    z-index: 10002;
    gap: 1rem;
    border-top: 1px solid var(--border);
    animation: slideUp 0.3s ease-out;
}

@media (max-width: 768px) {
    .mobile-action-bar {
        display: flex;
    }

    .product-details-content {
        padding-bottom: 8rem !important;
        /* Extra padding so bottom content isn't hidden */
    }

    .detail-actions button,
    .detail-actions .btn-video {
        width: 100%;
        height: 52px;
        flex: none;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Scroll Lock */
body.modal-open {
    overflow: hidden;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: white;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    margin-bottom: 2rem;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-back:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateX(-4px);
    box-shadow: var(--shadow-md);
}

/* Product Tags */
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background: #e2e8f0;
    color: var(--text-light);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
}

.detail-model-tag {
    background: #f1f5f9;
    color: var(--text-light);
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    display: inline-block;
    border: 1px solid var(--border);
}

/* Related Products Grid */
.related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.related-item {
    cursor: pointer;
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.75rem;
    text-align: center;
    transition: var(--transition);
    border: 1px solid transparent;
}

.related-item:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
}

.related-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    mix-blend-mode: multiply;
}

.related-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.2em;
}

.related-info span {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}

/* User Profile & Auth */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

.logout-sm {
    background: white;
    border: 1px solid #fee2e2;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--danger);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.logout-sm:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-outline {
    background: white;
    border: 2px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Cart Toggle & Badge */
.nav-icon-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text);
    cursor: pointer;
    position: relative;
    padding: 0.5rem;
}

.nav-icon-btn.active {
    color: #ef4444;
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Cart Drawer */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.cart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
}

.cart-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: white;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .cart-content {
        max-width: 100%;
    }
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Cart main view: flex column so items scroll and footer stays pinned */
#cart-main-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.cart-items-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    min-height: 0;
    /* Critical: allows flex child to shrink and scroll */
}

.cart-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.cart-item-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    background: #f8fafc;
    border-radius: 8px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text);
}

.qty-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    flex-shrink: 0;
    /* Prevent footer from being squeezed out */
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.btn-checkout {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-checkout:hover {
    background: var(--primary-dark);
}

.cart-note {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 1rem;
}

/* Modal Actions Utility */
.btn-cart {
    flex: 1;
    background: var(--background);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-cart:hover {
    background: #e2e8f0;
}

/* Invoice Modal Styles */
.invoice-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.invoice-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.invoice-container {
    position: relative;
    width: 95%;
    max-width: 640px;
    background: white;
    border-radius: 16px;
    padding: 0;
    /* Padding removed - handled by children */
    max-height: 92vh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Clip content, let children scroll */
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.invoice-paper {
    padding: 1.5rem 1.75rem 1.5rem;
    border: none;
    background: white;
    overflow-y: auto;
    /* Scroll when many items */
    flex: 1;
    /* Fill remaining space */
    min-height: 0;
    /* Allow shrinking for scroll to work */
    font-family: 'Inter', sans-serif;
    -webkit-overflow-scrolling: touch;
    /* Smooth mobile scroll */
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 1rem;
}

.invoice-meta {
    text-align: right;
}

.invoice-user {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    table-layout: fixed;
    /* Prevent table from overflowing */
}

.invoice-table th {
    text-align: left;
    background: #f1f5f9;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.invoice-table th:first-child {
    width: 45%;
}

.invoice-table th:nth-child(2) {
    width: 10%;
    text-align: center;
}

.invoice-table th:nth-child(3) {
    width: 20%;
    text-align: right;
}

.invoice-table th:nth-child(4) {
    width: 25%;
    text-align: right;
}

.invoice-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f0f4f8;
    font-size: 0.9rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.invoice-table td:nth-child(2) {
    text-align: center;
}

.invoice-table td:nth-child(3) {
    text-align: right;
    white-space: nowrap;
}

.invoice-table td:nth-child(4) {
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
}

.invoice-summary {
    margin-left: auto;
    min-width: 200px;
    max-width: 260px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

.summary-line.total {
    border-top: 2px solid var(--primary);
    font-weight: 800;
    font-size: 1.05rem;
    margin-top: 0.5rem;
    padding-top: 0.6rem;
    color: var(--primary);
}

.invoice-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
}

.invoice-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-top: 2px solid var(--border);
    flex-shrink: 0;
    /* Always pinned at the bottom - never pushed off screen */
    z-index: 10;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    justify-content: stretch;
    flex-wrap: wrap;
}

.invoice-actions button {
    flex: 1;
    min-width: 100px;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* WhatsApp button special styling */
#send-whatsapp-invoice {
    background: #25D366;
    color: white;
    border: none;
    flex: 2;
    /* Make WhatsApp button wider */
}

#send-whatsapp-invoice:hover {
    background: #1ebe5d;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

@media (max-width: 600px) {
    .invoice-actions {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .invoice-actions button {
        flex: 1 1 calc(50% - 0.25rem);
        font-size: 0.8rem;
        padding: 0.6rem 0.5rem;
        min-width: 0;
    }

    #send-whatsapp-invoice {
        flex: 1 1 100%;
        /* Full width on mobile */
        order: -1;
        /* Show WhatsApp button first on mobile */
    }
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: 8px;
}

.btn-text:hover {
    color: var(--text);
    background: #f1f5f9;
}

.btn-cart-sm {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-cart-sm:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* === Checkout & A4 Print Styling === */
.checkout-step {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    /* Allows checkout form to scroll properly */
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.checkout-step .form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.checkout-step label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
}

.checkout-step input,
.checkout-step select,
.checkout-step textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
}

/* A4 Print Optimization */
@media print {
    body * {
        visibility: hidden;
    }

    #invoice-modal,
    #invoice-modal * {
        visibility: visible;
    }

    #invoice-modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 210mm;
        /* A4 Width */
        height: 297mm;
        /* A4 Height */
        background: white;
        padding: 0;
        margin: 0;
        display: block !important;
    }

    .invoice-container {
        box-shadow: none;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
        background: white;
    }

    .invoice-paper {
        padding: 15mm !important;
        border: none !important;
        width: 210mm;
        height: 297mm;
        box-sizing: border-box;
    }

    .invoice-actions,
    .invoice-overlay {
        display: none !important;
    }
}

.bill-to p {
    margin: 0.1rem 0;
    font-size: 0.95rem;
}


.modal-quantity-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.qty-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

#modal-qty-value {
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}