/* --- Core Variables and Reset --- */
:root {
    --dark-color: #1A1A1A;
    --white-color: #FFFFFF;
    --font-main: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--dark-color);
    color: var(--white-color);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.7;
}

ul {
    list-style-type: none;
}

img {
    max-width: 100%;
    display: block;
}

/* --- Header --- */
.main-header {
    background-color: var(--dark-color);
    color: var(--white-color);
    border-bottom: 1px solid var(--white-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header-left, .header-right {
    flex: 1; /* This is key: left and right sections take up equal space */
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-left {
    justify-content: flex-start; /* Align content to the left */
}

.header-right {
    justify-content: flex-end; /* Align content to the right */
}

.header-center {
    flex: 1; /* Giving it flex helps with alignment */
    text-align: center;
}

.logo-link {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
}

/* --- Hamburger Button for Mobile --- */
.menu-button {
    background: none;
    border: none;
    cursor: pointer;
    display: none; /* Hidden by default, shown on mobile */
    flex-direction: column;
    gap: 5px;
    z-index: 1200;
}

.hamburger-line {
    width: 25px;
    height: 2px;
    background-color: var(--white-color);
    transition: transform 0.3s ease;
}

.icon-link svg {
    stroke: var(--white-color);
}


/* --- Desktop Navigation --- */
.desktop-nav {
    display: flex; /* Shown by default */
}
.desktop-nav ul {
    display: flex;
    gap: 2.5rem; /* Slightly adjusted gap */
    align-items: center;
}
.desktop-nav a {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 5px;
}
.desktop-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--white-color);
    transform: scaleX(0);
    transform-origin: left; /* Animation starts from the left */
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}
.desktop-nav a:hover::after {
    transform: scaleX(1);
}


/* --- Mobile (Fullscreen) Navigation --- */
.fullscreen-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-color);
    color: var(--white-color);
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 1100;
}

.fullscreen-nav.active {
    transform: translateX(0);
}

.fullscreen-nav ul {
    text-align: center;
}

.fullscreen-nav ul li {
    margin: 2rem 0;
}

.fullscreen-nav ul li a {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white-color);
}

.close-button {
    position: absolute;
    top: 1.5rem;
    right: 2.5rem;
    font-size: 3rem;
    color: var(--white-color);
    background: none;
    border: none;
    cursor: pointer;
}


/* --- Main Content & Product Gallery --- */
main {
    min-height: calc(100vh - 160px);
    padding: 2rem;
}
.product-gallery {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}
.gallery-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 3rem;
    text-transform: uppercase;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}
.product-card-link { text-decoration: none; color: inherit; }
.product-card {
    background-color: var(--dark-color);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-card:hover { transform: translateY(-8px); }
.product-image-container { overflow: hidden; background-color: var(--white-color); }
.product-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
.product-info { padding: 1.5rem 1rem; }
.product-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.product-price { font-size: 1rem; font-weight: 400; }


/* --- Footer --- */
.main-footer {
    background-color: var(--dark-color);
    color: var(--white-color);
    padding: 3rem 2rem 1rem;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    padding-bottom: 2rem;
}
.footer-section { flex: 1; min-width: 200px; }
.footer-section h4 { font-weight: 700; margin-bottom: 1rem; letter-spacing: 1px; }
.footer-section a { color: var(--white-color); opacity: 0.8; }
.footer-section a:hover { opacity: 1; }
.social-icons { display: flex; gap: 1rem; }
.social-icons a { font-weight: 700; }
.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    opacity: 0.7;
}

/* --- Responsive --- */

@media (max-width: 768px) {
    .main-header {
        padding: 1rem;
    }
    
    .desktop-nav {
        display: none; /* Hide desktop nav on mobile */
    }
    
    .menu-button {
        display: flex; /* Show hamburger on mobile */
    }

    .gallery-title {
        font-size: 1.8rem;
    }
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
    .social-icons {
        justify-content: center;
    }
}
/* --- Shop Page --- */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 3rem;
    text-transform: uppercase;
}

.shop-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start; /* Aligns items to the top */
}

/* --- Filter Sidebar --- */
.shop-filters {
    flex: 0 0 250px; /* Do not grow, do not shrink, base width of 250px */
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    padding-right: 2rem;
}

.filter-group {
    margin-bottom: 2rem;
}

.filter-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--white-color);
    padding-bottom: 0.5rem;
}

.filter-list li {
    margin-bottom: 0.75rem;
}

.filter-list a {
    opacity: 0.8;
    transition: opacity 0.3s ease, padding-left 0.3s ease;
}

