:root {
    --primary-color: #000;
    --secondary-color: #f3f4f6;
    --accent-color: #fbbf24;
    --text-color: #111827;
    --text-light: #6b7280;
    --white: #ffffff;
    --container-width: 1280px;
    --font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--white);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e5e7eb;
}

.header-inner {
    min-height: 4rem;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: #6b7280;
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-links {
    display: none;
    gap: 1.5rem;
    font-weight: 500;
    color: #4b5563;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        row-gap: 0.5rem;
        justify-content: center;
        max-width: 60%;
    }
}

/* Default reset */
.nav-links>a,
.nav-item>a {
    color: #4b5563;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    text-decoration: none;
}

/* Hover Effect */
.nav-links>a:hover,
.nav-item>a:hover {
    color: var(--primary-color);
    background-color: #f3f4f6;
    /* light gray bg */
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

/* Dropdown Styles */
.nav-item {
    position: relative;
    padding: 1rem 0;
}

.nav-item>a {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    min-width: 200px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 50;
    border: 1px solid #f3f4f6;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    padding: 0.5rem;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: var(--secondary-color);
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 0.625rem;
    font-weight: 700;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero {
    position: relative;
    height: 600px;
    background-color: #f9fafb;
    overflow: hidden;
}

.hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.5), transparent);
}

.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--white);
}

.hero-subtitle {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 4.5rem;
    }
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background-color: var(--white);
    color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #f3f4f6;
}

.btn-outline {
    border: 2px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Products Section */
.section {
    padding: 5rem 0;
}

.section-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 3rem;
    text-align: center;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {

    /* Products */
    .products-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 2rem;
    }

    /* Home Grid specific - slightly smaller cards to fit 4 with sidebar */
    .home-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }
}

/* Product Card */
.product-card {
    position: relative;
    display: block;
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-image-container {
    position: relative;
    aspect-ratio: 1;
    background-color: var(--secondary-color);
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.product-card:hover .product-image-container img {
    transform: scale(1.05);
}

/* Sidebar Styles (Reused from Shop Page logic, ensuring global visibility) */
.shop-sidebar {
    background: #fff;
    /* Optional: padding if needed, but structure handles it */
}

@media (max-width: 1024px) {

    #home-sidebar,
    #shop-sidebar {
        display: none !important;
    }
}

.product-actions {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateY(0);
}

.action-btn {
    background-color: var(--white);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.action-btn:hover {
    transform: scale(1.05);
}

.action-btn.primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.action-btn.primary:hover {
    background-color: #333;
}

.product-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    transition: color 0.2s;
}

.product-card:hover .product-title {
    color: var(--text-light);
}

.product-price {
    color: var(--text-light);
    font-weight: 500;
}

/* Drawer */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    background-color: var(--white);
    z-index: 101;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.drawer.open {
    transform: translateX(0);
}

.drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 1.5rem;
}

.cart-item img {
    width: 5rem;
    height: 5rem;
    border-radius: 0.5rem;
    object-fit: cover;
    background-color: var(--secondary-color);
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    font-size: 0.875rem;
    color: var(--text-light);
}

.cart-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.qty-btn {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.drawer-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 9999px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
}

.checkout-btn:hover {
    opacity: 0.9;
}

/* Footer */
footer {
    background-color: var(--white);
    padding: 4rem 0;
    border-top: 1px solid #f3f4f6;
}

/* Checkout Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--white);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 1.5rem;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal-header {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-content {
    padding: 1.5rem;
}

/* Warning Modal */
.warning-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.warning-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.warning-modal {
    background-color: var(--white);
    width: 300px;
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.2s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.warning-modal-overlay.open .warning-modal {
    transform: scale(1);
}

.warning-btn {
    background-color: #000;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    border: none;
    font-weight: 600;
    margin-top: 1rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav-links {
        display: none !important;
    }

    .mobile-menu-btn {
        display: flex !important;
    }

    /* Mobile Product Card Optimizations */
    .product-title {
        font-size: 0.875rem;
        line-height: 1.2;
    }

    .product-price {
        font-size: 0.75rem;
    }

    .product-actions {
        bottom: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
        gap: 0.25rem;
    }

    .action-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.625rem;
        font-weight: 600;
    }

    .product-image-container {
        margin-bottom: 0.5rem;
        border-radius: 0.75rem;
    }

    /* Reduce section padding on mobile */
    .section {
        padding: 2.5rem 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-header {
        margin-bottom: 1.5rem;
    }
}

@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none !important;
    }
}

/* Product Details Page Layout */
.product-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile: 1 column (Image on top) */
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .product-details-grid {
        grid-template-columns: 1fr 1fr;
        /* Desktop: 2 columns */
        gap: 3rem;
    }
}

