/* ============================================
   CARRITO - ICONO Y BADGE
   ============================================ */

#header .header-nav .blockcart {
  background: unset;
  padding: unset !important;
}

/* Contenedor del ícono */
.cart-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

/* Wrapper del ícono y badge */
.cart-icon-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
}

/* ============================================
     CARRITO - ICONO Y BADGE
     ============================================ */

#header .header-nav .blockcart {
  background: unset;
}

.cart-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

.cart-icon-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.cart-icon-wrapper svg {
  width: 24px;
  height: 24px;
  display: block;
}

.cart-products-count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 12px;
  height: 12px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #98f060;
  color: #05222a;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
}

#header .header-nav .cart-preview.active {
  background-color: unset !important;
  /* margin-top: .5rem; */
  white-space: nowrap;
}

@media (max-width: 991px) {
  .cart-icon-wrapper {
    width: 36px;
    height: 36px;
  }

  .cart-products-count {

    font-size: 10px;
  }

  #blockcart-modal .product-reference {
    padding: 0 .5rem;
  }
}

/* ============================================
       MODAL DEL CARRITO - SIN ANIMACIONES
       ============================================ */

/* Eliminar backdrops */
.modal-backdrop,
#blockcart-modal .modal-backdrop,
#blockcart-modal.modal-backdrop,
body>.modal-backdrop {
  display: none !important;
}

/* Modal base - OCULTO por defecto */
#blockcart-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  display: none;
}

/* Modal VISIBLE */
#blockcart-modal.is-open,
#blockcart-modal.show {
  display: block !important;
}

/* ============================================
       DIALOG
       ============================================ */

#blockcart-modal .modal-dialog {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  margin: 0;
  z-index: 1000000;
}

/* Desktop: Panel lateral de 480px */
@media (min-width: 768px) {
  #blockcart-modal .modal-dialog {
    left: auto;
    width: var(--cart-width);
    max-width: var(--cart-width);
    height: 90vh;
    top: 115px;
  }
}

/* ============================================
       CONTENT - SIN TRANSFORM, SIN ANIMACIÓN
       ============================================ */

#blockcart-modal .modal-content {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  max-width: var(--cart-modal-width);
  height: 100%;
  margin: 0;
  background-color: #ffffff;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000001;
  box-shadow: none;
}

/* Desktop: Panel lateral */
@media (min-width: 768px) {
  #blockcart-modal .modal-content {
    left: auto;
  }
}

/* ============================================
       HEADER
       ============================================ */

#blockcart-modal .modal-header {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #ffffff;
  border: unset;
}

@media (min-width: 768px) {
  #blockcart-modal .modal-header {
    padding: 16px;
  }
}

#blockcart-modal .modal-header .modal-title,
#blockcart-modal .modal-header h4 {
  font-family: "Familjen Grotesk", sans-serif;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-4xl);
  line-height: var(--line-height-tight);
  color: #05222a;
  margin: 0;
  flex: 1;
}


#blockcart-modal .modal-header .close {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0 0 0 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 1;
  flex-shrink: 0;
}

#blockcart-modal .modal-header .close:hover {
  opacity: 0.7;
}

#blockcart-modal .modal-header .close svg {
  width: 32px;
  height: 32px;
  display: block;
}

/* ============================================
       BODY
       ============================================ */

#blockcart-modal .modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  background: #ffffff;
  min-height: 0;
}

@media (min-width: 768px) {
  #blockcart-modal .modal-body {
    padding: 16px;
  }
}

#blockcart-modal .modal-body::-webkit-scrollbar {
  width: 6px;
}

#blockcart-modal .modal-body::-webkit-scrollbar-thumb {
  background: #cccccc;
  border-radius: 3px;
}

/* ============================================
       PRODUCTOS
       ============================================ */

#blockcart-modal .cart-product-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 0;
}

#blockcart-modal .cart-product-line:last-child {
  border-bottom: none;
}