.filter-list a:hover {
    opacity: 1;
    padding-left: 5px; /* Subtle indent on hover */
}

.filter-select {
    width: 100%;
    background-color: var(--dark-color);
    color: var(--white-color);
    border: 1px solid var(--white-color);
    padding: 0.75rem;
    font-family: var(--font-main);
    font-size: 1rem;
    cursor: pointer;
}

/* --- Shop Product Grid --- */
.shop-product-grid {
    flex: 1; /* Takes up the remaining space */
}


/* --- Pagination --- */
.pagination {
    margin-top: 3rem;
}

.pagination ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.page-link {
    display: block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--white-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.page-link:hover {
    background-color: var(--white-color);
    color: var(--dark-color);
    opacity: 1; /* Override default link hover */
}

.page-link.active {
    background-color: var(--white-color);
    color: var(--dark-color);
    font-weight: 700;
}


/* --- Responsive Shop Page --- */
@media (max-width: 900px) { /* A wider breakpoint for this layout */
    .shop-container {
        flex-direction: column;
    }
    .shop-filters {
        flex-basis: auto; /* Let it take full width */
        width: 100%;
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        padding-bottom: 2rem;
    }
}
@media (max-width: 768px) {
    .page-title {
        font-size: 1.8rem;
    }
}
/* --- General Button Styles --- */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid var(--white-color);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}
.btn-primary {
    background-color: var(--white-color);
    color: var(--dark-color);
}
.btn-primary:hover {
    background-color: transparent;
    color: var(--white-color);
    opacity: 1;
}
.btn-secondary {
    background-color: transparent;
    color: var(--white-color);
}
.btn-secondary:hover {
    background-color: var(--white-color);
    color: var(--dark-color);
    opacity: 1;
}
.btn-full {
    width: 100%;
}

/* --- Cart Badge in Header --- */
.icon-link {
    position: relative;
}
.cart-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--white-color);
    color: var(--dark-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
}


/* --- Product Detail Page --- */
.product-detail-container {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}
.product-detail-image {
    flex: 1;
    max-width: 500px;
}
.product-detail-info {
    flex: 1;
}
.product-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.product-price {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}
.product-description {
    margin-bottom: 2rem;
    line-height: 1.8;
}
.cart-form .form-group {
    margin-bottom: 1.5rem;
}
.quantity-input {
    width: 80px;
    padding: 0.75rem;
    background-color: var(--dark-color);
    color: var(--white-color);
    border: 1px solid var(--white-color);
    text-align: center;
    font-size: 1rem;
}

/* --- Cart Page --- */
.cart-empty {
    text-align: center;
    padding: 4rem 0;
}
.cart-empty p {
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

.cart-content {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}
.cart-items {
    flex: 2;
}
.cart-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.cart-item-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
}
.cart-item-details {
    flex: 1;
}
.cart-item-name {
    font-weight: 700;
    font-size: 1.2rem;
}
.cart-item-price {
    margin: 0.5rem 0;
}
.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.quantity-input-small {
    width: 50px;
    padding: 0.5rem;
    text-align: center;
    background-color: var(--dark-color);
    color: var(--white-color);
    border: 1px solid var(--white-color);
}
.btn-update {
    background: none;
    border: none;
    color: var(--white-color);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
}
.cart-item-total {
    text-align: right;
}
.btn-remove {
    background: none;
    border: 1px solid var(--white-color);
    color: var(--white-color);
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    margin-top: 1rem;
    font-size: 1rem;
}

.cart-summary {
    flex: 1;
    background-color: #2a2a2a; /* Slightly lighter dark */
    padding: 2rem;
}
.cart-summary h2 {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--white-color);
    padding-bottom: 1rem;
}
.summary-line, .summary-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.summary-total {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--white-color);
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .product-detail-container, .cart-content {
        flex-direction: column;
    }
}
/* --- Product Card Enhancements for Shop Page --- */

/* We remove the link wrapper and style the card directly */
.product-card {
    position: relative; /* Needed for positioning the button */
    overflow: hidden;   /* Hides the button when it's outside */
}

/* Ensure the whole image is a link */
.product-image-link {
    display: block;
}

/* Ensure the product name is also a link */
.product-name-link {
    text-decoration: none;
    color: inherit;
}

.product-card:hover {
    transform: none; /* We override the old lift effect */
}

.product-card .product-image-container img {
    transition: transform 0.4s ease;
}

.product-card:hover .product-image-container img {
    transform: scale(1.05); /* Slight zoom on hover */
}

