:root { 
  --primary: #20A9FF; 
  --primary-dark: #0B4D7A; 
  --secondary: #00C9A7; 
  --dark: #111118; 
  --light: #F5FBFF; 
  --accent: #00C853;
  --gradient-start: #20A9FF;
  --gradient-end: #00C9A7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, 'Inter', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: var(--dark);
  background: var(--light);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(32, 169, 255, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.navbar img {
  height: 170px;
  width: auto;
}

.navlinks {
  display: flex;
  gap: 0.5rem;
}

.navlinks a {
  padding: 0.625rem 1rem;
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.navlinks a:hover {
  background: linear-gradient(135deg, rgba(32, 169, 255, 0.1), rgba(0, 201, 167, 0.1));
  color: var(--primary);
  transform: translateY(-2px);
}

/* Hero Section */
.hero {
  position: relative;
  background: linear-gradient(135deg, 
    rgba(32, 169, 255, 0.9) 0%, 
    rgba(11, 77, 122, 0.85) 50%, 
    rgba(0, 201, 167, 0.9) 100%
  );
  padding: 100px 0 80px;
  min-height: 500px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0, 201, 167, 0.2) 0%, transparent 50%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
  color: white;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  margin: 0.75rem 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.hero .subtitle {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: rgba(255, 255, 255, 0.95);
  margin: 1rem 0 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cta {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1a8fd9 0%, #094066 100%);
}

.btn-outline {
  border: 2px solid rgba(255, 255, 255, 0.8);
  color: white;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: white;
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25D366 0%, var(--accent) 100%);
  color: #fff;
}

.btn-whatsapp:hover {
  background: linear-gradient(135deg, #20BA5A 0%, #00A843 100%);
}

.btn-secondary {
  background: #e5e7eb;
  color: var(--dark);
}

.btn-secondary:hover {
  background: #d1d5db;
}

/* Sections */
.section {
  padding: 80px 0;
}

.section h2 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  color: var(--primary-dark);
  margin: 0 0 3rem;
  text-align: center;
  font-weight: 700;
}

/* Grid */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Cards */
.card {
  background: #fff;
  border: 1px solid rgba(32, 169, 255, 0.1);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(32, 169, 255, 0.2);
  border-color: var(--primary);
}

.card:hover::before {
  transform: scaleX(1);
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.card h3 {
  margin: 1rem 0 0.5rem;
  color: var(--primary-dark);
  font-size: 1.25rem;
  font-weight: 700;
}

.card p {
  color: #6b7280;
  margin: 0.5rem 0;
  line-height: 1.6;
}

/* Footer */
footer {
  background: linear-gradient(135deg, #0a1929 0%, var(--primary-dark) 100%);
  color: #b7c7d6;
  padding: 48px 0;
  margin-top: 80px;
}

footer a {
  color: #d9ecff;
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--secondary);
}

/* Cart Table Styles */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.cart-table th,
.cart-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(32, 169, 255, 0.1);
}

.cart-table th {
  background: linear-gradient(135deg, rgba(32, 169, 255, 0.1), rgba(0, 201, 167, 0.1));
  color: var(--primary-dark);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.cart-table tr:last-child td {
  border-bottom: none;
}

.cart-table tbody tr {
  transition: background 0.3s ease;
}

.cart-table tbody tr:hover {
  background: rgba(32, 169, 255, 0.02);
}

.cart-row-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.cart-row-actions button {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

.totals {
  margin-top: 2rem;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary-dark);
  text-align: right;
}

.actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.empty {
  padding: 3rem;
  background: linear-gradient(135deg, rgba(32, 169, 255, 0.05), rgba(0, 201, 167, 0.05));
  border: 2px dashed rgba(32, 169, 255, 0.2);
  border-radius: 16px;
  text-align: center;
  color: #6b7280;
  font-size: 1.1rem;
}

.status {
  margin-top: 1rem;
  color: #6b7280;
  font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .hero {
    padding: 80px 0 60px;
    min-height: 400px;
  }
  
  .cta {
    flex-direction: column;
  }
  
  .cta .btn {
    width: 100%;
  }
}

/* Hamburger Menu Button */
/* Note: Mobile breakpoint is set at 768px - update both @media queries if changed */
#hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--primary);
  transition: all 0.3s ease;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

#hamburger:hover {
  color: var(--primary-dark);
  transform: scale(1.1);
}

#hamburger:active {
  transform: scale(0.95);
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
  #hamburger {
    display: flex;
  }
  
  .navlinks {
    position: fixed;
    top: 70px;
    right: 0;
    background: white;
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem 0;
    gap: 0;
    z-index: 999;
  }
  
  .navlinks.active {
    transform: translateX(0);
  }
  
  .navlinks a {
    padding: 1rem 1.5rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(32, 169, 255, 0.1);
    font-size: 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  .navlinks a:last-child {
    border-bottom: none;
  }
  
  .navlinks a:hover {
    background: linear-gradient(135deg, rgba(32, 169, 255, 0.1), rgba(0, 201, 167, 0.1));
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .navbar img {
    height: 56px;
  }
  
  .navbar .inner {
    height: 60px;
  }
  
  .navlinks {
    top: 60px;
  }
  
  .hero {
    padding: 60px 0 40px;
  }
  
  .section {
    padding: 60px 0;
  }
  
  .cart-table {
    font-size: 0.85rem;
  }
  
  .cart-table th,
  .cart-table td {
    padding: 0.75rem 0.5rem;
  }
  
  .actions {
    flex-direction: column;
  }
  
  .actions button {
    width: 100%;
  }
}

/* ================= FLOATING CART BADGE ================= */
#cart-badge {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#cart-badge a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(32, 169, 255, 0.4);
  color: white;
  position: relative;
  transition: all 0.3s ease;
}

#cart-badge a:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(32, 169, 255, 0.6);
}

#cart-badge a:active {
  transform: scale(0.95);
}

/* Badge count (red circle) */
.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
  border: 2px solid white;
}

/* Show count when badge has items */
#cart-badge.has-items .badge-count {
  display: flex;
}

/* Bounce animation */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  25% {
    transform: translateY(-10px) scale(1.1);
  }
  50% {
    transform: translateY(0) scale(1);
  }
  75% {
    transform: translateY(-5px) scale(1.05);
  }
}

#cart-badge.bounce {
  animation: bounce 0.6s ease;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  #cart-badge {
    bottom: 16px;
    right: 16px;
  }
  
  #cart-badge a {
    width: 56px;
    height: 56px;
  }
  
  #cart-badge a svg {
    width: 28px;
    height: 28px;
  }
  
  .badge-count {
    min-width: 22px;
    height: 22px;
    font-size: 0.7rem;
  }
}

/* Extra padding on cart page so floating badge doesn't overlap content.
   Target only the section container, NOT the navbar container, to avoid
   breaking the navbar height (which uses box-sizing: border-box + height: 70px). */
body[data-page="carrito"] .section > .container {
  padding-bottom: 120px;
}

@media (max-width: 768px) {
  /* On mobile, account for iOS browser chrome (home indicator ~34px,
     browser bar ~50px) on top of the 56px badge + 16px gap. */
  body[data-page="carrito"] .section > .container {
    padding-bottom: 160px;
  }
}
