/* ===========================
   CSS RESET & BASE STYLES
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #111827;
    background-color: #E3E3E3;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Material Icons Settings */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    user-select: none;
}

.material-symbols-outlined.filled {
    font-variation-settings: 'FILL' 1;
}

/* ===========================
   NAVIGATION / HEADER
   =========================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e7eb;
}

.nav-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 80px;
}

/* LEFT — Logo */
.nav-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background-color: #1F3A5F;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon .material-symbols-outlined {
    font-size: 20px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

/* CENTER — Nav Links */
.nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-link {
    color: #6b7280;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: #1F3A5F;
}

.nav-link.dropdown {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Categories Dropdown */
.categories-dropdown {
    left: 0;
    margin-top: 1rem;
    min-width: 250px;
    padding: 2rem;
}

.dropdown-grid {
    display: grid;
    gap: 2rem;
}

.dropdown-column h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1F3A5F;
    margin-bottom: 0.75rem;
}

.dropdown-column ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dropdown-column ul li a {
    font-size: 0.875rem;
    color: #6b7280;
    transition: color 0.3s;
    display: block;
    padding: 0.25rem 0;
}

.dropdown-column ul li a:hover {
    color: #1F3A5F;
}

/* RIGHT — Icons */
.nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #6b7280;
    position: relative;
}

.icon-btn {
    transition: color 0.3s;
}

.icon-btn:hover {
    color: #1F3A5F;
}

.cart-btn, .wish-btn {
    position: relative;
}

.cart-btn .badgeCount {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background-color: #1F3A5F;
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.wish-btn .badgeCount {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background-color: #1F3A5F;
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}



/* Profile Wrapper and Dropdown */
.profile-wrapper {
    position: relative;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #e5e7eb;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px rgba(31, 58, 95, 0.2);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    min-width: 240px;
    padding: 0;
    overflow: hidden;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.profile-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-header h5 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.profile-header p {
    font-size: 0.75rem;
    color: #6b7280;
}

.profile-dropdown ul {
    padding: 0.5rem;
}

.profile-dropdown ul li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #374151;
    transition: background-color 0.3s;
}

.profile-dropdown ul li a:hover {
    background-color: #f3f4f6;
}

.profile-dropdown ul li a .material-symbols-outlined {
    font-size: 20px;
    color: #6b7280;
}

.user-email {
    max-width: 180px;
    word-break: break-all;
    white-space: normal;
}

/* ===========================
   HAMBURGER BUTTON
   =========================== */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.hamburger-btn:hover {
    background: #f3f4f6;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: #111827;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

/* Animate to X when active */
.hamburger-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===========================
   MOBILE OVERLAY
   =========================== */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.mobile-overlay.show {
    display: block;
    opacity: 1;
}

/* ===========================
   MOBILE DRAWER
   =========================== */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 85vw;
    height: 100dvh;
    background: #fff;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    overflow-y: auto;
}

.mobile-drawer.open {
    transform: translateX(0);
}

/* Drawer header */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}

.drawer-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #6b7280;
    transition: background 0.2s, color 0.2s;
}

.drawer-close:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Drawer profile */
.drawer-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #1F3A5F 0%, #2a4f7a 100%);
    flex-shrink: 0;
}

.drawer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
    background: #e5e7eb;
}

.drawer-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1px;
}

.drawer-email {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    word-break: break-all;
}

/* Drawer nav links */
.drawer-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.drawer-link:hover {
    background: #f9fafb;
    color: #1F3A5F;
}

.drawer-link .material-symbols-outlined {
    font-size: 20px;
    color: #9ca3af;
    flex-shrink: 0;
}

.drawer-link:hover .material-symbols-outlined {
    color: #1F3A5F;
}

/* Drawer accordion */
.drawer-accordion {
    border-bottom: none;
}

.drawer-accordion-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    transition: background 0.15s;
}

.drawer-accordion-btn:hover {
    background: #f9fafb;
    color: #1F3A5F;
}

.drawer-link-inner {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.drawer-link-inner .material-symbols-outlined {
    font-size: 20px;
    color: #9ca3af;
}

.accordion-arrow {
    font-size: 20px !important;
    color: #9ca3af;
    transition: transform 0.25s ease;
}

.drawer-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f9fafb;
}

.drawer-accordion-body.open {
    max-height: 300px;
}

.drawer-sub-link {
    display: block;
    padding: 0.7rem 1.25rem 0.7rem 3.5rem;
    font-size: 0.85rem;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}

.drawer-sub-link:hover {
    color: #1F3A5F;
    background: #eff6ff;
}

/* Drawer footer (auth / quick links) */
.drawer-footer {
    padding: 0.75rem 1rem 1.5rem;
    border-top: 1px solid #f3f4f6;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.drawer-footer-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.drawer-footer-link:hover {
    background: #f3f4f6;
    color: #1F3A5F;
}

.drawer-footer-link .material-symbols-outlined {
    font-size: 18px;
    color: #9ca3af;
}

.drawer-logout {
    color: #dc2626;
}

.drawer-logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

.drawer-logout .material-symbols-outlined {
    color: #dc2626;
}

/* Auth buttons in drawer (guest state) */
.drawer-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    background: #1F3A5F;
    color: #fff;
    transition: background 0.2s;
    margin-top: 0.5rem;
}

.drawer-auth-btn:hover {
    background: #14303f;
}

.drawer-auth-outline {
    background: transparent;
    border: 1.5px solid #1F3A5F;
    color: #1F3A5F;
}

.drawer-auth-outline:hover {
    background: #eff6ff;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 767px) {
    .nav-content {
        grid-template-columns: 1fr auto;
    }

    .nav-center {
        display: none;
    }

    .hamburger-btn {
        display: flex;
    }

    /* Hide login/signup buttons on mobile — drawer has them */
    .nav-actions {
        display: none !important;
    }

    /* Hide profile avatar on mobile — drawer has it */
    .profile-wrapper {
        display: none !important;
    }

    .nav-icons {
        gap: 0.75rem;
    }
}

@media (min-width: 768px) {
    .hamburger-btn {
        display: none !important;
    }

    .mobile-drawer,
    .mobile-overlay {
        display: none !important;
    }
}

/* Very small devices */
@media (max-width: 375px) {
    .nav-content {
        height: 70px;
    }

    .logo-text {
        font-size: 1.125rem;
    }

    .profile-dropdown {
        min-width: 240px;
        right: -0.5rem;
    }
}

/* Extra large devices */
@media (min-width: 1200px) {
    .container {
        padding: 0 2rem;
    }
}

.nav-actions {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.nav-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  padding: 3px 1px;
  background: #0f234f;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  border-radius: 6px;
  transition: 0.3s ease;
}

.nav-auth-btn:hover {
  background: #1b3268;
}
.nav-auth-btn:focus {
  box-shadow: 0 0 0 4px rgba(15, 35, 79, 0.2);
}

.shake-highlight {
  animation: shakeLogin 0.5s ease;
  box-shadow: 0 0 0 4px rgba(15, 35, 79, 0.25);
}

.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.4); /* transparent white */
  backdrop-filter: blur(4px); /* glass effect 🔥 */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 45px;
  height: 45px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top: 4px solid #1F3A5F; /* your theme color */
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shakeLogin {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
  100% { transform: translateX(0); }
}