:root {
  --color-primary: #e50914;
  --dark-red: #d32f2f;
  --color-secondary: #000000;
  --color-light: #f8f9fa;
  --color-gray: #6c757d;
  --border-radius: 12px;
}

body {
  font-family: "Poppins", sans-serif;
  color: #333;
  padding-top: 120px;
  /* Para compensar el header fijo */
}

/* Header Styles */
.top-header {
  background-color: var(--color-primary);
  padding: 15px 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo {
  font-weight: 700;
  font-size: 1.8rem;
  color: white;
  text-decoration: none;
}

.search-form {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.search-input {
  border-radius: 50px;
  padding: 10px 20px;
  border: none;
  width: 100%;
}

.search-btn {
  position: absolute;
  right: 5px;
  top: 5px;
  background: var(--color-secondary);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 5px 15px;
}

.header-icons a {
  color: white;
  font-size: 1.2rem;
  margin-left: 15px;
}

.secondary-nav {
  background-color: var(--color-secondary);
  padding: 20px 20px 12px 0px;
  position: fixed;
  top: 73px;
  left: 0;
  right: 0;
  z-index: 1029;
}

.secondary-nav a {
  color: white;
  text-decoration: none;
  margin-right: 20px;
  font-size: 1em;
}

/* Offcanvas Menu Styles */
.offcanvas-start {
  flex-direction: row;
  width: 800px;
  background-color: transparent;
}
.offcanvas-side {
  background-color: var(--color-secondary);
  color: white;
}

.offcanvas-header {
  border-bottom: 1px solid #333;
}

.offcanvas-title {
  font-weight: 600;
}

.side-header-box {
  background-color: var(--color-primary);
  border-bottom-right-radius: 4rem;
}

.custom-rounded {
  border-top-right-radius: 2rem; /* arriba derecha */
  border-bottom-right-radius: 2rem; /* abajo derecha */
}

.category-item {
  padding: 12px 15px;
  border-bottom: 1px solid #333;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s;
}

.category-item:hover {
  background-color: #333;
}

.mega-panel {
  width: 800px;
  background-color: var(--color-secondary);
  color: white;
}

/* Hero Banner */
.hero-banner {
  height: 350px;
  border-radius: var(--border-radius);
  margin: 20px 0;
  overflow: hidden;
  position: relative;
}

.carousel-item {
  height: 350px;
  background-size: cover;
  background-position: center;
}

.hero-content {
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 25px;
  border-radius: var(--border-radius);
  max-width: 500px;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.btn-primary-custom {
  /*.add-to-cart-btn {*/
  background: linear-gradient(
    90deg,
    var(--color-primary) 0%,
    var(--dark-red) 100%
  );
  border: none;
  border-radius: 50px;
  padding: 5px 20px;
  font-weight: 600;
  color: var(--color-light);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 50%;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.btn-primary-custom::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: all 0.6s;
}

.btn-primary-custom:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(229, 57, 53, 0.5);
}

.btn-primary-custom:hover::before {
  left: 50%;
}

.carousel-control-prev,
.carousel-control-next {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.7;
}

.carousel-control-prev {
  left: 15px;
}

.carousel-control-next {
  right: 15px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  opacity: 0.9;
}

.carousel-indicators {
  margin-bottom: 20px;
}

.carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 5px;
}

/* Categories Section */
.categories-section {
  padding: 40px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  /*overflow-x: auto; /* Para permitir scroll en móvil si es necesario */
}

.category-card-wrapper {
  flex: 0 0 calc(12.5% - 15px); /* 8 elementos: 100% / 8 = 12.5% */
  max-width: calc(12.5% - 15px);
  margin: 0 7.5px;
  text-decoration: none;
}

.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05),
    0 1px 2px rgba(255, 255, 255, 0.3) inset;
  transition: all 0.3s ease;
  padding: 15px 10px;
  text-align: center;
  height: 100%;
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1),
    0 2px 4px rgba(255, 255, 255, 0.4) inset;
  border-color: var(--color-primary);
}

.category-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #ff3c3c 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  box-shadow: 0 4px 8px rgba(229, 9, 20, 0.2);
  transition: all 0.3s ease;
}

.glass-card:hover .category-icon {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(229, 9, 20, 0.3);
}

.glass-card h5 {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0;
  color: #333;
  line-height: 1.3;
}

/* Responsive adjustments */
@media (max-width: 1199px) {
  .category-card-wrapper {
    flex: 0 0 calc(25% - 15px); /* 4 por fila en tablets */
    max-width: calc(25% - 15px);
  }
}

@media (max-width: 767px) {
  .category-card-wrapper {
    flex: 0 0 calc(33.333% - 15px); /* 3 por fila en móviles */
    max-width: calc(33.333% - 15px);
  }

  .glass-card {
    padding: 12px 8px;
  }

  .category-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    margin-bottom: 8px;
  }

  .glass-card h5 {
    font-size: 0.7rem;
  }
}

