/* ==================== CSS VARIABLES ==================== */
:root {
    /* Typography - مكان مركزي لتغيير خط الموقع بالكامل */
    --font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;

    /* Brand Colors */
    --brand-black: #1a1a1a;
    --brand-yellow: #FFC400;
    --brand-white: #ffffff;

    /* Light Theme (Default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --navbar-bg: #ffffff;
    --navbar-text: #1a1a1a;
    --footer-bg: #f8f9fa;
    --footer-text: #1a1a1a;
    --yellow-gradient: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

/* Dark Theme */
body.theme-dark {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: #333333;
    --card-bg: #1e1e1e;
    --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --navbar-bg: #1a1a1a;
    --navbar-text: #ffffff;
    --footer-bg: #1e1e1e;
    --footer-text: #ffffff;
    --yellow-gradient: linear-gradient(135deg, rgba(255, 196, 0, 0.15) 0%, rgba(255, 196, 0, 0.05) 100%);
}

/* ==================== BASE STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    /* Removed overflow-x: hidden to fix scroll trapping */
}

/* Offset navbar height - for all pages except homepage */
body:not(.home-page) {
    padding-top: 80px;
}

@media (max-width: 768px) {
    body:not(.home-page) {
        padding-top: 0;
        /* Reduced specific padding on mobile */
    }
}



a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: var(--navbar-bg);
    border-bottom: 3px solid var(--brand-yellow);
    padding: 0.75rem 0;
    position: fixed !important;
    /* Fixed at the top */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    width: 100%;
}

/* Scroll effect - can be activated with JavaScript */
.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    /* Slight reduction on scroll */
}

main {
    min-height: calc(100vh - 80px);
    /* Ensure sufficient height for scrolling */
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
}

.logo-icon {
    width: 60px;
    height: 60px;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-text .white {
    color: var(--navbar-text);
    font-size: 1rem;
}

.logo-text .yellow {
    color: var(--brand-yellow);
    font-size: 0.9rem;
}

/* Nav Menu */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    align-items: center;
}

.nav-link {
    color: var(--navbar-text);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--brand-black);
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Enhanced Icon Button */
.btn-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-icon:hover {
    background: var(--brand-yellow);
    color: var(--brand-black);
    border-color: var(--brand-yellow);
    transform: translateY(-2px) rotate(5deg);
    box-shadow: 0 4px 15px rgba(255, 196, 0, 0.3);
}

.btn-icon:active {
    transform: translateY(0) scale(0.95);
}

/* Theme-specific button styles */
body.theme-dark .btn-icon {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: var(--brand-yellow);
}

body.theme-dark .btn-icon:hover {
    background: var(--brand-yellow);
    color: var(--brand-black);
    border-color: var(--brand-yellow);
}

body.theme-dark .nav-link {
    color: var(--navbar-text);
}
/* Primary Yellow Button - Enhanced */
.btn-yellow {
    position: relative;
    background: linear-gradient(135deg, var(--brand-yellow) 0%, #FFB300 100%);
    color: var(--brand-black);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 196, 0, 0.25);
    overflow: hidden;
}

.btn-yellow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFD000 0%, var(--brand-yellow) 100%);
    transition: left 0.3s ease;
    z-index: 0;
}

.btn-yellow>* {
    position: relative;
    z-index: 1;
}

.btn-yellow:hover::before {
    left: 0;
}

.btn-yellow:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 196, 0, 0.35);
}

.btn-yellow:active {
    transform: translateY(0) scale(0.98);
}

/* ✅ Loading State */
.btn-yellow.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-yellow.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 3px solid transparent;
    border-top-color: var(--brand-black);
    border-radius: 50%;
    animation: buttonSpin 0.8s linear infinite;
    z-index: 2;
}

@keyframes buttonSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Enhanced Cart Badge with Animation */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
}

/* ✅ Badge Pulse Animation */
@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 15px rgba(239, 68, 68, 0.6);
    }
}

/* Admin Dropdown */
.admin-dropdown {
    position: relative;
}

/* Create invisible hover bridge - larger to prevent accidental close */
.admin-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 1rem;
    display: block;
}

.admin-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: var(--brand-black);
    border: 2px solid var(--brand-yellow);
    border-radius: 10px;
    min-width: 200px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    transition-delay: 0.1s;
    z-index: 1001;
    pointer-events: none;
}

.admin-dropdown:hover .admin-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
    transition-delay: 0s;
}

