/* -----------------------------
🌈 GLOBAL THEME VARIABLES
------------------------------ */
:root {
  --color-primary: #ff6600;
  --color-primary-dark: #e55a00;
  --color-secondary: #333333;
  --color-accent: #f4f4f4;

  --color-bg: #fafafa;
  --color-navbar-bg: #ffffff;
  --color-footer-bg: #222222;

  --color-text: #333333;
  --color-text-light: #ffffff;

  --shadow-light: 0 2px 5px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Dark theme */
:root[data-theme="dark"] {
  --color-primary: #ff9800;
  --color-secondary: #f5f5f5;
  --color-bg: #121212;
  --color-text: #f5f5f5;
  --color-navbar-bg: #1e1e1e;
  --color-footer-bg: #000000;
}

/* -----------------------------
🔧 BASIC RESET
------------------------------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

/* Global container class for consistent width */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Ensure all main page sections use this system */
.page-container {
  display: block;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  background: var(--color-bg);
}

/* Smooth link transitions */
a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease, background 0.3s ease;
}

ul {
  list-style: none;
}

/* -----------------------------
🧭 NAVBAR
------------------------------ */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  background: var(--color-navbar-bg);
  box-shadow: var(--shadow-light);
  z-index: 999;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--color-secondary);
}

.logo img {
  height: 42px;
  margin-right: 8px;
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

/* Nav links */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links li a {
  color: var(--color-text);
  font-weight: 500;
  position: relative;
}

.nav-links li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.nav-links li a:hover::after {
  width: 100%;
}

/* Nav icons */
.nav-icons {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: 2rem;
}

.icon-link {
  color: var(--color-text);
  font-size: 1.2rem;
  position: relative;
  transition: color 0.3s ease, transform 0.3s ease;
}

.icon-link:hover {
  color: var(--color-primary);
  transform: translateY(-2px);
}

/* Cart badge */
.cart-icon {
  position: relative;
  display: inline-block;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  background: var(--color-primary);
  color: white;
  font-size: 0.6rem;
  border-radius: 50%;
  padding: 0px 3px;
  font-weight: bold;
}

/* -----------------------------
👤 USER MENU
------------------------------ */
.user-menu {
  position: relative;
}

.user-icon {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text);
  font-weight: 500;
  cursor: pointer;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: 120%;
  right: 0;
  background: var(--color-navbar-bg);
  box-shadow: var(--shadow-light);
  border-radius: 8px;
  padding: 0.5rem 0;
  min-width: 160px;
  z-index: 999;
  animation: fadeIn 0.2s ease-in-out;
}

.user-menu:hover .user-dropdown {
  display: block;
}

.user-dropdown li {
  padding: 0.5rem 1rem;
}

.user-dropdown li a {
  font-size: 0.9rem;
  display: block;
  transition: background 0.3s ease;
}

.user-dropdown li a:hover {
  background: var(--color-accent);
  color: var(--color-primary);
}

.user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* -----------------------------
🍔 HAMBURGER MENU
------------------------------ */
.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 25px;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  content: "";
  display: block;
  width: 25px;
  height: 3px;
  background: var(--color-text);
  border-radius: 3px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-toggle-label span::before {
  top: -8px;
  position: absolute;
}

.nav-toggle-label span::after {
  top: 8px;
  position: absolute;
}

/* Hamburger animation */
.nav-toggle:checked + .nav-toggle-label span {
  background: transparent;
}

.nav-toggle:checked + .nav-toggle-label span::before {
  transform: rotate(45deg);
  top: 0;
}

.nav-toggle:checked + .nav-toggle-label span::after {
  transform: rotate(-45deg);
  top: 0;
}

/* -----------------------------
📱 RESPONSIVE NAV
------------------------------ */
@media (max-width: 768px) {
  .nav-toggle-label {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 65px;
    left: 0;
    right: 0;
    background: var(--color-navbar-bg);
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
    display: none;
    box-shadow: var(--shadow-medium);
    padding: 1.5rem;
  }

  .nav-links {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-icons {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .nav-toggle:checked ~ .nav-menu {
    display: flex;
  }
}

/* -----------------------------
⚓ FOOTER
------------------------------ */
.footer {
  background: var(--color-footer-bg);
  color: var(--color-text-light);
  margin-top: 4rem;
  padding: 3rem 1rem 1rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.footer h3,
.footer h4 {
  margin-bottom: 1rem;
}

.footer p,
.footer a {
  font-size: 0.9rem;
  color: var(--color-text-light);
  opacity: 0.9;
}

.footer-links a:hover {
  color: var(--color-primary);
  opacity: 1;
}

.social-icons a {
  color: var(--color-text-light);
  margin-right: 0.6rem;
  font-size: 1.1rem;
  transition: color 0.3s ease, transform 0.3s ease;
}

.social-icons a:hover {
  color: var(--color-primary);
  transform: translateY(-2px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* -----------------------------
🛒 Floating Cart Button
------------------------------ */
.floating-cart {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: var(--color-primary);
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-medium);
  z-index: 9999;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.floating-cart:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

/* Badge for Floating Cart */
#floating-cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ffffff;
  color: var(--color-primary);
  font-size: 0.8rem;
  height: 20px;
  min-width: 20px;
  padding: 0 5px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  box-shadow: var(--shadow-light);
}

/* Subtle fade animation for dropdowns */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .floating-cart {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    bottom: 20px;
    right: 20px;
  }

  #floating-cart-badge {
    height: 18px;
    min-width: 18px;
    font-size: 0.7rem;
  }
}