/* Ensure padding on mobile */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Sticky Bottom Nav Styles */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #ffffff;
        /* border-top: 1px solid #e5e7eb; */
        display: flex !important;
        /* Force show on mobile */
        justify-content: space-around;
        align-items: center;
        padding: 0.35rem 0.5rem;
        z-index: 9999;
        box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.1rem;
        text-decoration: none;
        color: #6b7280;
        font-size: 0.65rem;
        font-weight: 500;
        width: 100%;
    }

    .mobile-nav-item svg {
        width: 18px;
        height: 18px;
    }

    .mobile-nav-item.active {
        color: var(--primary-color);
    }

    /* Add padding to body so content isn't hidden behind nav */
    body {
        padding-bottom: 4rem;
    }
}

/* Base style: Hidden on desktop */
.mobile-bottom-nav {
    display: none;
}

/* --- Product Page Optimizations --- */

/* Back to Shop Wrapper */
.back-to-shop-wrapper {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-product-title {
    display: none;
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.product-main {
    padding-top: 2rem;
}

/* Product Media - Desktop Defaults */
.product-media-item {
    border-radius: 1.5rem;
    height: auto;
    object-fit: contain;
}

.product-media-item.image {
    width: 60%;
}

.product-media-item.video {
    width: 100%;
}

@media (max-width: 768px) {

    /* Reduce Back to Shop Spacing */
    .back-to-shop-wrapper {
        margin-bottom: 0;
    }

    .product-main {
        padding-top: 0.5rem;
    }

    /* Override section padding on mobile for product page if needed */
    .product-main.section {
        padding-top: 1rem;
        padding-bottom: 2rem;
    }

    /* Hide Category Label */
    .product-category-label {
        display: none !important;
    }

    /* Reduce Media Size on Mobile */
    .product-media-item.image,
    .product-media-item.video {
        width: 100%;
        max-height: 200px;
        object-fit: contain;
    }

    /* Hide Thumbnail Selector on Mobile */
    .gallery-thumbs {
        display: none !important;
    }
}

/* Product Details Typography & Layout Classes */
.product-details-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0 1rem;
    line-height: 1.2;
}

.product-details-price-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.product-details-price {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.buy-now-badge {
    background: #333e57ff;
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: background-color 0.2s;
}

.buy-now-badge:hover {
    background: #1f2937;
}

.product-description-container {
    margin-bottom: 2rem;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem 0;
}

/* Mobile Adjustments for Product Details */
/* Mobile Adjustments for Product Details */
@media (max-width: 768px) {
    .mobile-product-title {
        display: block;
        /* Ensure it looks like a title but fits */
        font-size: 1.25rem;
        font-weight: 700;
        margin: 0;
        line-height: 1.2;
    }

    .product-details-title {
        display: none;
    }

    /* Make sure back button wrapper aligns items */
    .back-to-shop-wrapper {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 0.5rem;
        /* Ensure some space below */
    }

    .product-details-price-row {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .product-details-price {
        font-size: 1.125rem;
    }

    .buy-now-badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.75rem;
    }

    .product-description-container {
        margin-bottom: 1rem;
        padding: 0.75rem 0;
    }

    /* Reorder Product Info on Mobile */
    .product-info-column {
        display: flex;
        flex-direction: column;
    }

    .product-details-price-row {
        order: 1;
    }

    .size-selector-container {
        order: 2;
    }

    .main-buy-now-btn {
        order: 3;
    }

    .contact-buttons-container {
        order: 4;
        margin-bottom: 1.5rem;
        /* Add spacing below contact buttons (above description) */
    }

    .product-description-container {
        order: 5;
        border-bottom: none;
        /* Optional: remove/adjust border if it looks weird at bottom */
    }

    /* Lift Drawer Footer above Sticky Nav */
    .drawer-footer {
        padding-bottom: 5rem;
    }
}

/* Image Modal Styles */
.image-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.image-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.image-modal-content {
    position: relative;
    max-width: 100%;
    max-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.image-modal-content img {
    max-width: 95vw;
    max-height: 95vh;
    /* Desktop: Make it larger by default */
    min-height: 70vh;
    min-width: 50vw;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@media (min-width: 1024px) {
    .image-modal-content img {
        min-height: 85vh;
        /* Larger on desktop */
        max-width: 90vw;
    }
}


.image-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Mobile Full Width Product Image */
@media (max-width: 768px) {
    #main-media-container {
        /* Break out of container padding (1rem on each side) */
        margin-left: -1rem;
        margin-right: -1rem;
        width: calc(100% + 2rem);
        max-width: none;
        border-radius: 0 !important;
        min-height: auto !important;
        background: #f9f9f9;
        margin-bottom: 1rem;
    }

    #main-media-container img,
    #main-media-container video {
        border-radius: 0 !important;
        width: 100% !important;
        max-height: 50vh !important;
        /* Allow it to be taller than 200px on mobile */
        object-fit: contain;
        /* or cover if you want crop */
    }

    /* Adjust nav arrows on mobile if needed */
    #main-media-container button {
        width: 32px !important;
        height: 32px !important;
    }
}