.admin-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    color: var(--brand-white);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.admin-menu a:hover {
    background: var(--brand-yellow);
    color: var(--brand-black);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--brand-yellow);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ==================== BUTTONS ==================== */
/* ✅ الزر الرئيسي - محسّن */
.btn-primary {
    position: relative;
    background: linear-gradient(135deg, var(--brand-yellow) 0%, #FFB300 100%);
    color: var(--brand-black);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 196, 0, 0.25);
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFD000 0%, var(--brand-yellow) 100%);
    transition: left 0.3s ease;
    z-index: 0;
}

.btn-primary>* {
    position: relative;
    z-index: 1;
}

.btn-primary:hover::before {
    left: 0;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 196, 0, 0.35);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

/* ✅ Loading State */
.btn-primary.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 3px solid transparent;
    border-top-color: var(--brand-black);
    border-radius: 50%;
    animation: buttonSpin 0.8s linear infinite;
    z-index: 2;
}

/* Enhanced Outline Button */
.btn-outline {
    position: relative;
    background: transparent;
    color: var(--brand-yellow);
    border: 2px solid var(--brand-yellow);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--brand-yellow);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn-outline:hover::before {
    left: 0;
}

.btn-outline:hover {
    color: var(--brand-black);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 196, 0, 0.3);
}

.btn-outline:active {
    transform: translateY(0) scale(0.98);
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--footer-bg);
    border-top: 3px solid var(--brand-yellow);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
    color: var(--footer-text);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-title {
    color: var(--brand-yellow);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.625rem;
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--brand-yellow);
}

.footer-copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.social-links {
    display: flex;
    gap: 0.5rem;
}

.social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 196, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-yellow);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--brand-yellow);
    color: var(--brand-black);
}

/* ==================== ALERTS ==================== */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    color: #22c55e;
}

.alert-error,
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
}

.alert-warning {
    background: rgba(255, 196, 0, 0.1);
    border: 1px solid var(--brand-yellow);
    color: #b8860b;
}

/* ==================== LARGE SCREENS ==================== */
@media (min-width: 1024px) {
    .nav-link {
        font-size: 1.05rem;
        padding: 0.6rem 1.25rem;
    }

    .logo-text .white {
        font-size: 1.25rem;
    }

    .logo-text .yellow {
        font-size: 1.1rem;
    }

    .btn-yellow {
        font-size: 1rem;
        padding: 0.6rem 1.25rem;
    }

    .btn-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .admin-menu a {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 3px solid var(--brand-yellow);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-link {
        width: 100%;
        justify-content: center;
    }

    .mobile-toggle {
        display: block;
    }

    .btn-yellow span {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

/* ==================== RESPONSIVE IMAGES ==================== */
.category-image {
    width: 100%;
    height: 250px;
    object-fit: contain;
    border-radius: 12px;
    background: transparent;
}

.product-image,
.product-card img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    border-radius: 12px;
    background: transparent;
}

.product-detail-image {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 12px;
    background: transparent;
}

/* Dark theme product backgrounds */
body.theme-dark .category-image {
    background: transparent;
}

body.theme-dark .product-image,
body.theme-dark .product-card img {
    background: transparent;
}

body.theme-dark .product-detail-image {
    background: transparent;
}

@media (max-width: 768px) {

    .category-image,
    .product-image,
    .product-card img {
        height: 180px;
    }

    .product-detail-image {
        max-height: 300px;
    }
}

/* ==================== ACCESSIBILITY ENHANCEMENTS ==================== */

/* ? Focus Visible ?????? ????? ???????? */
*:focus-visible {
    outline: 3px solid var(--brand-yellow);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ????? outline ?????? ??? */
*:focus:not(:focus-visible) {
    outline: none;
}

/* ????? Focus ??????? ????????? */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--brand-yellow);
    outline-offset: 2px;
}



/* ? Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ? High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-primary: #000000;
    }

    body.theme-dark {
        --border-color: #ffffff;
        --text-primary: #ffffff;
    }

    .btn-yellow,
    .btn-primary {
        border: 2px solid #000000;
    }
}

/* ==================== FORM ENHANCEMENTS ==================== */

/* ? Form Inputs ?????? */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--brand-yellow);
    background: var(--bg-primary);
    box-shadow:
        0 0 0 4px rgba(255, 196, 0, 0.1),
        0 4px 20px rgba(255, 196, 0, 0.15);
    transform: translateY(-2px);
}