/* Add to Cart Button Styling */
.btn-add-to-cart {
    width: 100%;
    border-radius: 0; /* Square edges */
    padding: 1rem;
    
    /* Initially hidden below the card */
    position: absolute;
    bottom: -60px; /* Start position outside the card view */
    left: 0;
    
    transition: bottom 0.4s cubic-bezier(0.2, 1, 0.3, 1);
}

.product-card:hover .btn-add-to-cart {
    bottom: 0; /* Slide in on hover */
}

.product-card .product-info {
    /* We add a background to hide the button sliding underneath */
    background-color: var(--dark-color);
    position: relative;
    z-index: 2;
}

/* --- Auth Forms (Login/Register) --- */
.auth-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #2a2a2a;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--dark-color);
    color: var(--white-color);
    border: 1px solid var(--white-color);
    font-family: var(--font-main);
    font-size: 1rem;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-switch a {
    font-weight: 700;
    text-decoration: underline;
}

.error-message {
    background-color: #ff4d4d;
    color: var(--white-color);
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
}

/* --- Account Page --- */
.account-welcome {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    line-height: 1.8;
}

/* --- Intl Tel Input Custom Styles --- */
.iti {
    width: 100%; /* Make the container full width */
}

.iti__country-list {
    background-color: #333; /* Dark background for dropdown */
    border: 1px solid var(--white-color);
}

.iti__country {
    color: var(--white-color);
}

.iti__country.iti__highlight {
    background-color: #444; /* Highlight color for selected country */
}

.iti__divider {
    border-bottom-color: #555; /* Darker divider */
}

.iti--allow-dropdown input[type="tel"] {
    /* Ensure our text input styles apply */
    width: 100%;
    border-radius: 0; /* Remove default border radius if any */
}

/* --- LOADER STYLING (Unchanged) --- */
        .loader {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: #ffffff;
            transition: opacity 0.75s, visibility 0.75s;
            z-index: 9999;
        }

        .loader--hidden {
            opacity: 0;
            visibility: hidden;
        }

        .loader img {
            width: 100px;
            animation: stutter-zoom 2.5s infinite ease-in-out;
        }

        @keyframes stutter-zoom {
            0% { transform: scale(1); opacity: 1; }
            20% { transform: scale(0.6); opacity: 0.7; }
            35% { transform: scale(0.75); }
            50% { transform: scale(0.65); }
            65% { transform: scale(0.8); }
            100% { transform: scale(1); opacity: 1; }
        }

        /* --- STYLISH CONTENT STYLING (Unchanged) --- */
        .content {
            padding: 40px;
            text-align: center;
            opacity: 0;
            animation: fadeInContent 1s ease-in-out forwards;
            animation-delay: 3.5s; /* Delay should be > loader delay */
        }
        
        @keyframes fadeInContent {
            to { opacity: 1; }
        }

        .brand-title {
            font-family: 'Playfair Display', serif;
            font-size: 5rem;
            font-weight: 700;
            letter-spacing: 4px;
            text-transform: uppercase;
            color: #1a1a1a;
            margin: 40px 0 10px 0;
        }
        
        .tagline {
            font-size: 1.1rem;
            letter-spacing: 3px;
            text-transform: uppercase;
            color: #888;
            margin-bottom: 40px;
        }

/* --- Search Form --- */
.search-form {
    display: flex;
    width: 100%;
    margin-bottom: 1.5rem;
}
.search-input {
    flex-grow: 1;
    border: 1px solid var(--white-color);
    background-color: transparent;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    color: var(--white-color);
    border-radius: 0;
}
.search-input:focus {
    outline: none;
}
.search-form .btn {
    margin-left: -1px; /* Overlap borders */
    border-radius: 0;
}

/* --- Mobile search toggle --- */
.search-icon-mobile {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.search-icon-mobile svg {
    stroke: var(--white-color);
}

.close-filters-button {
    display: none; /* Hidden by default */
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2.5rem;
    color: var(--white-color);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

@media (max-width: 900px) {
    .search-icon-mobile {
        display: inline-block; /* Show on tablet/mobile */
        z-index: 1200; /* Ensure it's clickable */
    }

    /* Adjust the existing rule for shop-filters */
    .shop-filters {
        display: none; /* Hide by default on mobile */
        position: fixed; /* Or absolute, depending on desired behavior */
        top: 71px; /* Height of the header */
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--dark-color);
        z-index: 1000;
        overflow-y: auto;
        padding: 2rem;
        border-right: none;
    }

    .shop-filters.active {
        display: block; /* Show when toggled */
        background-color: rgba(26, 26, 26, 0.95);
    }
    
    .shop-filters.active .close-filters-button {
        display: block;
    }
    
    .shop-container {
        position: relative;
    }
}