/* ===== VARIABLES CSS ===== */
:root {
  /* Colores principales según Castelli Brand Guidelines */
  --castelli-red: #e51e2b; /* PANTONE 485 C / CMYK 10/100/100/0 */
  --castelli-gray: #585858; /* PANTONE COOL GRAY 11 C / CMYK 0/0/0/80 */
  --castelli-white: #ffffff;
  --castelli-black: #000000;

  /* Tipografía */
  --font-primary: "Oswald", "Arial Narrow", sans-serif; /* Secondary typeface para web */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-semibold: 600;

  /* Espaciado */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-xxl: 4rem;

  /* Tamaños de fuente */
  --font-size-small: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;
  --font-size-5xl: 3rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-light);
  line-height: 1.6;
  color: var(--castelli-gray);
  background-color: var(--castelli-white);
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

.header {
  background: var(--castelli-white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: relative;
  width: 100%;
  top: auto;
  z-index: 1000;
  opacity: 1;
  backdrop-filter: none;
}

.top-banner {
  background: #000;
  color: #fff;
  text-align: center;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  flex-shrink: 0;
  height: 50px;
  display: flex;
  align-items: center;
}

.logo a {
  display: block;
  height: 100%;
}

.logo img {
  height: 100%;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
  margin: 0;
}

.nav-menu li a {
  text-decoration: none;
  color: #585858;
  font-weight: bold;
  transition: color 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
  padding: 1rem 0;
  display: block;
}

.nav-menu li a:hover,
.nav-menu li a.active {
  color: #e31e24;
}

.hero {
  margin: 0;
}

/* Cart and User Icons */
.nav-icons {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-icon {
  position: relative;
  color: #585858;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.3s;
}

.nav-icon:hover {
  background: rgba(227, 30, 36, 0.1);
  color: #e31e24;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e31e24;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Mini Cart Dropdown */
.cart-dropdown {
  position: absolute;
  top: 100%;
  right: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  width: 350px;
  max-height: 500px;
  z-index: 1000;
  overflow: hidden;
}

.cart-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #eee;
  background: #f9f9f9;
}

.cart-dropdown-header h4 {
  margin: 0;
  color: #585858;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cart-dropdown-header button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #777;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
}

.cart-dropdown-header button:hover {
  background: #e31e24;
  color: white;
}

.cart-dropdown-items {
  max-height: 300px;
  overflow-y: auto;
  padding: 1rem;
}

.cart-loading {
  text-align: center;
  padding: 2rem;
  color: #777;
}

.cart-dropdown-footer {
  padding: 1rem;
  border-top: 1px solid #eee;
  background: #f9f9f9;
}

.cart-total {
  font-weight: bold;
  font-size: 1.1rem;
  color: #585858;
  margin-bottom: 1rem;
  text-align: center;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-full {
  width: 100%;
}

/* Mobile Menu Toggle */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: #585858;
  margin: 3px 0;
  transition: 0.3s;
}

/* ========================================
   GLOBAL LAYOUT ELEMENTS
   ======================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.main-content {
  margin-top: 140px;
  padding: 2rem;
}

/* ========================================
   TYPOGRAPHY (Following Castelli Manual)
   ======================================== */

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: #585858;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.page-title {
  font-size: 3rem;
  color: #585858;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 1rem;
}

.page-subtitle {
  font-size: 1.2rem;
  color: #585858;
  margin-bottom: 1rem;
  font-weight: 300;
}

.page-subtitle::after {
  content: " —";
  color: #e31e24;
  font-weight: bold;
}

/* ========================================
   BUTTONS (Castelli Style)
   ======================================== */

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: #e31e24;
  color: white;
}

.btn-primary:hover {
  background: #b51a1d;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(227, 30, 36, 0.3);
}

.btn-secondary {
  background: #585858;
  color: white;
}

.btn-secondary:hover {
  background: #404040;
  transform: translateY(-2px);
}

.btn-small {
  padding: 10px 18px;
  font-size: 0.9rem;
}

.cta-button {
  display: inline-block;
  background: #e31e24;
  color: white;
  padding: 18px 35px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background 0.3s;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.9rem;
}

.cta-button:hover {
  background: #b51a1d;
}

/* ========================================
   PRODUCT CARDS
   ======================================== */

.category-grid,
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
}

.category-card,
.product-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.category-card:hover,
.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(227, 30, 36, 0.2);
}

.category-image,
.product-image {
  height: 250px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.product-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: #e31e24;
  color: white;
  padding: 8px 12px;
  border-radius: 15px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(227, 30, 36, 0.3);
}

.category-info,
.product-info {
  padding: 1.5rem;
}