/* ? Valid State */
.form-input.valid,
.form-select.valid,
.form-textarea.valid {
    border-color: #22C55E;
    background: rgba(34, 197, 94, 0.05);
}

.form-input.valid:focus,
.form-select.valid:focus,
.form-textarea.valid:focus {
    box-shadow:
        0 0 0 4px rgba(34, 197, 94, 0.1),
        0 4px 20px rgba(34, 197, 94, 0.15);
}

/* ? Invalid State */
.form-input.invalid,
.form-select.invalid,
.form-textarea.invalid {
    border-color: #EF4444;
    background: rgba(239, 68, 68, 0.05);
}

.form-input.invalid:focus,
.form-select.invalid:focus,
.form-textarea.invalid:focus {
    box-shadow:
        0 0 0 4px rgba(239, 68, 68, 0.1),
        0 4px 20px rgba(239, 68, 68, 0.15);
}

/* ? Helper Text */
.form-helper {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-helper.error {
    color: #EF4444;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-helper.success {
    color: #22C55E;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ? Input with Icon */
.input-with-icon {
    position: relative;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    transition: color 0.3s ease;
}

.input-with-icon input {
    padding-left: 3rem;
}

.input-with-icon input:focus~.input-icon {
    color: var(--brand-yellow);
}

/* ==================== NAVBAR ENHANCEMENTS ==================== */

/* ? Navbar Scrolled State ????? */
.navbar {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
    padding: 0.5rem 0;
    background: rgba(255, 255, 255, 0.95);
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 196, 0, 0.1);
}

body.theme-dark .navbar.scrolled {
    background: rgba(26, 26, 26, 0.95);
}

/* ? Logo Animation ??? ??? Scroll */
.navbar.scrolled .logo {
    transform: scale(0.9);
}

.logo {
    transition: transform 0.3s ease;
}

/* ? Nav Links Animation */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 3px;
    background: var(--brand-yellow);
    transition: transform 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: translateX(-50%) scaleX(1);
}


/* ==================== ADMIN DROPDOWN ENHANCEMENTS ==================== */

/* ? Admin Dropdown ????? - ???? ??????? */
.admin-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: -1rem;
    right: -1rem;
    height: 2rem;
    display: block;
    background: transparent;
}

.admin-menu {
    animation: dropdownSlide 0.3s ease;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ? Admin Menu Items ?? Icons */
.admin-menu a {
    position: relative;
    overflow: hidden;
}

.admin-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleX(0);
    width: 4px;
    height: 60%;
    background: var(--brand-yellow);
    transition: transform 0.3s ease;
}

.admin-menu a:hover::before {
    transform: translateY(-50%) scaleX(1);
}

.admin-menu a i {
    transition: transform 0.3s ease;
}

.admin-menu a:hover i {
    transform: scale(1.2) rotate(10deg);
}


/* ==================== FOOTER ENHANCEMENTS ==================== */

/* ? Footer Links ?????? */
.footer-links a {
    position: relative;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-links a::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--brand-yellow);
    transition: width 0.3s ease;
}

.footer-links a:hover::before {
    width: 100%;
}

.footer-links a:hover {
    transform: translateX(-5px);
}

/* ? Social Links ?????? */
.social-links a {
    position: relative;
    overflow: hidden;
}

.social-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--brand-yellow);
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: -1;
}

.social-links a:hover::before {
    transform: scale(1);
}

.social-links a:hover {
    transform: translateY(-3px) rotate(10deg);
}

