/* =========================================================
   ADIMEL PRODUCT CARDS - Estándar global vitrinas web
   Versión base validada en marcas.php
   Uso recomendado:
   - Agregar clase adimel-product-grid al contenedor row/listado.
   - Mantener clase product-card en cada tarjeta.
   - Para modal de imagen: botón .product-image-open con data-image/data-title.
   ========================================================= */

.adimel-product-grid .product-card,
.product-card.adimel-product-card{
  position:relative;
  border:1px solid #eadcff !important;
  border-radius:18px !important;
  overflow:hidden;
  background:#ffffff;
  box-shadow:0 8px 20px rgba(91,33,182,.07);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.adimel-product-grid .product-card:hover,
.product-card.adimel-product-card:hover{
  transform:translateY(-3px);
  border-color:#c7a6ff !important;
  box-shadow:0 14px 28px rgba(91,33,182,.12);
}

.adimel-product-grid .product-card .product-image-link,
.product-card.adimel-product-card .product-image-link{
  position:relative;
  display:block;
  width:100%;
  padding:0;
  border:0;
  background:linear-gradient(180deg,#ffffff 0%, #fbf8ff 100%);
  border-bottom:1px solid #f0e6ff;
  cursor:zoom-in;
  text-align:center;
}

.adimel-product-grid .product-card .product-image-link::after,
.product-card.adimel-product-card .product-image-link::after{
  content:"\F62E";
  font-family:"bootstrap-icons";
  position:absolute;
  right:10px;
  bottom:10px;
  width:32px;
  height:32px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#6d28d9;
  background:rgba(255,255,255,.92);
  border:1px solid #e9d5ff;
  box-shadow:0 8px 18px rgba(91,33,182,.12);
  opacity:.92;
  transition:.18s ease;
  z-index:2;
}

.adimel-product-grid .product-card .product-image-link:hover::after,
.product-card.adimel-product-card .product-image-link:hover::after{
  transform:scale(1.06);
  color:#fff;
  background:#7c3aed;
  border-color:#7c3aed;
}

.adimel-product-grid .product-card .card-img-top,
.product-card.adimel-product-card .card-img-top{
  height:218px;
  width:100%;
  object-fit:contain;
  padding:8px 9px 9px;
  background:transparent;
  border-bottom:0;
  transition:transform .22s ease;
}

.adimel-product-grid .product-card:hover .card-img-top,
.product-card.adimel-product-card:hover .card-img-top{
  transform:scale(1.035);
}

.adimel-product-grid .product-card .card-body,
.product-card.adimel-product-card .card-body{
  position:relative;
  padding:12px 13px 13px;
  min-height:156px;
  background:linear-gradient(180deg,#ffffff 0%, #fff 58%, #fcfaff 100%);
}

.adimel-product-grid .product-card .card-body::before,
.product-card.adimel-product-card .card-body::before{
  content:none;
  display:none;
}

/* El texto "por unidad / por caja" no se muestra en tarjeta.
   La elección unidad/caja queda solo en el modal de compra. */
.adimel-product-grid .product-card .product-mode-badge,
.product-card.adimel-product-card .product-mode-badge{
  display:none !important;
}

.adimel-product-grid .product-card .card-title,
.product-card.adimel-product-card .card-title{
  margin-bottom:8px !important;
  min-height:22px;
  line-height:1.18;
  font-family:"Inter", "Segoe UI", Roboto, Arial, sans-serif;
  font-size:.9rem;
  font-weight:600;
  letter-spacing:-.018em;
}

.adimel-product-grid .product-card .card-title a,
.product-card.adimel-product-card .card-title a{
  color:#5b21b6 !important;
  display:block;
  width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  text-decoration:none;
}

.adimel-product-grid .product-card .card-title a:hover,
.product-card.adimel-product-card .card-title a:hover{
  color:#7c3aed !important;
}

.adimel-product-grid .product-card .small.text-muted.mb-1,
.product-card.adimel-product-card .small.text-muted.mb-1{
  font-size:.78rem !important;
  color:#6b7280 !important;
  margin-bottom:6px !important;
  min-height:18px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.adimel-product-grid .product-card .timbre-measure-chip,
.product-card.adimel-product-card .timbre-measure-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  max-width:100%;
  margin:0 0 8px;
  padding:7px 10px;
  border-radius:999px;
  background:#fff7ed;
  border:1px solid #fed7aa;
  color:#9a3412;
  font-size:.8rem;
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.adimel-product-grid .product-card .small.text-success,
.adimel-product-grid .product-card .small.text-danger,
.product-card.adimel-product-card .small.text-success,
.product-card.adimel-product-card .small.text-danger{
  font-size:.8rem !important;
  font-weight:700;
  margin-bottom:8px !important;
  min-height:19px;
}

.adimel-product-grid .product-card .fw-bold.text-primary.mb-2,
.product-card.adimel-product-card .fw-bold.text-primary.mb-2{
  font-size:1.04rem !important;
  line-height:1.1;
  color:#6d28d9 !important;
  margin-bottom:10px !important;
  min-height:24px;
}

.adimel-product-grid .product-card .fw-bold.text-primary.mb-2 .text-muted,
.product-card.adimel-product-card .fw-bold.text-primary.mb-2 .text-muted{
  font-size:.88rem !important;
  font-weight:500 !important;
  color:#9ca3af !important;
  text-decoration-thickness:1px;
}

.adimel-product-grid .product-card .product-actions,
.product-card.adimel-product-card .product-actions{
  margin-top:auto;
  gap:8px !important;
  align-items:center;
}

.adimel-product-grid .product-card .qty-input,
.product-card.adimel-product-card .qty-input{
  width:56px !important;
  min-width:56px !important;
  height:36px;
  border-radius:11px;
  border:1px solid #dfcffd;
  background:#fff;
  box-shadow:none;
  color:#374151;
}

.adimel-product-grid .product-card .qty-input:focus,
.product-card.adimel-product-card .qty-input:focus{
  border-color:#b794f4;
  box-shadow:0 0 0 .14rem rgba(124,58,237,.12);
}

.adimel-product-grid .product-card .btn,
.product-card.adimel-product-card .btn{
  height:36px;
  border-radius:11px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:.8rem;
  font-weight:700;
  padding-left:.62rem;
  padding-right:.62rem;
}

.adimel-product-grid .product-card .btn-outline-primary,
.product-card.adimel-product-card .btn-outline-primary{
  color:#7c3aed;
  border-color:#b794f4;
  background:#faf7ff;
}

.adimel-product-grid .product-card .btn-outline-primary:hover,
.product-card.adimel-product-card .btn-outline-primary:hover{
  color:#fff;
  background:#8b5cf6;
  border-color:#8b5cf6;
}

.adimel-product-grid .product-card .btn-open-sale-modal,
.product-card.adimel-product-card .btn-open-sale-modal{
  border-color:#b794f4;
  color:#7c3aed;
  background:linear-gradient(135deg,#faf5ff 0%, #f4ecff 100%);
}

.adimel-product-grid .product-card .btn-open-sale-modal:hover,
.product-card.adimel-product-card .btn-open-sale-modal:hover{
  background:#8b5cf6;
  color:#fff;
  border-color:#8b5cf6;
}

.adimel-product-grid .product-card .btn-outline-danger,
.product-card.adimel-product-card .btn-outline-danger{
  border-color:#f0b4d4;
  color:#e11d48;
  background:#fff;
}

.adimel-product-grid .product-card .btn-outline-danger:hover,
.product-card.adimel-product-card .btn-outline-danger:hover{
  background:#fff1f5;
  border-color:#ec4899;
  color:#be123c;
}

.adimel-product-grid .product-card .btn-danger,
.product-card.adimel-product-card .btn-danger{
  background:#e11d48;
  border-color:#e11d48;
}

/* Modal global para agrandar imagen de producto */
.product-image-modal .modal-content{
  border:1px solid #eadcff;
  border-radius:24px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 24px 70px rgba(15,23,42,.24);
}

.product-image-modal .modal-header{
  border-bottom:1px solid #f0e6ff;
  background:linear-gradient(135deg,#fbf8ff 0%,#ffffff 100%);
  padding:13px 16px;
}

.product-image-modal .modal-title{
  font-size:.96rem;
  font-weight:600;
  color:#1f2937;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:calc(100vw - 120px);
}

.product-image-modal .modal-body{
  padding:18px;
  background:#fff;
}

.product-image-modal-img{
  display:block;
  width:100%;
  max-height:72vh;
  object-fit:contain;
  border-radius:18px;
  background:#fff;
}

@media (max-width:991.98px){
  .adimel-product-grid .product-card .card-img-top,
  .product-card.adimel-product-card .card-img-top{
    height:205px;
  }
}

@media (max-width:767.98px){
  .adimel-product-grid .product-card,
  .product-card.adimel-product-card{
    border-radius:17px !important;
  }

  .adimel-product-grid .product-card .card-img-top,
  .product-card.adimel-product-card .card-img-top{
    height:178px;
    padding:8px;
  }

  .adimel-product-grid .product-card .card-body,
  .product-card.adimel-product-card .card-body{
    padding:11px 12px 12px;
    min-height:150px;
  }

  .adimel-product-grid .product-card .card-title,
  .product-card.adimel-product-card .card-title{
    font-size:.84rem;
    min-height:20px;
  }

  .adimel-product-grid .product-card .fw-bold.text-primary.mb-2,
  .product-card.adimel-product-card .fw-bold.text-primary.mb-2{
    font-size:1rem !important;
  }

  .adimel-product-grid .product-card .qty-input,
  .product-card.adimel-product-card .qty-input{
    width:54px !important;
    min-width:54px !important;
  }

  .adimel-product-grid .product-card .btn,
  .product-card.adimel-product-card .btn{
    font-size:.78rem;
  }
}

/* =========================================================
   INDEX HOME - tarjetas adaptadas con la lógica validada en marcas.php
   - No cambia la lógica PHP ni Swiper.
   - Solo adapta pack-card/home-product-card al look global.
   - Imagen abre modal con .product-image-open.
   ========================================================= */

body.index-page .pack-card,
body.index-page .home-product-card{
  position:relative;
  border:1px solid #eadcff !important;
  border-radius:18px !important;
  overflow:hidden;
  background:#ffffff !important;
  box-shadow:0 8px 20px rgba(91,33,182,.07) !important;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

body.index-page .pack-card::before{
  content:none !important;
  display:none !important;
}

body.index-page .pack-card:hover,
body.index-page .home-product-card:hover{
  transform:translateY(-3px) !important;
  border-color:#c7a6ff !important;
  box-shadow:0 14px 28px rgba(91,33,182,.12) !important;
}

body.index-page .pack-card-media,
body.index-page .home-product-media{
  position:relative;
  height:205px !important;
  min-height:205px !important;
  flex:0 0 205px !important;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg,#ffffff 0%, #fbf8ff 100%) !important;
  border-bottom:1px solid #f0e6ff !important;
  padding:0 !important;
}

body.index-page .home-image-zoom-btn,
body.index-page .pack-card-media .product-image-open,
body.index-page .home-product-media .product-image-open{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
  border:0;
  padding:10px;
  margin:0;
  background:transparent;
  cursor:zoom-in;
}

body.index-page .home-image-zoom-btn::after,
body.index-page .pack-card-media .product-image-open::after,
body.index-page .home-product-media .product-image-open::after{
  content:"\F62E";
  font-family:"bootstrap-icons";
  position:absolute;
  right:10px;
  bottom:10px;
  width:32px;
  height:32px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#6d28d9;
  background:rgba(255,255,255,.94);
  border:1px solid #e9d5ff;
  box-shadow:0 8px 18px rgba(91,33,182,.12);
  z-index:3;
  transition:.18s ease;
}

body.index-page .home-image-zoom-btn:hover::after,
body.index-page .pack-card-media .product-image-open:hover::after,
body.index-page .home-product-media .product-image-open:hover::after{
  transform:scale(1.06);
  color:#fff;
  background:#7c3aed;
  border-color:#7c3aed;
}

body.index-page .pack-card-media img,
body.index-page .home-product-media img{
  max-width:92% !important;
  max-height:188px !important;
  width:auto !important;
  height:auto !important;
  object-fit:contain !important;
  transition:transform .22s ease;
}

body.index-page .pack-card:hover .pack-card-media img,
body.index-page .home-product-card:hover .home-product-media img{
  transform:scale(1.035);
}

body.index-page .pack-card-body,
body.index-page .home-product-body{
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
  padding:12px 13px 13px !important;
  background:linear-gradient(180deg,#ffffff 0%, #fff 58%, #fcfaff 100%) !important;
}

/* Textos de modalidad unidad/caja fuera de la tarjeta. La elección queda en el modal. */
body.index-page .pack-badge,
body.index-page .home-mode-badge,
body.index-page .home-product-boxline,
body.index-page .home-product-copy,
body.index-page .pack-price-label,
body.index-page .pack-box-price{
  display:none !important;
}

body.index-page .pack-card-title,
body.index-page .home-product-title{
  margin:0 0 7px !important;
  min-height:22px !important;
  max-height:22px !important;
  line-height:1.16 !important;
  font-family:"Inter", "Segoe UI", Roboto, Arial, sans-serif !important;
  font-size:.9rem !important;
  font-weight:600 !important;
  letter-spacing:-.018em !important;
  color:#5b21b6 !important;
  overflow:hidden !important;
  white-space:nowrap !important;
  text-overflow:ellipsis !important;
  display:block !important;
}

body.index-page .pack-card-title a,
body.index-page .home-product-title a{
  display:block;
  width:100%;
  color:#5b21b6 !important;
  text-decoration:none !important;
  overflow:hidden !important;
  white-space:nowrap !important;
  text-overflow:ellipsis !important;
}

body.index-page .pack-card-title a:hover,
body.index-page .home-product-title a:hover{
  color:#7c3aed !important;
}

body.index-page .pack-card-brand,
body.index-page .home-product-brand{
  color:#6b7280 !important;
  font-size:.76rem !important;
  font-weight:800 !important;
  text-transform:none !important;
  letter-spacing:0 !important;
  margin:0 0 6px !important;
  min-height:18px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

body.index-page .home-product-stock{
  font-size:.8rem !important;
  font-weight:700 !important;
  margin-bottom:8px !important;
  min-height:19px;
}

body.index-page .home-product-stock.text-success{
  color:#0f8a4a !important;
}

body.index-page .home-product-stock.text-danger{
  color:#dc2626 !important;
}

body.index-page .pack-price,
body.index-page .home-product-price{
  font-size:1.08rem !important;
  line-height:1.08 !important;
  color:#6d28d9 !important;
  font-weight:800 !important;
  margin:0 0 10px !important;
  text-shadow:none !important;
}

body.index-page .home-product-old{
  font-size:.78rem !important;
  color:#9ca3af !important;
  font-weight:500 !important;
}

body.index-page .timbre-measure-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  width:max-content;
  max-width:100%;
  margin:0 0 8px;
  padding:7px 10px;
  border-radius:999px;
  background:#fff7ed;
  border:1px solid #fed7aa;
  color:#9a3412;
  font-size:.78rem;
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

body.index-page .home-product-actions{
  margin-top:auto !important;
  display:flex !important;
  flex-direction:column !important;
  gap:8px !important;
  min-height:0 !important;
  justify-content:flex-end !important;
}

body.index-page .qty-bar{
  display:flex;
  align-items:center;
  gap:8px;
}

body.index-page .qty-bar .qty-btn{
  width:34px !important;
  height:34px !important;
  border-radius:11px !important;
  border:1px solid #d9c2ff !important;
  background:#fff !important;
  color:#5b21b6 !important;
  font-weight:900 !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

body.index-page .qty-bar .qty-input{
  width:56px !important;
  height:34px !important;
  border-radius:11px !important;
  border:1px solid #d9c2ff !important;
  text-align:center;
  font-weight:800;
  color:#374151;
  background:#fff;
}

body.index-page .action-row{
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  width:100%;
  margin-top:auto;
}

body.index-page .action-row .btn-main,
body.index-page .pack-card .btn{
  width:100%;
  height:38px !important;
  border-radius:11px !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:.82rem !important;
  font-weight:800 !important;
  box-shadow:none !important;
}

body.index-page .pack-card .btn-outline-primary,
body.index-page .home-product-card .btn-primary,
body.index-page .home-product-card--timbre .btn-main{
  background:linear-gradient(135deg,#7c3aed 0%, #2563eb 100%) !important;
  border-color:#7c3aed !important;
  color:#fff !important;
}

body.index-page .pack-card .btn-outline-primary:hover,
body.index-page .home-product-card .btn-primary:hover,
body.index-page .home-product-card--timbre .btn-main:hover{
  background:linear-gradient(135deg,#6d28d9 0%, #1d4ed8 100%) !important;
  border-color:#6d28d9 !important;
  color:#fff !important;
}

body.index-page .home-highlight{
  position:absolute;
  top:12px;
  left:12px;
  z-index:4;
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  pointer-events:none;
}

body.index-page .home-highlight .badge{
  border-radius:999px;
  padding:7px 10px;
  font-size:.72rem;
  box-shadow:0 8px 16px rgba(0,0,0,.08);
}

/* Timbres: conservar la lógica especial sin que se monte sobre el botón. */
body.index-page .home-product-card--timbre .home-product-actions{
  gap:8px !important;
}

body.index-page .timbre-design-note{
  width:100%;
  height:34px !important;
  min-height:34px !important;
  border-radius:11px !important;
  border:1px solid #c7d2fe !important;
  background:linear-gradient(135deg,#eff6ff 0%, #eef2ff 100%) !important;
  color:#1d4ed8 !important;
  font-size:.78rem !important;
  font-weight:900 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:7px !important;
  padding:0 9px !important;
  box-shadow:0 7px 14px rgba(37,99,235,.07) !important;
}

/* Carrusel marcas */
body.index-page .pack-swiper .swiper-wrapper,
body.index-page .home-products-swiper .swiper-wrapper{
  align-items:stretch;
}

body.index-page .pack-swiper .swiper-slide,
body.index-page .home-products-swiper .swiper-slide{
  display:flex;
  height:auto;
}

body.index-page .pack-swiper .pack-card,
body.index-page .home-products-swiper .home-product-card{
  width:100%;
  height:100%;
  max-width:none !important;
  margin:0 !important;
}

body.index-page .pack-card-body{
  min-height:178px !important;
}

/* Carrusel librería: dos tarjetas por columna, más compactas y alineadas. */
body.index-page .library-slide-stack{
  width:100%;
  display:flex;
  flex-direction:column;
  gap:18px;
  height:100%;
}

body.index-page .library-slide-stack .home-product-card{
  height:auto !important;
  min-height:360px !important;
}

body.index-page .library-products-swiper .home-product-media{
  height:178px !important;
  min-height:178px !important;
  flex:0 0 178px !important;
}

body.index-page .library-products-swiper .home-product-media img{
  max-height:160px !important;
}

body.index-page .library-products-swiper .home-product-body{
  min-height:182px !important;
}

body.index-page .library-products-swiper .home-product-title{
  min-height:22px !important;
  max-height:22px !important;
}

body.index-page .library-products-swiper .home-product-actions{
  min-height:76px !important;
}

body.index-page .library-products-swiper .home-product-actions.is-soldout{
  min-height:38px !important;
}

/* Evitar que las reglas antiguas de acción partan botones en columna en desktop. */
body.index-page .library-products-swiper .action-row .btn-main{
  width:100%;
}

/* Responsive */
@media (max-width:991.98px){
  body.index-page .pack-card-media,
  body.index-page .home-product-media{
    height:190px !important;
    min-height:190px !important;
    flex-basis:190px !important;
  }
  body.index-page .pack-card-media img,
  body.index-page .home-product-media img{
    max-height:172px !important;
  }
}

@media (max-width:767.98px){
  body.index-page .pack-card,
  body.index-page .home-product-card{
    border-radius:17px !important;
  }

  body.index-page .pack-card-media,
  body.index-page .home-product-media{
    height:168px !important;
    min-height:168px !important;
    flex-basis:168px !important;
  }

  body.index-page .pack-card-media img,
  body.index-page .home-product-media img{
    max-height:150px !important;
  }

  body.index-page .pack-card-body,
  body.index-page .home-product-body{
    padding:11px 12px 12px !important;
  }

  body.index-page .pack-card-title,
  body.index-page .home-product-title{
    font-size:.84rem !important;
  }

  body.index-page .pack-price,
  body.index-page .home-product-price{
    font-size:1rem !important;
  }

  body.index-page .action-row{
    flex-direction:column !important;
  }

  body.index-page .action-row .btn-secondary,
  body.index-page .action-row .btn-main{
    width:100%;
    min-width:0;
  }

  body.index-page .library-slide-stack{
    gap:12px;
  }

  body.index-page .library-slide-stack .home-product-card{
    min-height:330px !important;
  }

  body.index-page .library-products-swiper .home-product-media{
    height:150px !important;
    min-height:150px !important;
    flex-basis:150px !important;
  }

  body.index-page .library-products-swiper .home-product-body{
    min-height:180px !important;
  }
}

/* =========================================================
   PATCH INDEX COMPACTO v3
   Objetivo: conservar look de marcas.php, pero reducir alto de
   tarjetas del index y corregir botones de timbres.
   ========================================================= */

/* Tarjetas index más bajas y livianas */
body.index-page .pack-card,
body.index-page .home-product-card{
  border-radius:17px !important;
  box-shadow:0 7px 18px rgba(91,33,182,.065) !important;
}

body.index-page .pack-card:hover,
body.index-page .home-product-card:hover{
  transform:translateY(-2px) !important;
  box-shadow:0 11px 24px rgba(91,33,182,.105) !important;
}

/* Imagen menos alta: sigue protagonista, pero no agranda la tarjeta */
body.index-page .pack-card-media,
body.index-page .home-product-media{
  height:168px !important;
  min-height:168px !important;
  flex:0 0 168px !important;
  padding:0 !important;
}

body.index-page .pack-card-media img,
body.index-page .home-product-media img{
  max-height:148px !important;
  max-width:88% !important;
}

body.index-page .home-image-zoom-btn,
body.index-page .pack-card-media .product-image-open,
body.index-page .home-product-media .product-image-open{
  padding:8px !important;
}

body.index-page .home-image-zoom-btn::after,
body.index-page .pack-card-media .product-image-open::after,
body.index-page .home-product-media .product-image-open::after{
  right:9px !important;
  bottom:9px !important;
  width:28px !important;
  height:28px !important;
  font-size:.86rem !important;
}

/* Cuerpo compacto: elimina el alto antiguo del index */
body.index-page .pack-card-body,
body.index-page .home-product-body{
  padding:10px 12px 12px !important;
  min-height:0 !important;
}

/* Títulos: 33 caracteres en una línea, destacados pero más finos */
body.index-page .pack-card-title,
body.index-page .home-product-title{
  margin:0 0 6px !important;
  min-height:20px !important;
  max-height:20px !important;
  line-height:1.16 !important;
  font-size:.86rem !important;
  font-weight:600 !important;
  letter-spacing:-.012em !important;
}

body.index-page .pack-card-brand,
body.index-page .home-product-brand{
  font-size:.72rem !important;
  font-weight:800 !important;
  margin:0 0 5px !important;
  min-height:16px !important;
}

body.index-page .home-product-stock{
  font-size:.76rem !important;
  margin-bottom:6px !important;
  min-height:17px !important;
}

body.index-page .pack-price,
body.index-page .home-product-price{
  font-size:1rem !important;
  margin:0 0 7px !important;
  line-height:1.05 !important;
}

body.index-page .home-product-old{
  font-size:.74rem !important;
}

/* Chip de medida de timbre más bajo */
body.index-page .timbre-measure-chip{
  margin:0 0 6px !important;
  padding:6px 9px !important;
  font-size:.73rem !important;
  line-height:1 !important;
}

/* Timbres: botón y aviso en columna, sin montarse */
body.index-page .home-product-card--timbre .home-product-body{
  min-height:205px !important;
}

body.index-page .home-product-card--timbre .home-product-actions{
  display:flex !important;
  flex-direction:column !important;
  gap:6px !important;
  margin-top:auto !important;
  min-height:72px !important;
  justify-content:flex-end !important;
  position:static !important;
}

body.index-page .home-product-card--timbre .action-row{
  display:block !important;
  width:100% !important;
  margin:0 !important;
  position:static !important;
}

body.index-page .timbre-design-note{
  position:static !important;
  width:100% !important;
  height:30px !important;
  min-height:30px !important;
  padding:0 8px !important;
  font-size:.72rem !important;
  line-height:1 !important;
  margin:0 !important;
  white-space:nowrap !important;
}

body.index-page .timbre-design-note i{
  font-size:.9rem !important;
}

body.index-page .home-product-card--timbre .btn-main{
  width:100% !important;
  height:34px !important;
  min-height:34px !important;
  margin:0 !important;
  font-size:.78rem !important;
  position:static !important;
}

/* Botones generales más bajos */
body.index-page .action-row .btn-main,
body.index-page .pack-card .btn{
  height:34px !important;
  min-height:34px !important;
  font-size:.78rem !important;
  border-radius:10px !important;
}

body.index-page .qty-bar{
  gap:6px !important;
}

body.index-page .qty-bar .qty-btn{
  width:31px !important;
  height:31px !important;
  border-radius:10px !important;
}

body.index-page .qty-bar .qty-input{
  width:50px !important;
  height:31px !important;
  border-radius:10px !important;
  font-size:.82rem !important;
}

body.index-page .home-product-actions{
  gap:6px !important;
  margin-top:auto !important;
}

/* Nuestras marcas del index: compactar sin perder botón */
body.index-page .pack-card-body{
  min-height:148px !important;
}

/* Librería: estaba demasiado alta; bajar media + body + card */
body.index-page .library-slide-stack{
  gap:14px !important;
}

body.index-page .library-slide-stack .home-product-card{
  min-height:282px !important;
  height:auto !important;
}

body.index-page .library-products-swiper .home-product-media{
  height:138px !important;
  min-height:138px !important;
  flex:0 0 138px !important;
}

body.index-page .library-products-swiper .home-product-media img{
  max-height:118px !important;
  max-width:86% !important;
}

body.index-page .library-products-swiper .home-product-body{
  min-height:144px !important;
  padding:9px 11px 10px !important;
}

body.index-page .library-products-swiper .home-product-title{
  min-height:20px !important;
  max-height:20px !important;
  margin-bottom:5px !important;
  font-size:.82rem !important;
}

body.index-page .library-products-swiper .home-product-brand{
  min-height:15px !important;
  margin-bottom:4px !important;
  font-size:.7rem !important;
}

body.index-page .library-products-swiper .home-product-stock{
  min-height:16px !important;
  margin-bottom:5px !important;
  font-size:.73rem !important;
}

body.index-page .library-products-swiper .home-product-price{
  font-size:.96rem !important;
  margin-bottom:6px !important;
}

body.index-page .library-products-swiper .home-product-actions{
  min-height:64px !important;
  gap:5px !important;
}

body.index-page .library-products-swiper .home-product-actions.is-soldout{
  min-height:34px !important;
}

/* Si algún producto de librería no trae acción visible, no dejar huecos grandes */
body.index-page .library-products-swiper .action-row{
  margin-top:0 !important;
}

/* Badges más discretos */
body.index-page .home-highlight{
  top:10px !important;
  left:10px !important;
}

body.index-page .home-highlight .badge{
  padding:6px 9px !important;
  font-size:.68rem !important;
}

/* Responsive */
@media (max-width:991.98px){
  body.index-page .pack-card-media,
  body.index-page .home-product-media{
    height:155px !important;
    min-height:155px !important;
    flex-basis:155px !important;
  }
  body.index-page .pack-card-media img,
  body.index-page .home-product-media img{
    max-height:136px !important;
  }
}

@media (max-width:767.98px){
  body.index-page .pack-card-media,
  body.index-page .home-product-media{
    height:145px !important;
    min-height:145px !important;
    flex-basis:145px !important;
  }
  body.index-page .pack-card-media img,
  body.index-page .home-product-media img{
    max-height:126px !important;
  }
  body.index-page .home-product-card--timbre .home-product-body{
    min-height:196px !important;
  }
  body.index-page .library-slide-stack .home-product-card{
    min-height:268px !important;
  }
  body.index-page .library-products-swiper .home-product-media{
    height:130px !important;
    min-height:130px !important;
    flex-basis:130px !important;
  }
  body.index-page .library-products-swiper .home-product-body{
    min-height:138px !important;
  }
}

/* =========================================================
   MARCAS.PHP - imagen más grande y clara solo en Nuestras Marcas
   No afecta index, timbres ni librería.
   ========================================================= */
body.marcas-page .adimel-product-grid .product-card .card-img-top,
body.marcas-page .product-card.adimel-product-card .card-img-top{
  height:236px;
  padding:5px 6px 7px;
  object-fit:contain;
}

body.marcas-page .adimel-product-grid .product-card .product-image-link,
body.marcas-page .product-card.adimel-product-card .product-image-link{
  background:#ffffff;
}

body.marcas-page .adimel-product-grid .product-card:hover .card-img-top,
body.marcas-page .product-card.adimel-product-card:hover .card-img-top{
  transform:scale(1.045);
}

body.marcas-page .product-image-modal .modal-dialog{
  max-width:min(1120px, 96vw);
}

body.marcas-page .product-image-modal .modal-content{
  border-radius:26px;
  background:#ffffff;
}

body.marcas-page .product-image-modal .modal-header{
  padding:12px 16px;
  background:#ffffff;
}

body.marcas-page .product-image-modal .modal-body{
  padding:10px 14px 16px;
  background:#ffffff;
}

body.marcas-page .product-image-modal-img{
  width:100%;
  max-height:84vh;
  object-fit:contain;
  border-radius:18px;
  background:#ffffff;
}

@media (max-width:991.98px){
  body.marcas-page .adimel-product-grid .product-card .card-img-top,
  body.marcas-page .product-card.adimel-product-card .card-img-top{
    height:218px;
    padding:6px;
  }

  body.marcas-page .product-image-modal .modal-dialog{
    max-width:96vw;
    margin-left:auto;
    margin-right:auto;
  }

  body.marcas-page .product-image-modal-img{
    max-height:80vh;
  }
}

@media (max-width:767.98px){
  body.marcas-page .adimel-product-grid .product-card .card-img-top,
  body.marcas-page .product-card.adimel-product-card .card-img-top{
    height:190px;
    padding:6px;
  }

  body.marcas-page .product-image-modal .modal-body{
    padding:8px 10px 12px;
  }

  body.marcas-page .product-image-modal-img{
    max-height:78vh;
  }
}

/* =========================================================
   INDEX - carrusel "Nuestras marcas" con foto más clara
   Solo afecta #pack-favorites del home. No toca timbres ni librería.
   ========================================================= */
body.index-page #pack-favorites .pack-card-media{
  height:182px !important;
  min-height:182px !important;
  flex:0 0 182px !important;
  padding:0 !important;
  background:#ffffff !important;
}

body.index-page #pack-favorites .pack-card-media .product-image-open{
  width:100% !important;
  height:100% !important;
  padding:4px 8px 3px !important;
  background:#ffffff !important;
  border:0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}

body.index-page #pack-favorites .pack-card-media img{
  max-height:168px !important;
  max-width:91% !important;
  object-fit:contain !important;
  filter:drop-shadow(0 8px 14px rgba(15,23,42,.055));
}

body.index-page #pack-favorites .pack-card:hover .pack-card-media img{
  transform:scale(1.035) !important;
}

body.index-page #pack-favorites .pack-card-body{
  padding:9px 12px 12px !important;
  min-height:136px !important;
}

body.index-page #pack-favorites .pack-card-title{
  margin-bottom:6px !important;
  font-size:.84rem !important;
  line-height:1.16 !important;
  min-height:20px !important;
  max-height:20px !important;
}

body.index-page #pack-favorites .pack-card-brand{
  margin-bottom:4px !important;
}

body.index-page #pack-favorites .home-product-stock{
  margin-bottom:5px !important;
}

body.index-page #pack-favorites .pack-price{
  margin-bottom:7px !important;
}

/* Modal grande y limpio cuando la imagen viene de Nuestras Marcas */
.product-image-modal.is-brand-zoom .modal-dialog{
  max-width:min(1120px, 96vw) !important;
}

.product-image-modal.is-brand-zoom .modal-content,
.product-image-modal.is-brand-zoom .modal-header,
.product-image-modal.is-brand-zoom .modal-body{
  background:#ffffff !important;
}

.product-image-modal.is-brand-zoom .modal-content{
  border-radius:26px !important;
}

.product-image-modal.is-brand-zoom .modal-header{
  padding:12px 16px !important;
}

.product-image-modal.is-brand-zoom .modal-body{
  padding:10px 14px 16px !important;
}

.product-image-modal.is-brand-zoom .product-image-modal-img{
  width:100% !important;
  max-height:84vh !important;
  object-fit:contain !important;
  border-radius:18px !important;
  background:#ffffff !important;
}

@media (max-width:991.98px){
  body.index-page #pack-favorites .pack-card-media{
    height:170px !important;
    min-height:170px !important;
    flex-basis:170px !important;
  }
  body.index-page #pack-favorites .pack-card-media img{
    max-height:156px !important;
    max-width:90% !important;
  }
  .product-image-modal.is-brand-zoom .modal-dialog{
    max-width:96vw !important;
  }
  .product-image-modal.is-brand-zoom .product-image-modal-img{
    max-height:80vh !important;
  }
}

@media (max-width:767.98px){
  body.index-page #pack-favorites .pack-card-media{
    height:158px !important;
    min-height:158px !important;
    flex-basis:158px !important;
  }
  body.index-page #pack-favorites .pack-card-media img{
    max-height:144px !important;
  }
  .product-image-modal.is-brand-zoom .modal-body{
    padding:8px 10px 12px !important;
  }
  .product-image-modal.is-brand-zoom .product-image-modal-img{
    max-height:78vh !important;
  }
}


