﻿/* Global Box Sizing for consistent layout */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --primary-color: #2edbb6;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-bg: #f8f9fa;
    --dark-bg: #018771;
    /* Responsive spacing variables */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
}

/* Base responsive typography */
html {
    font-size: 16px; /* Base font size */
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background: var(--light-bg);
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Responsive font sizes */
h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h2 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
}

h4 {
    font-size: clamp(1.1rem, 2.5vw, 1.25rem);
}

p, a, li {
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.font-inter {
    font-family: 'Inter', sans-serif;
}

/* ===== DEFAULT VISIBILITY (desktop-first) =====
   These base rules ensure the correct layout renders immediately on
   page load, before media queries are evaluated.  Without them the
   hamburger icon is visible and desktop nav is missing for a brief
   flash (or permanently if output.css hasn't loaded yet). */
.desktop-nav {
    display: flex;
}

.desktop-cart-wishlist {
    display: flex;
}

.menu-toggle {
    display: none;
}

/* ===== HEADER & NAVIGATION ===== */

/* Responsive logo */
.navbar-brand-logo {
    width: clamp(35px, 8vw, 40px);
    height: clamp(35px, 8vw, 40px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--secondary-color);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    flex-shrink: 0;
}

    .navbar-brand-logo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }

.company-name {
    font-size: clamp(0.875rem, 2.5vw, 1.2rem);
    font-weight: 700;
    line-height: 1.2;
    white-space: normal;
    word-wrap: break-word;
}

/* Header with proper z-index */
header {
    position: relative !important;
    display: block;
    width: 100%;
    padding: clamp(0.5rem, 2vw, 1rem) clamp(0.5rem, 3vw, 2rem);
}

/* Header Navigation Styles */
.header-nav-link {
    color: black !important;
    font-weight: 500;
    padding: clamp(0.375rem, 1.5vw, 0.5rem) clamp(0.5rem, 2vw, 1rem);
    transition: all 0.3s ease;
    display: block;
    text-decoration: none;
    font-size: clamp(0.875rem, 2vw, 1rem);
    white-space: nowrap;
}

    .header-nav-link:hover, .header-nav-link.active {
        border-bottom: 3px solid teal;
        transform: translateY(-1px);
    }

/* User profile circle container */
.user-profile-circle {
    position: relative;
    width: clamp(35px, 8vw, 40px);
    height: clamp(35px, 8vw, 40px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: clamp(12px, 3vw, 14px);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

    .user-profile-circle:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

/* User dropdown menu */
.user-dropdown {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    width: clamp(180px, 40vw, 220px);
    background: white !important;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2) !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    margin-top: clamp(4px, 1vw, 8px);
    z-index: 99999 !important;
}

    .user-dropdown.active {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
    }

/* Dropdown items */
.user-dropdown-item {
    display: block;
    width: 100%;
    padding: clamp(10px, 2vw, 12px) clamp(12px, 3vw, 16px);
    color: #374151;
    text-decoration: none;
    font-size: clamp(0.8rem, 2vw, 0.875rem);
    transition: background-color 0.2s ease;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}

    .user-dropdown-item:hover {
        background-color: #f3f4f6;
        color: #1f2937;
    }

    .user-dropdown-item i {
        width: 16px;
        margin-right: clamp(6px, 1.5vw, 8px);
        color: #6b7280;
        font-size: clamp(0.75rem, 2vw, 0.875rem);
    }

    .user-dropdown-item.logout {
        border-top: 1px solid #e5e7eb;
        color: #dc2626;
    }

        .user-dropdown-item.logout:hover {
            background-color: #fee2e2;
            color: #dc2626;
        }

        .user-dropdown-item.logout i {
            color: #dc2626;
        }

/* Desktop cart/wishlist container */
.desktop-cart-wishlist {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 2vw, 1rem);
}

    .desktop-cart-wishlist .relative {
        position: relative;
    }

/* Dropdown container */
.dropdown-container {
    position: relative !important;
}

/* ===== MOBILE MENU ===== */

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: clamp(260px, 80vw, 300px);
    max-width: 90vw;
    height: 100vh;
    background: linear-gradient(135deg, #2edbb6, #018771);
    transition: right 0.3s ease;
    z-index: 999999 !important;
    padding: clamp(1rem, 3vw, 1.5rem);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    overflow-y: auto;
}

    .mobile-menu.active {
        right: 0;
    }

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.mobile-nav-link {
    color: white !important;
    font-weight: 500;
    padding: clamp(0.5rem, 2vw, 0.75rem) clamp(0.5rem, 2vw, 1rem);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    margin-bottom: var(--spacing-xs);
}

    .mobile-nav-link:hover, .mobile-nav-link.active {
        color: black !important;
        background: rgba(255,255,255,0.1);
        border-radius: 8px;
        padding-left: clamp(1rem, 3vw, 1.5rem);
    }