.category-info h3,
.product-name {
  font-size: 1.3rem;
  font-weight: bold;
  color: #585858;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.category-info p,
.product-description {
  color: #777;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.category-price,
.product-price {
  font-size: 1.2rem;
  font-weight: bold;
  color: #e31e24;
}

.product-category {
  color: #e31e24;
  font-size: 0.85rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.product-actions {
  display: flex;
  gap: 0.5rem;
}

/* ========================================
   FORMS & FILTERS
   ======================================== */

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #585858;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.filter-group select,
.filter-group input {
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s;
  background: white;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: #e31e24;
}

/* ========================================
   LOADING STATES
   ======================================== */

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  font-size: 1.2rem;
  color: #777;
}

.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #e31e24;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-right: 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  background: #222;
  color: white;
  padding: 40px 2rem 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  margin-bottom: 1rem;
  color: #e31e24;
}

.footer-section a {
  color: #ccc;
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
  transition: color 0.3s;
}

.footer-section a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #444;
  color: #ccc;
}

/* ========================================
   HOME PAGE SPECIFIC STYLES
   ======================================== */

/* Hero Section */
.hero {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  margin: 0;
  overflow: hidden;
}

.hero-carousel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin: 0;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  max-width: 600px;
  font-weight: 300;
}

/* Categories Section */
.categories {
  padding: 80px 2rem;
  background: #f5f5f5;
}

/* Featured Products Section */
.featured-products {
  padding: 80px 2rem;
  background: #f5f5f5;
}

.loading-message,
.error-message {
  text-align: center;
  padding: 2rem;
  color: var(--castelli-gray);
  font-size: 1.2rem;
  grid-column: 1/-1;
}

.error-message {
  color: var(--castelli-red);
}

/* Features Section */
.features {
  padding: 80px 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  text-align: center;
}

.feature {
  padding: 2rem;
}

.feature-icon {
  width: 80px;
  height: 80px;
  background: #e31e24;
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
}

.feature h3 {
  color: #585858;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
}

.feature p {
  color: #777;
  line-height: 1.6;
}

/* Newsletter */
.newsletter {
  background: #333;
  color: white;
  padding: 60px 2rem;
  text-align: center;
}

.newsletter h2 {
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 2rem;
}

.newsletter p {
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.newsletter-form {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.newsletter-form input {
  padding: 12px 20px;
  border: none;
  border-radius: 5px;
  min-width: 300px;
  font-size: 1rem;
}

.newsletter-form button {
  padding: 12px 25px;
  background: #e31e24;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
}

.newsletter-form button:hover {
  background: #b51a1d;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(227, 30, 36, 0.3);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: #e31e24;
  display: block;
}

.stat-label {
  color: #585858;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
  font-weight: bold;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    left: -100%;
    top:  140px;
    flex-direction: column;
    background-color: white;
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    padding: 2rem 0;
    gap: 0;
    z-index: 200;
  }

  .nav-menu.active {
    left: 0;
  }

  .featured-products {
    grid-template-columns: 1fr;
  }

  .navbar {
    padding: 1rem;
  }

  .nav-icons {
    order: -1;
  }

  .main-content {
    padding: 1rem;
  }

  .page-title {
    font-size: 2rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .category-grid,
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  /* Home page mobile styles */
  .hero-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content img {
    height: 60px;
  }

  .newsletter-form {
    flex-direction: column;
    align-items: center;
  }

  .newsletter-form input {
    min-width: 100%;
    max-width: 400px;
  }
}
/* ===== QUANTITY CONTROLS ===== */
.quantity-section {
  margin: 1rem 0;
  padding: 0.5rem 0;
  border-top: 1px solid #eee;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-btn {
  width: 35px;
  height: 35px;
  border: 2px solid var(--castelli-red);
  background: white;
  color: var(--castelli-red);
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.quantity-btn:hover {
  background: var(--castelli-red);
  color: white;
}

.quantity-btn:active {
  transform: scale(0.95);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .quantity-controls {
    justify-content: center;
    margin: 0.5rem 0;
  }

  .quantity-btn {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }
}

/* Estilos para botones de tallas en las cards */
.product-card .sizes button {
  transition: all 0.2s ease !important;
  margin: 0.2rem !important;
  padding: 0.4rem 0.8rem !important;
  border: 1px solid #ccc !important;
  background: white !important;
  cursor: pointer !important;
  border-radius: 5px !important;
  font-size: 0.8rem !important;
  color: #333 !important;
}

.product-card .sizes button:hover {
  background: #f8f9fa !important;
  border-color: #999 !important;
}

.product-card .sizes button.active {
  background: #e60023 !important;
  color: #ffffff !important;
  border-color: #e60023 !important;
  font-weight: bold !important;
}