/* =========================================================
   INDEX - modal zoom más pequeño para todas las imágenes del home
   No afecta marcas.php: ahí queda zoom grande.
   ========================================================= */
.product-image-modal.is-index-brand-zoom .modal-dialog{
  max-width:min(780px, 92vw) !important;
}

.product-image-modal.is-index-brand-zoom .modal-content{
  border-radius:22px !important;
  background:#ffffff !important;
}

.product-image-modal.is-index-brand-zoom .modal-header{
  padding:10px 14px !important;
  background:#ffffff !important;
}

.product-image-modal.is-index-brand-zoom .modal-body{
  padding:12px 16px 16px !important;
  background:#ffffff !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}

.product-image-modal.is-index-brand-zoom .product-image-modal-img{
  display:block !important;
  width:auto !important;
  max-width:100% !important;
  max-height:68vh !important;
  object-fit:contain !important;
  border-radius:16px !important;
  background:#ffffff !important;
  margin:0 auto !important;
}

@media (max-width:991.98px){
  .product-image-modal.is-index-brand-zoom .modal-dialog{
    max-width:90vw !important;
  }
  .product-image-modal.is-index-brand-zoom .product-image-modal-img{
    max-height:64vh !important;
  }
}

@media (max-width:767.98px){
  .product-image-modal.is-index-brand-zoom .modal-dialog{
    max-width:94vw !important;
  }
  .product-image-modal.is-index-brand-zoom .modal-body{
    padding:10px 10px 12px !important;
  }
  .product-image-modal.is-index-brand-zoom .product-image-modal-img{
    max-height:60vh !important;
  }
}

/* =========================================================
   CATEGORY.PHP - tarjetas compactas con lógica visual de index
   Zoom pequeño. No afecta marcas.php.
   ========================================================= */
body.category-page:not(.marcas-page) .category .row.gy-4{
  row-gap:18px !important;
}

body.category-page:not(.marcas-page) .product-card{
  height:100% !important;
  border:1px solid #eadcff !important;
  border-radius:18px !important;
  background:linear-gradient(180deg,#ffffff 0%, #fdfcff 100%) !important;
  box-shadow:0 12px 24px rgba(124,58,237,.07) !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease !important;
}

body.category-page:not(.marcas-page) .product-card:hover{
  transform:translateY(-3px) !important;
  border-color:#cdb2ff !important;
  box-shadow:0 18px 34px rgba(124,58,237,.12) !important;
}

body.category-page:not(.marcas-page) .category-card-media{
  position:relative !important;
  height:178px !important;
  min-height:178px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:#ffffff !important;
  border-bottom:1px solid #f1e7ff !important;
}

body.category-page:not(.marcas-page) .category-image-open{
  position:relative !important;
  width:100% !important;
  height:100% !important;
  border:0 !important;
  background:#ffffff !important;
  padding:12px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  cursor:zoom-in !important;
}

body.category-page:not(.marcas-page) .product-card .card-img-top{
  width:100% !important;
  height:100% !important;
  max-width:88% !important;
  max-height:154px !important;
  object-fit:contain !important;
  padding:0 !important;
  background:transparent !important;
  border:0 !important;
  transition:transform .22s ease !important;
}

body.category-page:not(.marcas-page) .product-card:hover .card-img-top{
  transform:scale(1.025) !important;
}

body.category-page:not(.marcas-page) .product-zoom-chip{
  position:absolute !important;
  right:12px !important;
  bottom:12px !important;
  width:32px !important;
  height:32px !important;
  border-radius:999px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:#ffffff !important;
  border:1px solid #eadcff !important;
  color:#7c3aed !important;
  box-shadow:0 8px 18px rgba(124,58,237,.13) !important;
  font-size:.96rem !important;
}

body.category-page:not(.marcas-page) .product-card .card-body{
  padding:12px 14px 14px !important;
  min-height:218px !important;
  display:flex !important;
  flex-direction:column !important;
  background:#ffffff !important;
}

body.category-page:not(.marcas-page) .product-card .card-body::before,
body.category-page:not(.marcas-page) .product-card .product-mode-badge{
  display:none !important;
  content:none !important;
  height:0 !important;
  margin:0 !important;
  padding:0 !important;
}

body.category-page:not(.marcas-page) .product-card .card-title{
  margin:0 0 7px !important;
  min-height:20px !important;
  line-height:1.18 !important;
  font-size:.88rem !important;
  font-weight:650 !important;
  letter-spacing:-.01em !important;
}

body.category-page:not(.marcas-page) .product-card .card-title a{
  display:block !important;
  color:#5b21b6 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  text-decoration:none !important;
}

body.category-page:not(.marcas-page) .product-card .card-title a:hover{
  color:#7c3aed !important;
}

body.category-page:not(.marcas-page) .product-card .small.text-muted.mb-1{
  font-size:.76rem !important;
  line-height:1.2 !important;
  font-weight:800 !important;
  color:#6b7280 !important;
  text-transform:uppercase !important;
  letter-spacing:.01em !important;
  margin:0 0 7px !important;
  min-height:16px !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

body.category-page:not(.marcas-page) .product-card .small.text-success,
body.category-page:not(.marcas-page) .product-card .small.text-danger{
  font-size:.8rem !important;
  line-height:1.2 !important;
  font-weight:850 !important;
  margin:0 0 8px !important;
  min-height:17px !important;
}

body.category-page:not(.marcas-page) .product-card .fw-bold.text-primary.mb-2{
  font-size:1.08rem !important;
  line-height:1.05 !important;
  font-weight:850 !important;
  color:#6d28d9 !important;
  margin:0 0 10px !important;
  min-height:20px !important;
}

body.category-page:not(.marcas-page) .product-card .fw-bold.text-primary.mb-2 .text-muted{
  font-size:.75rem !important;
  font-weight:600 !important;
  color:#9ca3af !important;
}

body.category-page:not(.marcas-page) .product-card .timbre-measure-chip{
  max-width:100% !important;
  margin:0 0 8px !important;
  padding:6px 9px !important;
  font-size:.75rem !important;
  font-weight:850 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

body.category-page:not(.marcas-page) .product-card .product-actions{
  margin-top:auto !important;
  display:flex !important;
  align-items:center !important;
  gap:7px !important;
}

body.category-page:not(.marcas-page) .product-card .qty-input{
  width:58px !important;
  min-width:58px !important;
  height:36px !important;
  border-radius:11px !important;
  border:1px solid #d9c2ff !important;
  font-weight:750 !important;
  font-size:.86rem !important;
  text-align:center !important;
}

body.category-page:not(.marcas-page) .product-card .btn{
  height:36px !important;
  border-radius:11px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  font-size:.82rem !important;
  font-weight:850 !important;
  white-space:nowrap !important;
}

body.category-page:not(.marcas-page) .product-card .btn-outline-primary,
body.category-page:not(.marcas-page) .product-card .btn-open-sale-modal{
  flex:1 1 auto !important;
  color:#ffffff !important;
  border-color:#7c3aed !important;
  background:linear-gradient(135deg,#7c3aed 0%, #2563eb 100%) !important;
  box-shadow:0 8px 16px rgba(37,99,235,.11) !important;
}

body.category-page:not(.marcas-page) .product-card .btn-outline-primary:hover,
body.category-page:not(.marcas-page) .product-card .btn-open-sale-modal:hover{
  color:#ffffff !important;
  border-color:#6d28d9 !important;
  background:linear-gradient(135deg,#6d28d9 0%, #1d4ed8 100%) !important;
}

body.category-page:not(.marcas-page) .product-card .btn-outline-danger,
body.category-page:not(.marcas-page) .product-card .btn-danger,
body.category-page:not(.marcas-page) .product-card .btn-outline-secondary{
  width:36px !important;
  min-width:36px !important;
  padding:0 !important;
}

body.category-page:not(.marcas-page) .product-card .btn-outline-secondary.mt-auto{
  width:100% !important;
  min-width:0 !important;
  margin-top:auto !important;
}

body.category-page:not(.marcas-page) .product-image-modal.is-index-brand-zoom .modal-dialog{
  max-width:min(780px,92vw) !important;
}

@media (max-width:991.98px){
  body.category-page:not(.marcas-page) .category-card-media{
    height:166px !important;
    min-height:166px !important;
  }
  body.category-page:not(.marcas-page) .product-card .card-img-top{
    max-height:142px !important;
  }
}

@media (max-width:767.98px){
  body.category-page:not(.marcas-page) .category-card-media{
    height:154px !important;
    min-height:154px !important;
  }
  body.category-page:not(.marcas-page) .product-card .card-img-top{
    max-height:132px !important;
  }
  body.category-page:not(.marcas-page) .product-card .card-body{
    min-height:204px !important;
    padding:11px 12px 12px !important;
  }
  body.category-page:not(.marcas-page) .product-card .card-title{
    font-size:.84rem !important;
  }
}