/* Menu Toggle Button */
.menu-toggle {
    flex-direction: column;
    cursor: pointer;
    padding: var(--spacing-sm);
    z-index: 1001;
    position: relative;
    gap: clamp(2px, 1vw, 3px);
}

    .menu-toggle span {
        width: clamp(22px, 5vw, 25px);
        height: clamp(2px, 0.5vw, 3px);
        background: black;
        transition: 0.3s;
        border-radius: 2px;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(clamp(-4px, -1vw, -5px), clamp(5px, 1.2vw, 6px));
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(clamp(-4px, -1vw, -5px), clamp(-5px, -1.2vw, -6px));
    }

/* Mobile Menu Close Button */
.mobile-menu-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: none;
    border: none;
    color: white;
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: 50%;
    transition: background 0.3s ease;
    z-index: 10;
}

    .mobile-menu-close:hover {
        background: rgba(255,255,255,0.1);
    }

/* Mobile Login Button */
.mobile-login-btn {
    background: white;
    color: var(--dark-bg);
    padding: clamp(0.625rem, 2vw, 0.75rem) clamp(1.25rem, 3vw, 1.5rem);
    border-radius: 25px;
    font-weight: 600;
    text-align: center;
    margin: var(--spacing-lg) 0;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
}

    .mobile-login-btn:hover {
        background: #f8f9fa;
        transform: translateY(-1px);
    }

/* Mobile User Profile */
.mobile-user-profile {
    display: flex;
    align-items: center;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-md);
}

.mobile-user-circle {
    width: clamp(45px, 10vw, 50px);
    height: clamp(45px, 10vw, 50px);
    border-radius: 50%;
    background: white;
    color: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: clamp(1rem, 3vw, 1.2rem);
    flex-shrink: 0;
}

.mobile-user-info h4 {
    color: white;
    margin: 0;
    font-size: clamp(1rem, 3vw, 1.1rem);
    font-weight: 600;
    line-height: 1.3;
}

.mobile-user-info p {
    color: rgba(255,255,255,0.8);
    margin: 0;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
}

/* Cart & Wishlist Icons */
.cart-wishlist-icon-container {
    background: rgba(255,255,255,0.2);
    padding: clamp(0.375rem, 1.5vw, 0.5rem);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    width: clamp(35px, 8vw, 40px);
    height: clamp(35px, 8vw, 40px);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .cart-wishlist-icon-container i {
        font-size: clamp(1rem, 3vw, 1.25rem);
    }

    .cart-wishlist-icon-container:hover {
        border: 2px solid teal;
        transform: translateY(-2px);
    }

.mobile-cart-wishlist-icon-container {
    color: white !important;
    font-weight: 500;
    padding: clamp(0.5rem, 2vw, 0.75rem) 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
}

    .mobile-cart-wishlist-icon-container:hover, .mobile-cart-wishlist-icon-container.active {
        color: black !important;
        padding-left: clamp(1rem, 3vw, 1.5rem);
        background: rgba(255,255,255,0.1);
        border-radius: 8px;
    }


.count-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: clamp(18px, 4vw, 20px);
    height: clamp(18px, 4vw, 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.7rem, 2vw, 0.8rem);
    font-weight: bold;
}

/* ===== FOOTER ===== */

footer {
    padding: clamp(2rem, 5vw, 3rem) clamp(1rem, 3vw, 2rem);
}

.footer-section {
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
}

    .footer-section h3 {
        margin-bottom: clamp(0.75rem, 2vw, 1rem);
        color: darkblue;
        font-size: clamp(1.1rem, 3vw, 1.25rem);
        font-weight: 600;
    }

    .footer-section p,
    .footer-section a {
        color: black;
        font-weight: 600;
        line-height: 1.6;
        font-size: clamp(0.825rem, 2vw, 0.95rem);
    }

        .footer-section a:hover {
            color: white;
            transition: color 0.3s ease;
        }

.social-icon {
    width: clamp(35px, 8vw, 40px);
    height: clamp(35px, 8vw, 40px);
    color: white !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: clamp(1rem, 3vw, 1.25rem);
}

    .social-icon:hover {
        background: #2980b9;
        transform: translateY(-2px);
    }