@media (max-width: 575px) {
  .category-card-wrapper {
    flex: 0 0 calc(50% - 15px); /* 2 por fila en móviles pequeños */
    max-width: calc(50% - 15px);
  }
}

/* Products Section */
.products-section {
  padding: 40px 0;
  background-color: var(--color-light);
  position: relative;
}

.section-title {
  font-weight: 600;
  margin-bottom: 25px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 50px;
  height: 3px;
  background-color: var(--color-primary);
}

.view-all {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
}

.product-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: all 0.3s;
  margin-bottom: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  height: 100%;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.product-card-codigo {
  color: #999;
  font-size: 14px;
}

.product-img {
  height: 180px;
  object-fit: contain;
  padding: 15px;
}

.badge {
  top: 10px;
  left: 10px;
  color: white;
  padding: 5px 10px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge-success {
  background-color: #5cb85c;
}
.badge-warning {
  background-color: #f0ad4e;
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--color-primary);
  color: white;
  padding: 5px 10px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
}

.favoritos-badge {
  position: absolute;
  background-color: var(--color-light);
  top: 10px;
  right: 10px;
  color: #bdbdbd;
  padding: 5px 8px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

.favoritos-badge:hover {
  background-color: var(--color-gray);
  color: var(--color-light);
}

.product-price {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-secondary);
}

.product-old-price {
  text-decoration: line-through;
  color: var(--color-gray);
  font-size: 0.9rem;
}

.add-to-cart-btn {
  background: linear-gradient(
    90deg,
    var(--color-primary) 0%,
    var(--dark-red) 100%
  );
  border: none;
  border-radius: 50px;
  padding: 5px 20px;
  font-weight: 600;
  color: var(--color-light);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.add-to-cart-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: all 0.6s;
}
.login-open-btn {
  display: inline-block; /* hace que <a> se comporte como botón */
  background-color: var(--color-primary);
  color: white;
  border: none; /* no aplica a <a>, pero lo dejamos por consistencia */
  border-radius: 50px;
  padding: 8px 15px;
  font-size: 0.9rem;
  transition: all 0.3s;
  width: 100%;
  cursor: pointer;
  text-align: center; /* centra el texto */
  text-decoration: none;
}

.add-to-cart-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(229, 57, 53, 0.5);
}

.add-to-cart-btn:hover::before {
  left: 100%;
}

/* Slider Navigation */
.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 10;
  cursor: pointer;
  transition: all 0.3s;
}

.slider-nav:hover {
  background: var(--color-primary);
  color: white;
}

.slider-nav.prev {
  left: -20px;
}

.slider-nav.next {
  right: -20px;
}

/* Footer */
footer {
  background-color: var(--color-secondary);
  color: white;
  padding: 50px 0 20px;
}

.footer-title {
  font-weight: 600;
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.footer-links a {
  display: block;
  color: #ccc;
  text-decoration: none;
  margin-bottom: 10px;
  transition: all 0.3s;
}

.footer-links a:hover {
  color: white;
  padding-left: 5px;
}

.social-icons a {
  color: white;
  font-size: 1.5rem;
  margin-right: 15px;
  transition: all 0.3s;
}

.social-icons a:hover {
  color: var(--color-primary);
  transform: translateY(-3px);
}

/* Responsive Styles */
@media (min-width: 768px) {
  .hero-banner,
  .carousel-item {
    height: 450px;
  }

  .hero-content {
    left: 50px;
  }
}

@media (min-width: 992px) {
  .hero-banner,
  .carousel-item {
    height: 500px;
  }

  .mega-panel {
    width: 800px;
  }

  .category-card {
    padding: 8px;
  }

  .category-img {
    height: 70px;
  }

  .category-card h5 {
    font-size: 0.8rem;
  }
}

@media (max-width: 767px) {
  body {
    padding-top: 110px;
  }

  .secondary-nav {
    top: 63px;
    overflow-x: auto;
  }

  .secondary-nav a {
    display: inline-block;
  }

  .header-icons a {
    margin-left: 10px;
    font-size: 1.1rem;
  }

  .search-form {
    margin: 10px auto;
  }

  .category-img {
    height: 70px;
  }

  .slider-nav {
    display: none;
  }

  .hero-content {
    left: 15px;
    right: 15px;
    max-width: none;
    padding: 15px;
  }

  .hero-content h2 {
    font-size: 1.5rem;
  }

  .hero-content p {
    font-size: 0.9rem;
  }
}

/* Estilos para el carrito en español */
.cart-trigger {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--color-secondary);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  max-width: 400px;
  background-color: white;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.cart-drawer.active {
  transform: translateX(0);
  opacity: 1;
}

.cart-header {
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.cart-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.cart-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-secondary);
  padding: 0.25rem;
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 1.5rem;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 2rem;
}