/* ? Footer Copyright Animation */
.footer-copyright {
    animation: fadeInUp 0.8s ease 0.3s backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==================== PAGE ANIMATIONS ==================== */

/* ? Smooth Page Load */
main {
    animation: pageEnter 0.5s ease;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ? Stagger Animation ??????? */
.stagger-item {
    opacity: 0;
    animation: staggerFadeIn 0.5s ease forwards;
}

.stagger-item:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-item:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-item:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-item:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-item:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-item:nth-child(6) {
    animation-delay: 0.6s;
}

@keyframes staggerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ? Hover Lift Effect */
.lift-on-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lift-on-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* ? Ripple Effect Global */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple-effect:active::after {
    width: 300px;
    height: 300px;
}


/* ==================== RESPONSIVE ENHANCEMENTS ==================== */

/* ? Extra Small Devices (< 375px) */
@media (max-width: 374px) {

    .btn-primary,
    .btn-yellow,
    .btn-outline {
        width: 100%;
        justify-content: center;
    }

    .nav-actions {
        gap: 0.25rem;
    }

    .btn-icon {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
}

/* ? Small Devices (375px - 576px) */
@media (min-width: 375px) and (max-width: 575px) {
    .hero-brand {
        font-size: clamp(1.8rem, 8vw, 2rem);
    }

    .section-title {
        font-size: clamp(1.5rem, 6vw, 1.75rem);
    }
}

/* ? Medium Devices (576px - 768px) */
@media (min-width: 576px) and (max-width: 767px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ? Large Devices (= 1024px) */
@media (min-width: 1024px) {
    .container {
        max-width: 1400px;
    }

    /* ? Hover Effects ??? ??? Desktop */
    .category-card:hover,
    .product-card:hover {
        transform: translateY(-10px) scale(1.02);
    }
}

/* ? 2XL Devices (= 1536px) */
@media (min-width: 1536px) {
    .container {
        max-width: 1600px;
    }

    .hero-brand {
        font-size: 4rem;
    }

    .section-title {
        font-size: 3rem;
    }
}

/* ? Landscape Orientation */
@media (orientation: landscape) and (max-height: 600px) {
    .hero-slider {
        min-height: 100vh;
    }

    .navbar {
        padding: 0.5rem 0;
    }
}

/* ? Touch Devices */
@media (hover: none) and (pointer: coarse) {

    /* ????? Hover effects ??? Touch */
    .category-card:hover,
    .product-card:hover {
        transform: none;
    }

    /* ????? ??? ????? */
    .category-card:active,
    .product-card:active {
        transform: scale(0.98);
    }

    .btn-primary:active,
    .btn-yellow:active,
    .btn-outline:active {
        transform: scale(0.95);
    }
}


/* ==================== UTILITY CLASSES ==================== */

/* ? Display Utilities */
.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.d-inline-flex {
    display: inline-flex !important;
}

.d-grid {
    display: grid !important;
}

/* ? Flex Utilities */
.flex-row {
    flex-direction: row;
}

.flex-column {
    flex-direction: column;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-around {
    justify-content: space-around;
}

.align-center {
    align-items: center;
}

.align-start {
    align-items: flex-start;
}

.align-end {
    align-items: flex-end;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-5 {
    gap: 1.25rem;
}

.gap-6 {
    gap: 1.5rem;
}

/* ? Text Utilities */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-uppercase {
    text-transform: uppercase;
}

.text-lowercase {
    text-transform: lowercase;
}

.text-capitalize {
    text-transform: capitalize;
}

/* ? Position Utilities */
.position-relative {
    position: relative;
}

.position-absolute {
    position: absolute;
}

.position-fixed {
    position: fixed;
}

.position-sticky {
    position: sticky;
}

/* ? Width & Height Utilities */
.w-full {
    width: 100%;
}

.w-auto {
    width: auto;
}

.h-full {
    height: 100%;
}

.h-auto {
    height: auto;
}

/* ? Overflow Utilities */
.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

.overflow-scroll {
    overflow: scroll;
}

/* ? Visibility Utilities */
.visible {
    visibility: visible;
}

.invisible {
    visibility: hidden;
}

.opacity-0 {
    opacity: 0;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-100 {
    opacity: 1;
}

/* ? Cursor Utilities */
.cursor-pointer {
    cursor: pointer;
}

.cursor-default {
    cursor: default;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

/* ? User Select Utilities */
.select-none {
    user-select: none;
}

.select-all {
    user-select: all;
}

/* ? Pointer Events */
.pointer-events-none {
    pointer-events: none;
}

.pointer-events-auto {
    pointer-events: auto;
}


/* ==================== PRINT STYLES ==================== */

@media print {

    /* ????? ??????? ??? ???????? */
    .navbar,
    .footer,
    .slider-nav,
    .slider-dots,
    .btn-icon,
    .floating-btn,
    .support-floating-btn,
    .support-chat-window,
    .scroll-arrow {
        display: none !important;
    }

    /* ????? ????? */
    body {
        background: white;
        color: black;
    }

    .category-card,
    .product-card {
        page-break-inside: avoid;
        border: 1px solid #000;
    }

    /* ????? ??????? */
    a[href]:after {
        content: ' (' attr(href) ')';
        font-size: 0.8em;
    }

    /* ????? ?????? */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }
}


/* ? Mobile Navbar Fix - Prevent Height Growth */
@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0 !important;
        max-height: 85px;
        /* ????? ???????? */
    }

    .logo img {
        max-height: 40px;
        /* ????? ?????? ?????? */
    }

    .logo-text {
        font-size: 0.9rem;
    }
}


/* ? Guaranteed Content Spacing on Mobile */
@media (max-width: 768px) {
    main {
        /* ???? ????? ??????? ??? ???????? ?????? */
        padding-top: 85px;
    }

    /* ?????? ???????? ??????? ???? ??????? ??? ??? slider ????? ????? */
    body.home-page main {
        padding-top: 0;
        /* ??????? ?????? ?? home.css */
    }
}

/* ? Mobile Buttons Fix - Improved Sizing & Spacing */
@media (max-width: 768px) {
    .nav-actions {
        gap: 0.5rem;
        /* ????? ???? ??? ??????? */
    }

    .btn-icon {
        width: 38px;
        /* ??? ???? */
        height: 38px;
        font-size: 1rem;
        border-radius: 10px;
        border-width: 1.5px;
    }

    /* ?? ??????? */
    .mobile-toggle {
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid var(--border-color);
        /* ????? ???? ????? ??? ???? ??????? */
        border-radius: 10px;
        background: var(--bg-secondary);
        font-size: 1.1rem;
        transition: all 0.3s ease;
    }

    .mobile-toggle:hover {
        background: var(--brand-yellow);
        color: var(--brand-black);
        border-color: var(--brand-yellow);
    }

    /* ????? ?????? (Badge) */
    .cart-badge {
        width: 16px;
        height: 16px;
        font-size: 0.65rem;
        top: -4px;
        right: -4px;
        border: 1px solid var(--navbar-bg);
        /* ????? ???? ?????? ?? ??????? */
    }

    /* ?? ???????? ????? */
    a[href*='profile'].btn-icon {
        padding: 0;
        overflow: hidden;
    }
}

/* Extra Small Screens */
@media (max-width: 375px) {
    .nav-actions {
        gap: 0.25rem;
    }

    .btn-icon,
    .mobile-toggle {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }

    .logo-icon {
        width: 45px;
        height: 45px;
    }

    .logo-text {
        font-size: 0.85rem;
    }
}












/* ==================== MOBILE LARGE CIRCLE BUTTONS ==================== */

@media (max-width: 768px) {
    .nav-actions {
        gap: 0.75rem;
        align-items: center;
    }

    /* Common Button Styles */
    .btn-icon,
    .mobile-toggle {
        width: 46px !important;
        height: 46px !important;
        min-width: 46px !important;
        /* Force width */
        min-height: 46px !important;
        /* Force height */
        border-radius: 50% !important;
        aspect-ratio: 1 / 1;
        /* Ensure perfect square ratio */

        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        /* Prevent squishing */

        -webkit-appearance: none;
        /* Reset mobile browser styles */
        appearance: none;
        margin: 0;
        padding: 0;

        font-size: 1.25rem;
        border: none;
        cursor: pointer;
        transition: transform 0.2s ease, background 0.2s ease;

        /* Clean Flat Design - No Shadows/Effects */
        background: #f1f3f5;
        color: var(--text-primary);
        box-shadow: none !important;
    }

    .btn-icon:active,
    .mobile-toggle:active {
        transform: scale(0.95);
        background: #e9ecef;
    }

    /* Toggle Button - Keep distinct color but remove shadow glow */
    .mobile-toggle {
        background: var(--brand-yellow);
        color: var(--brand-black);
    }

    /* Cart Badge */
    .cart-badge {
        width: 20px;
        height: 20px;
        font-size: 0.75rem;
        border-radius: 50%;
        top: -2px;
        right: -2px;
        background: #ef4444;
        color: white;
        border: 2px solid #fff;
    }

    /* Profile Image Fix */
    a[href*='profile'].btn-icon {
        padding: 0;
        overflow: hidden;
    }

    a[href*='profile'].btn-icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* Ensure sizes stay consistent on very small screens */
@media (max-width: 375px) {
    .nav-actions {
        gap: 0.5rem;
    }

    .btn-icon,
    .mobile-toggle {
        width: 46px !important;
        /* Keep 46px even on small screens */
        height: 46px !important;
        font-size: 1.15rem;
    }
}