.footer-bottom {
    text-align: center;
    padding-top: clamp(1rem, 2vw, 1.5rem);
    border-top: 1px solid #34495e;
    color: darkslateblue;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

footer #footer-ul {
    list-style-type: none !important;
    padding: 0;
    margin: 0;
}

    footer #footer-ul li {
        margin-bottom: clamp(0.375rem, 1.5vw, 0.5rem);
    }

/* ===== CONTENT ELEMENTS Z-INDEX ===== */

.slideshow-container {
    position: relative;
    z-index: 1 !important;
}

.category-card,
.best-seller-card,
.info-card {
    position: relative;
    z-index: 1;
}

    .category-card:hover,
    .best-seller-card:hover,
    .info-card:hover {
        z-index: 2;
    }

main {
    position: relative;
    z-index: 1;
}

.offers-section {
    position: relative;
    z-index: 1;
}

/* ===== SCROLL BUTTON ===== */

.scroll-to-top {
    position: fixed !important;
    bottom: clamp(20px, 4vw, 30px) !important;
    right: clamp(20px, 4vw, 30px) !important;
    width: clamp(45px, 10vw, 50px);
    height: clamp(45px, 10vw, 50px);
    background: linear-gradient(135deg, #2edbb6, #018771);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 3vw, 1.2rem);
    transition: all 0.3s ease;
    z-index: 99999 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

    .scroll-to-top.scroll-down {
        background: linear-gradient(135deg, #054ef6, #9203d5);
        animation: bounce-down 2s ease-in-out infinite;
        border: 1px solid white;
    }

    .scroll-to-top.scroll-up {
        background: linear-gradient(135deg, #054ef6, #9203d5);
        animation: bounce-up 2s ease-in-out infinite;
        border: 1px solid white;
    }

    .scroll-to-top:hover {
        background: linear-gradient(135deg, #9203d5, #054ef6);
        transform: translateY(-5px) scale(1.1);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
        animation: none !important;
    }

    .scroll-to-top:active {
        transform: translateY(-2px) scale(1.05);
    }

@keyframes bounce-down {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(8px);
    }
}

@keyframes bounce-up {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575px) {
    :root {
        --spacing-xs: 0.25rem;
        --spacing-sm: 0.375rem;
        --spacing-md: 0.75rem;
        --spacing-lg: 1rem;
        --spacing-xl: 1.5rem;
    }

    html {
        font-size: 14px;
    }

    header {
        padding: 0.5rem 0.75rem;
    }

    .company-name {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767px) {
    html {
        font-size: 15px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .menu-toggle {
        display: none !important;
    }

    .desktop-nav {
        display: flex !important;
    }

    .desktop-cart-wishlist {
        display: flex !important;
    }

    .mobile-menu {
        display: none;
    }

    header {
        padding: 1rem 1.5rem;
    }

    .footer-bottom {
        text-align: center;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    html {
        font-size: 16px;
    }

    .header-nav-link {
        padding: 0.5rem 1.25rem;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Ultra wide screens (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Mobile-specific styles */
@media (max-width: 767px) {
    .menu-toggle {
        display: flex !important;
    }

    .desktop-nav {
        display: none !important;
    }

    .desktop-cart-wishlist {
        display: none !important;
    }

    .user-dropdown {
        right: -10px;
        width: 90vw;
        max-width: 200px;
    }

    /* Ensure footer content is left-aligned on mobile */
    .footer-section {
        text-align: left !important;
    }

    .footer-bottom {
        text-align: left;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-menu {
        padding: 0.75rem;
    }

    .mobile-nav-link {
        padding: 0.375rem 0.5rem;
    }

    .mobile-user-profile {
        padding: 0.5rem 0;
        margin-bottom: 0.5rem;
    }
}

/* Print styles */
@media print {
    .menu-toggle,
    .mobile-menu,
    .scroll-to-top,
    .user-dropdown {
        display: none !important;
    }

    header,
    footer {
        page-break-inside: avoid;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .navbar-brand-logo img,
    .social-icon {
        image-rendering: pixelated;
    }
}

/* Utility classes for responsive design */
.text-responsive {
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.container-responsive {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2rem);
}

.flex-responsive {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.5rem, 2vw, 1rem);
}

.grid-responsive {
    display: grid;
    gap: clamp(0.75rem, 2vw, 1.5rem);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