.cart-empty-icon {
  font-size: 3rem;
  color: #ddd;
  margin-bottom: 1rem;
}

.cart-item {
  display: flex;
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-right: 1rem;
  flex-shrink: 0;
}

.cart-item-details {
  flex: 1;
}

.cart-item-name {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 0.25rem;
  line-height: 1;
}

.cart-item-variant {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.cart-item-price {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 0.5rem;
}

.cart-item-actions {
  display: flex;
  justify-content: space-between;
  align-items: last baseline;
}

.cart-item-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.quantity-control {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.quantity-btn {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-secondary);
}

.quantity-input {
  width: 40px;
  height: 32px;
  border: none;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  text-align: center;
  -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.remove-item {
  background-color: var(--color-primary);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 100%;
}

.remove-item:hover {
  background-color: var(--color-secondary);
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid #eee;
  background-color: white;
  position: sticky;
  bottom: 0;
}

.discount-form {
  flex: 1;
  display: flex;
  margin-bottom: 1rem;
}

.discount-input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px 0 0 4px;
  border-right: none;
}

.discount-apply {
  background-color: var(--color-secondary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.discount-feedback {
  font-size: 0.85rem;
  margin-top: 0.25rem;
  min-height: 1.2rem;
}

.discount-valid {
  color: #28a745;
}

.discount-invalid {
  color: var(--color-primary);
}

.cart-summary {
  margin-bottom: 1rem;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.summary-total {
  font-weight: 600;
  font-size: 1.1rem;
  border-top: 1px solid #eee;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .cart-actions {
    /*flex-direction: row;*/
  }
}

.btn-checkout {
  background: linear-gradient(
    90deg,
    var(--color-primary) 0%,
    var(--dark-red) 100%
  );
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  text-align: center;
  text-decoration: none;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 500;
  flex: 1;
  border-radius: 50px;
  cursor: pointer;
}

.btn-checkout:hover {
  background-color: #c10600;
}

.btn-continue {
  background-color: var(--color-secondary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  flex: 1;
  border-radius: 50px;
  cursor: pointer;
}

.btn-continue:hover {
  background-color: #111;
}

.cart-item.removing {
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.2s ease, transform 0.3s ease;
}

@media (max-width: 575px) {
  .cart-drawer {
    max-width: 100%;
  }

  .cart-item {
    flex-direction: column;
  }

  .cart-item-image {
    width: 100%;
    height: auto;
    max-height: 150px;
    margin-right: 0;
    margin-bottom: 1rem;
  }

  .cart-item-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .remove-item {
    align-self: flex-end;
  }
}

.add-to-cart-animation {
  animation: addToCart 0.5s ease;
}

@keyframes addToCart {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.slider-item {
  text-decoration: none;
  color: inherit;
}

.option-label {
  font-size: 14px;
  color: #333;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.categoria_link {
  font-size: 13px;
  color: #333;
  color: inherit;
  cursor: pointer;
}

.loader-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(194, 194, 194, 0.4);
  /* Fondo semitransparente */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  /* Z-index alto para que esté por encima de otros elementos */
}

/* LOADER CONTAINER 2 */
.loader-container2 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(194, 194, 194, 0.01);
  /* Fondo semitransparente */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  /* Z-index alto para que esté por encima de otros elementos */
}

.spinner {
  margin: 100px auto 0;
  width: 70px;
  text-align: center;
}

.spinner > div {
  width: 18px;
  height: 18px;
  background-color: #333;
  border-radius: 100%;
  display: inline-block;
  -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
  animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.spinner .bounce1 {
  -webkit-animation-delay: -0.32s;
  animation-delay: -0.32s;
}

.spinner .bounce2 {
  -webkit-animation-delay: -0.16s;
  animation-delay: -0.16s;
}

@-webkit-keyframes sk-bouncedelay {
  0%,
  80%,
  100% {
    -webkit-transform: scale(0);
  }

  40% {
    -webkit-transform: scale(1);
  }
}

@keyframes sk-bouncedelay {
  0%,
  80%,
  100% {
    -webkit-transform: scale(0);
    transform: scale(0);
  }

  40% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}

.marca-slider-item {
  width: 20%;
  height: 100px;
}

/* Pantallas medianas (ej: tablets) */
@media (max-width: 992px) {
  .marca-slider-item {
    width: 25%;
  }
}

/* Pantallas pequeñas (ej: móviles) */
@media (max-width: 768px) {
  .marca-slider-item {
    width: 50%;
  }
}

/* Page Header */
.page-header {
  margin-bottom: 30px;
  text-align: center;
}

.page-title {
  font-weight: 700;
  color: var(--color-secondary);
  position: relative;
  padding-bottom: 15px;
  margin-bottom: 15px;
}

.page-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 4px;
  background-color: var(--color-primary);
  border-radius: 2px;
}
