/* Reset and Root Variables */
:root {
    --navy-blue: #061428;
    --navy-blue-light: #1E2D4A;
    --gold: #D4AF37;
    --gold-hover: #b8962c;
    --white: #ffffff;
    --gray-light: #f5f7fa;
    --gray-medium: #cbd5e1;
    --gray-dark: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--gray-light);
    color: var(--navy-blue);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

.gold-text {
    color: var(--gold);
}

.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Base Buttons */
.btn-primary,
.btn-secondary,
.btn-lg {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--gold);
    color: var(--white);
    box-shadow: 0 4px 14px 0 rgba(212, 175, 55, 0.39);
}

.btn-primary:hover {
    background-color: var(--gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(212, 175, 55, 0.5);
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    background-color: var(--gold);
    color: var(--white);
    box-shadow: 0 4px 14px 0 rgba(212, 175, 55, 0.39);
}

.btn-lg:hover {
    background-color: var(--gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(212, 175, 55, 0.5);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(6, 20, 40, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h2 {
    color: var(--white);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--gray-medium);
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--gold);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--gold);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cart-icon {
    position: relative;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.cart-icon:hover {
    color: var(--gold);
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: var(--gold);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero {
    margin-top: 70px;
    height: 70vh;
    min-height: 500px;
    background: linear-gradient(135deg, var(--navy-blue) 0%, rgba(6, 20, 40, 0.85) 100%), url('https://images.unsplash.com/photo-1607082348824-0a96f2a4b9da?q=80&w=2670&auto=format&fit=crop') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 1rem;
    position: relative;
}

.hero-content {
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
}

.hero h1 {
    font-size: 3.5rem;
    color: var(--white);
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    color: var(--gray-medium);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Container */
.main-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section {
    margin-bottom: 6rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-medium);
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--navy-blue);
}

/* Latest Stock Slider */
.latest-stock-slider {
    display: flex;
    overflow-x: auto;
    gap: 2rem;
    padding: 1rem 0 2rem 0;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.latest-stock-slider::-webkit-scrollbar {
    display: none;
}

.slider-btn {
    background-color: var(--navy-blue);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-left: 0.5rem;
}

.slider-btn:hover {
    background-color: var(--gold);
    transform: scale(1.1);
}

.controls {
    display: flex;
}

/* Product Card Base */
.product-card {
    background-color: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card.horizontal {
    width: 250px;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #f8fafc;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.product-image.secondary {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transform: scale(1.1);
}

.product-card:hover .product-image.primary {
    opacity: 0;
}

.product-card:hover .product-image.secondary {
    opacity: 1;
    transform: scale(1);
}

.badge-new {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--gold);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 10;
    letter-spacing: 1px;
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--navy-blue);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gold);
    margin-top: auto;
    margin-bottom: 1rem;
}

.add-to-cart-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--navy-blue-light);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-to-cart-btn:hover {
    background-color: var(--gold);
}

.wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-dark);
    box-shadow: var(--shadow);
    transition: var(--transition);
    z-index: 10;
}

.wishlist-btn:hover,
.wishlist-btn.active {
    color: #ef4444;
}

/* Category Filters */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    background-color: var(--white);
    border: 1px solid var(--gray-medium);
    border-radius: 30px;
    color: var(--navy-blue);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-size: 1rem;
}

.filter-btn:hover {
    background-color: var(--gray-light);
    border-color: var(--navy-blue);
}

.filter-btn.active {
    background-color: var(--navy-blue);
    color: var(--white);
    border-color: var(--navy-blue);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Loading Spinner */
.loading-spinner {
    width: 100%;
    text-align: center;
    padding: 3rem;
    color: var(--navy-blue);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.loading-spinner i {
    color: var(--gold);
    font-size: 2rem;
}

/* Footer */
footer {
    background-color: var(--navy-blue);
    color: var(--white);
    padding: 4rem 2rem 2rem;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand h3 {
    color: var(--gold);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-brand p {
    color: var(--gray-medium);
}

.footer-links h4,
.footer-contact h4 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.footer-links a {
    display: block;
    color: var(--gray-medium);
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--gold);
    padding-left: 5px;
}

.footer-contact p {
    color: var(--gray-medium);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.socials {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--navy-blue-light);
    color: var(--white);
    border-radius: 50%;
    transition: var(--transition);
}

.socials a:hover {
    background-color: var(--gold);
    transform: translateY(-3px);
}

.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: var(--gray-medium);
    font-size: 0.9rem;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--white);
    cursor: pointer;
    margin-left: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 70px;
        left: -100%;
        flex-direction: column;
        background-color: var(--navy-blue);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
        gap: 1.5rem;
    }

    .nav-links.active {
        left: 0;
    }

    .user-action {
        display: none;
        /* Hide download button on small screens to save space */
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }

    .main-container {
        padding: 2rem 1rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    transition: var(--transition);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    width: 90%;
    max-width: 1000px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalFadeIn 0.4s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    color: var(--gray-dark);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--navy-blue);
    transform: scale(1.2);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 3rem;
}

.modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.main-img-container {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--gray-light);
    border: 1px solid var(--gray-medium);
}

.main-img-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.thumb-img {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.thumb-img.active {
    border-color: var(--gold);
}

.thumb-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-details {
    display: flex;
    flex-direction: column;
}

.modal-details h2 {
    font-size: 2rem;
    color: var(--navy-blue);
    margin-bottom: 0.5rem;
}

.modal-category {
    color: var(--gray-dark);
    font-weight: 500;
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.modal-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 2rem;
}

.modal-description {
    margin-bottom: 2rem;
}

.modal-description h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--navy-blue);
}

.modal-description p {
    color: var(--gray-dark);
    font-size: 1rem;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: auto;
}

.btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #25D366;
    color: white;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-whatsapp:hover {
    background-color: #128C7E;
    transform: translateY(-2px);
}

/* Product Card Enhancements */
.product-card {
    cursor: pointer;
}

.product-card .add-to-cart-btn {
    z-index: 5;
}

@media (max-width: 900px) {
    .modal-body {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem;
    }

    .main-img-container {
        height: 300px;
    }

    .modal-content {
        margin: 2% auto;
    }
}

@media (max-width: 600px) {
    .modal-actions {
        grid-template-columns: 1fr;
    }
}

/* Cart Drawer Styles */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background-color: var(--white);
    z-index: 3000;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.4s ease;
    display: flex;
    flex-direction: column;
}

.cart-drawer.active {
    right: 0;
}

.cart-header {
    padding: 1.5rem 2rem;
    background-color: var(--navy-blue);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-cart {
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-cart:hover {
    color: var(--gold);
    transform: rotate(90deg);
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem;
}

.empty-cart-msg {
    text-align: center;
    color: var(--gray-dark);
    margin-top: 3rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-light);
}

.cart-item-img {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--navy-blue);
}

.cart-item-price {
    color: var(--gold);
    font-weight: 700;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--gray-medium);
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: var(--transition);
}

.qty-btn:hover {
    background-color: var(--gray-light);
    border-color: var(--navy-blue);
}

.remove-item {
    color: #ef4444;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: auto;
}

.cart-footer {
    padding: 2rem;
    background-color: var(--gray-light);
    border-top: 1px solid var(--gray-medium);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--navy-blue);
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
}

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2999;
    display: none;
}

.cart-overlay.active {
    display: block;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--gold);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: var(--transition);
}

.back-to-top:hover {
    background-color: var(--navy-blue);
    transform: translateY(-5px);
}

.back-to-top.show {
    display: flex;
}

/* Modal Related Products */
.modal-related {
    grid-column: 1 / -1; /* Spans across both columns */
    padding: 2rem 0 0;
    border-top: 1px solid var(--gray-light);
    margin-top: 1rem;
}

.modal-related h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--navy-blue);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Force 4 columns on desktop */
    gap: 1.5rem;
    width: 100%;
}

.related-grid .product-card {
    border-radius: 12px;
    width: 100%;
    min-width: 0; /* Prevents overflow in grid */
}

.related-grid .product-image-wrapper {
    height: 140px;
}

.related-grid .product-title {
    font-size: 0.9rem;
}

.related-grid .product-price {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.related-grid .add-to-cart-btn {
    padding: 0.5rem;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .modal-related {
        padding: 1.5rem;
    }

    .related-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.user-action {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* Auth Nav Styles */
.auth-nav-container {
    display: flex;
    align-items: center;
}

.login-nav-btn {
    color: var(--navy-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-nav-btn:hover {
    color: var(--gold);
}

.user-profile-nav {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.nav-profile-pic {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    min-width: 150px;
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
    padding: 1rem;
    display: none;
    z-index: 100;
    margin-top: 10px;
}

.user-profile-nav:hover .user-dropdown {
    display: block;
}

.user-dropdown p {
    font-weight: 600;
    color: var(--navy-blue);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.user-dropdown a {
    display: block;
    color: var(--gray-dark);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    transition: var(--transition);
}

.user-dropdown a:hover {
    color: var(--gold);
}

@media (max-width: 768px) {
    .auth-nav-container {
        margin-right: 0.8rem;
    }
    .login-nav-btn span {
        display: none;
    }
}

