/* ========================================
   PÁGINA DEL CARRITO - LAYOUT PRINCIPAL
   ======================================== */

.site-header {
  width: 100%;
  padding: 20px 0;
  position: relative;
  z-index: 100;
  background: #1a171c;
}

.cart-page {
  min-height: 100vh;
  background: #1a171c;
  padding-top: 80px;
  font-family: "Oswald", Helvetica;
}

.cart-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 30px;
  align-items: start;
}

.cart-main {
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.cart-sidebar {
  position: sticky;
  top: 100px;
}

/* ========================================
   HEADER DEL CARRITO
   ======================================== */

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.cart-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #2d3436;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-header h1 i {
  color: #667eea;
}

.btn-clear-cart {
  background: #ff6b6b;
  color: white;
  border: none;
  font-family: "Bebas Neue", Helvetica;
  font-size: 20px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;

}

.btn-clear-cart:hover {
  background: #ff5252;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* ========================================
   ITEMS DEL CARRITO
   ======================================== */

#cartItems {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cart-item {
  display: grid;
  grid-template-columns: 100px 1fr auto auto auto;
  gap: 20px;
  align-items: center;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.cart-item:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

/* Imagen del producto */
.cart-item-image {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Información del producto */
.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-item-name {
  font-size: 18px;
  font-weight: 600;
  color: #2d3436;
  margin: 0;
  line-height: 1.4;
}

.cart-item-price {
  font-size: 20px;
  font-weight: 700;
  color: #667eea;
  margin: 0;
}

.cart-item-stock {
  font-size: 13px;
  color: #636e72;
  margin: 0;
}

/* Controles de cantidad */
.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 8px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  font-family: "Oswald", Helvetica;
}


.btn-qty {
  width: 32px;
  height: 32px;
  border: none;
  background: #667eea;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 14px;
}

.btn-qty:hover {
  background: #5568d3;
  transform: scale(1.1);
}

.btn-qty:active {
  transform: scale(0.95);
}

.cart-quantity-input {
  width: 60px;
  height: 32px;
  border: none;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #2d3436;
  background: transparent;
  font-family: "Oswald", Helvetica;
}

.cart-quantity-input::-webkit-outer-spin-button,
.cart-quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-quantity-input:focus {
  outline: none;
}

/* Subtotal del item */
.cart-item-subtotal {
  min-width: 100px;
  text-align: right;
}

.cart-item-subtotal p {
  font-size: 22px;
  font-weight: 700;
  color: #2d3436;
  margin: 0;
}

/* Botón eliminar */
.cart-item-remove {
  display: flex;
  align-items: center;
}

.btn-remove-from-cart {
  width: 40px;
  height: 40px;
  border: none;
  background: #ff6b6b;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 16px;
}

.btn-remove-from-cart:hover {
  background: #ff5252;
  transform: scale(1.1);
}

.btn-remove-from-cart:active {
  transform: scale(0.95);
}

.btn-decrease,
.btn-increase {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: #667eea;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-decrease:hover,
.btn-increase:hover {
    background: #5568d3;
    transform: scale(1.1);
}

.btn-decrease:active,
.btn-increase:active {
    transform: scale(0.95);
}

.btn-decrease:disabled,
.btn-increase:disabled {
    background: #dfe6e9;
    color: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

/* Input de cantidad */
.cart-item-quantity input {
    width: 50px;
    height: 32px;
    text-align: center;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #2d3436;
    background: white;
    font-family: "Oswald", Helvetica;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}

.cart-item-quantity input:focus {
    outline: none;
    border-color: #667eea;
}

.cart-item-quantity input[readonly] {
    background: white;
    cursor: default;
}

.btn-remove {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: #ffe0e0;
    color: #ff6b6b;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove:hover {
    background: #ff6b6b;
    color: white;
    transform: scale(1.1);
}

.btn-remove:active {
    transform: scale(0.95);
}



/* ========================================
   RESUMEN DEL CARRITO (SIDEBAR)
   ======================================== */

.cart-summary {
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.cart-summary h2 {
  font-size: 22px;
  font-weight: 700;
  color: #2d3436;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 16px;
  color: #636e72;
}

.summary-row span:first-child {
  font-weight: 500;
}

.summary-row span:last-child {
  font-weight: 700;
  color: #2d3436;
}

.summary-row.discount-row span:last-child {
  color: #00b894;
}

.summary-row.total-row {
  margin-top: 15px;
  padding-top: 20px;
  border-top: 2px solid #f0f0f0;
  font-size: 20px;
  color: #2d3436;
}

.summary-row.total-row span {
  font-weight: 800;
}

.summary-row.total-row span:last-child {
  color: #667eea;
  font-size: 28px;
}

/* Botones de acción */
.cart-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 25px;
}

.btn-goto-checkout,
.btn-continue-shopping {
  width: 100%;
  padding: 16px;
  background-color: #475764;
  border: 4px solid #475764;
  border-radius: 15px;
  color: #ffffff;
  font-family: "Bebas Neue", Helvetica;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}

.btn-goto-checkout {
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-goto-checkout:hover {
  background-color: #667eea;
  border: 4px solid #667eea;
  color: #ffffff;
}

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

.btn-goto-checkout:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-continue-shopping {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.btn-continue-shopping:hover {
  background: #667eea;
  color: white;
}

/* ========================================
   ESTADO VACÍO DEL CARRITO
   ======================================== */

#emptyCart {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  text-align: center;
}

#emptyCart h2 {
  font-size: 28px;
  font-weight: 700;
  color: #2d3436;
  margin-bottom: 15px;
}

#emptyCart p {
  font-size: 16px;
  color: #636e72;
  margin-bottom: 30px;
  max-width: 500px;
}

#emptyCart .btn-catalogo {
  background: #95a5a6;
  color: white;
  padding: 16px 20px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#emptyCart .btn-catalogo:hover {
  background: #667eea;
  color: white;
}

/* ========================================
   LOADER
   ======================================== */

#cartLoader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ========================================
   NOTIFICACIONES
   ======================================== */

.notification-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notification {
  background: white;
  padding: 16px 24px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s ease;
  border-left: 4px solid;
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

.notification i {
  font-size: 24px;
}

.notification span {
  font-size: 15px;
  font-weight: 500;
  color: #2d3436;
}

.notification-success {
  border-left-color: #00b894;
}

.notification-success i {
  color: #00b894;
}

.notification-error {
  border-left-color: #ff6b6b;
}

.notification-error i {
  color: #ff6b6b;
}

.notification-info {
  border-left-color: #667eea;
}

.notification-info i {
  color: #667eea;
}

/* ========================================
   CONTADOR DEL CARRITO EN NAVBAR
   ======================================== */

.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff6b6b;
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

.cart-icon {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablets */
@media (max-width: 1024px) {
  .cart-container {
    grid-template-columns: 1fr;
  }

  .cart-sidebar {
    position: static;
  }

  .cart-item {
    grid-template-columns: 80px 1fr;
    gap: 15px;
  }

  .cart-item-quantity,
  .cart-item-subtotal,
  .cart-item-remove {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .cart-item-quantity {
    margin-top: 10px;
  }

  .cart-item-subtotal {
    order: 1;
    text-align: left;
  }

  .cart-item-remove {
    order: 2;
    margin-left: auto;
  }
}

/* Móviles */
@media (max-width: 768px) {
  .cart-page {
    padding-top: 70px;
  }

  .cart-container {
    padding: 20px 15px;
  }

  .cart-main,
  .cart-summary {
    padding: 20px;
  }

  .cart-header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .cart-header h1 {
    font-size: 22px;
  }

  .btn-clear-cart {
    width: 100%;
    justify-content: center;
  }

  .cart-item {
    grid-template-columns: 70px 1fr;
    padding: 15px;
  }

  .cart-item-image {
    width: 70px;
    height: 70px;
  }

  .cart-item-name {
    font-size: 16px;
  }

  .cart-item-price {
    font-size: 18px;
  }

  .cart-item-subtotal p {
    font-size: 18px;
  }

  .cart-summary h2 {
    font-size: 20px;
  }

  .summary-row.total-row span:last-child {
    font-size: 24px;
  }

  .notification-container {
    right: 10px;
    left: 10px;
  }

  .notification {
    min-width: auto;
  }

  #emptyCart {
    padding: 50px 20px;
  }



  #emptyCart h2 {
    font-size: 22px;
  }
}


/* Tablets */
@media (max-width: 992px) {
    .cart-item {
        grid-template-columns: 80px 1fr auto;
        gap: 15px;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
    }

    .cart-item-subtotal {
        grid-column: 2 / 3;
        text-align: left;
        margin-top: 10px;
    }

    .btn-remove {
        grid-column: 3 / 4;
        grid-row: 1 / 3;
    }
}

/* Móviles */
@media (max-width: 768px) {
    .cart-item {
        grid-template-columns: 70px 1fr;
        gap: 12px;
        padding: 15px;
    }

    .cart-item-image {
        width: 70px;
        height: 70px;
    }

    .cart-item-info h3 {
        font-size: 14px;
    }

    .cart-item-price {
        font-size: 16px;
    }

    .cart-item-quantity {
        grid-column: 1 / 3;
        justify-content: center;
        margin-top: 10px;
    }

    .cart-item-subtotal {
        grid-column: 1 / 3;
        text-align: center;
        font-size: 18px;
        margin-top: 5px;
    }

    .btn-remove {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
    }

    .cart-item {
        position: relative;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .cart-item {
        grid-template-columns: 60px 1fr;
        gap: 10px;
        padding: 12px;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
    }

    .btn-decrease,
    .btn-increase {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .cart-item-quantity input {
        width: 45px;
        height: 28px;
        font-size: 13px;
    }

    .cart-item-subtotal {
        font-size: 16px;
    }

    .btn-remove {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
  .cart-item-quantity {
    width: 100%;
    justify-content: center;
  }

  .btn-goto-checkout,
  .btn-continue-shopping {
    font-size: 14px;
    padding: 14px;
  }

  .site-header {
    padding: 15px 0;
  }
}

/* ========================================
   ANIMACIONES
   ======================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cart-item {
  animation: fadeIn 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.cart-summary {
  animation: slideInRight 0.4s ease;
}