#blockcart-modal .product-image {
  flex: 0 0 100px;
  width: 100px;
  height: 74px;
}

@media (min-width: 768px) {
  #blockcart-modal .product-image {
    flex: 0 0 100px;
    width: 100px;
    height: 74px;
  }
}

#blockcart-modal .product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

#blockcart-modal .product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#blockcart-modal .product-name {
  font-family: "Familjen Grotesk", sans-serif;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
  line-height: 24px;
  color: #05222A;
  text-decoration: none;
  display: block;
  margin: 0;
}

#blockcart-modal .product-name:hover {
  color: #3f923d;
  text-decoration: underline;
}

#blockcart-modal .product-reference {
  font-family: "Familjen Grotesk", sans-serif;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  line-height: 22px;
  color: var(--color-text-subtext);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 0;
}

#blockcart-modal .product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

#blockcart-modal .product-price {
  font-family: "Familjen Grotesk", sans-serif;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
  line-height: 28px;
  color: #05222A;
  margin: 0;
}

#blockcart-modal .product-quantity {
  font-family: "Familjen Grotesk", sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 21px;
  color: #3D3D3D;
  margin: 0;
}

#blockcart-modal .remove-from-cart {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #05222A;
  flex-shrink: 0;
}

#blockcart-modal .remove-from-cart:hover {
  color: #dc3545;
}

#blockcart-modal .remove-from-cart svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* ============================================
       RESUMEN Y TOTALES
       ============================================ */

#blockcart-modal .cart-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 16px;
  width: 100%;

}

#blockcart-modal .cart-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-family: "Familjen Grotesk", sans-serif;
  font-size: var(--font-size-base);
  line-height: 24px;
  font-weight: var(--font-weight-normal);
  color: #05222a;
  margin-bottom: 0;
}

#blockcart-modal .cart-summary-line .label {
  margin: 0;
  text-align: left;
  flex: 0 1 auto;
}

#blockcart-modal .cart-summary-line .value {
  margin: 0;
  text-align: right;
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}

#blockcart-modal .cart-summary-line.cart-total .label,
#blockcart-modal .cart-summary-line.cart-total .value {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: var(--space-2xl);
}


#blockcart-modal .cart-summary-tax {
  text-align: right;
  font-family: "Familjen Grotesk", sans-serif;
  font-size: 14px;
  color: #3d3d3d;
  margin-top: 4px;
  font-weight: 400;
  line-height: 21px;
}

#block-modal .cart-summary-line:not(:last-child),
#block-modal .cart-summary-line {
  margin: unset;
}

/* ============================================
       FOOTER
       ============================================ */

#blockcart-modal .modal-footer {
  flex: 0 0 auto;
  padding: 16px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.05);
  border: unset;
}

@media (min-width: 768px) {
  #blockcart-modal .modal-footer {
    padding: 16px;
  }
}

#blockcart-modal .modal-footer .btn {
  width: 100%;
  padding: 16px;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  line-height: var(--space-2xl);
  text-transform: unset;
}

#blockcart-modal .modal-footer .btn-primary {
  background-color: #98f060;
  color: #05222a;
}

#blockcart-modal .modal-footer .btn-secondary {
  background-color: #ffffff;
  color: #05222a;
  border: none;
  text-decoration: underline;
  font-weight: var(--font-weight-medium);
}

#blockcart-modal .modal-footer .btn-secondary:hover {
  background-color: unset;
}

/* ============================================
       UTILIDADES
       ============================================ */

body.modal-open {
  overflow: auto !important;
  padding-right: 0 !important;
}

#blockcart-modal .modal-body {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.cart-confirmation-message {
  display: none;
  padding: 15px;
  margin-bottom: 20px;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  color: #155724;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-confirmation-message svg {
  flex-shrink: 0;
  color: #28a745;
}


.cart-confirmation-message.just-added {
  display: flex;
}