/* ========================================
   VARIABLES GLOBALES - CNC CAMPAS
   ======================================== */
:root {
  --brown-primary: #6b4423;
  --brown-dark: #4a2f1a;
  --beige: #d4a574;
  --beige-light: #e8c9a0;
  --green: #3d5a3c;
  --green-dark: #2a3f29;
  --white: #ffffff;
  --gray: #f5f5f5;
  --gray-dark: #2c2c2c;
  --orange: #ff6b35;
  --red: #c1121f;
}

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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  overflow-x: hidden;
  background: var(--gray);
}

/* ========================================
   HEADER ESTANDARIZADO
   ======================================== */
header {
  background: white;
  padding: 1.5rem 5%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  height: 60px;
  cursor: pointer;
}

nav {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  font-size: 1.1rem;
  transition: color 0.3s;
  position: relative;
}

nav a:hover {
  color: var(--brown-primary);
}

nav a.active {
  color: var(--brown-primary);
  font-weight: 600;
}

nav a.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--brown-primary);
  border-radius: 2px;
}

.header-icons {
  display: flex;
  gap: 1rem;
  align-items: center;
  position: relative;
  z-index: 50;
}

.icon-btn {
  width: 50px;
  height: 50px;
  background: #243977;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #ffffff;
  transition: all 0.3s;
  position: relative;
  overflow: visible;
}

.icon-btn:hover {
  background: var(--beige);
  transform: scale(1.05);
}

.cart-count {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #ef4444;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 50%;
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 100;
  pointer-events: none;
}

/* ========================================
   MENÚ DE USUARIO
   ======================================== */
.user-menu-container {
  position: relative;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  min-width: 220px;
  z-index: 1000;
  overflow: hidden;
  display: none;
}

.user-dropdown.show {
  display: block;
  animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-info {
  padding: 1rem;
  background: linear-gradient(
    135deg,
    var(--brown-dark) 0%,
    var(--brown-primary) 100%
  );
  color: white;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.user-info i {
  font-size: 1.5rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  color: var(--gray-dark);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 500;
}

.dropdown-item:hover {
  background: #f8fafc;
  color: var(--brown-primary);
}

.dropdown-item i {
  font-size: 1.1rem;
  width: 20px;
}

.dropdown-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 0.5rem 0;
}

.logout-btn {
  color: #ef4444;
  font-weight: 600;
}

.logout-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* ========================================
   CONTENIDO PRINCIPAL
   ======================================== */
.main-content {
  margin-top: 120px;
  min-height: calc(100vh - 120px);
  padding: 2rem 5%;
}

/* ========================================
   BOTONES GLOBALES
   ======================================== */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: #2b4b8c;
  color: white;
}

.btn-primary:hover {
  background: #2b4b8c77;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: var(--green);
  color: white;
}

.btn-secondary:hover {
  background: var(--green-dark);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--brown-dark);
  color: var(--brown-dark);
}

.btn-outline:hover {
  background: var(--brown-dark);
  color: white;
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-4px);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  header {
    padding: 1rem 3%;
  }

  .logo {
    height: 45px;
  }

  nav {
    display: none;
  }

  .header-icons {
    gap: 0.5rem;
  }

  .icon-btn {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }

  .main-content {
    margin-top: 80px;
    padding: 1rem 3%;
  }
}

/* HAMBURGER BUTTON */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  align-self: center;
}

.hamburger span {
  display: block;
  height: 4px;
  width: 100%;
  background: var(--brown-primary);
  border-radius: 2px;
}
.mobile-user-menu {
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
  width: 100%;
  align-items: center;
}

.mobile-user-menu a,
.logout-mobile {
  text-decoration: none;
  color: var(--brown-dark);
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
}

/* SOLO DESKTOP */
.desktop-only {
  display: block;
}

/* MOBILE MENU */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0;
    display: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  }

  nav.active {
    display: flex;
  }

  .mobile-user-menu {
    display: flex;
  }
}

@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }
}
