/* ============================================================
   Catalogue WooCommerce — Lore & Science
   Fichier : assets/css/woocommerce-catalogue.css
   Réplique de Catalogue.tsx + CatalogueAnimal.tsx (Lovable)
   ============================================================ */

/* ── Wrapper global ─────────────────────────────────────── */
.bcc-catalogue {
    background: #FAF8F5; /* Lovable: bg-background -- zona productos mas clara que el header (#F5F3EF) */
    min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════
   PAGE D'ENTRÉE — /shop/
   3 cards Cheval / Chien / Chat
══════════════════════════════════════════════════════════ */

.bcc-catalogue-entry {
    padding: 4rem 0 5rem;
    background: #F5F3EF;
}

.bcc-catalogue-entry__header {
    text-align: center;
    margin-bottom: 3rem;
}

.bcc-catalogue-entry__title {
    font-family: var(--bcc-font-serif, 'Playfair Display', serif); /* se mantiene Playfair */
    font-size: clamp(2rem, 4vw, 3rem); /* Lovable: text-4xl/5xl = 48px máx */
    font-weight: 700;
    color: var(--bcc-brand-teal-light, #8DC8C7); /* Lovable: text-brand-teal-light */
    margin: 0 0 1rem; /* Lovable: mb-4 = 16px */
}

.bcc-catalogue-entry__subtitle {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 1.125rem; /* Lovable: text-lg */
    color: var(--bcc-brand-rose, #E61E50); /* Lovable: text-brand-rose */
    line-height: 1.6;
    margin: 0;
}

.bcc-catalogue-entry__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 56rem;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .bcc-catalogue-entry__grid {
        grid-template-columns: 1fr;
        max-width: 20rem;
    }
}

/* Animal card */
.bcc-animal-card {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    display: block;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bcc-animal-card:hover {
    transform: scale(1.03);
    box-shadow: 0 20px 40px rgba(0,0,0,0.18);
}

.bcc-animal-card__img-wrap {
    aspect-ratio: 3 / 4;
    width: 100%;
    overflow: hidden;
}

.bcc-animal-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.bcc-animal-card:hover .bcc-animal-card__img-wrap img {
    transform: scale(1.08);
}

.bcc-animal-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(30,45,38,0.80) 0%, rgba(30,45,38,0.18) 50%, transparent 100%);
}

.bcc-animal-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    text-align: center;
}

.bcc-animal-card__name {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: clamp(1.375rem, 2.5vw, 1.875rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem;
}

.bcc-animal-card__cta {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
}

/* ══════════════════════════════════════════════════════════
   HEADER ANIMAL — /product-category/mon-cheval/ etc.
══════════════════════════════════════════════════════════ */

.bcc-cat-header {
    padding: 2rem 0; /* Lovable: py-8 */
    background: #F5F3EF; /* Lovable: bg-card — fondo exterior */
}

.bcc-cat-header .container {
    max-width: 1267px; /* +10%, igual que .bcc-cat-sections/.bcc-archive-standard,
                           para quedar alineado con el grid de productos de abajo */
    margin: 0 auto;
    padding: 0 1rem; /* Lovable: px-4 */
}

.bcc-cat-header__inner {
    padding: 1rem 1.25rem; /* Lovable: py-4 px-5 = 16px 20px */
    border-radius: 0.75rem; /* Lovable: rounded-xl */
    overflow: hidden;
    margin-bottom: 1rem; /* Lovable: mb-4 */
}

.bcc-cat-header__top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.bcc-cat-header__avatar {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.bcc-cat-header__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bcc-cat-header__title {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 1.875rem; /* Lovable: text-3xl = 30px */
    font-weight: 700;
    margin: 0;
}

/* Colores por animal — CSS gana sobre regla global h1 */
.bcc-cat-header--mon-cheval .bcc-cat-header__title { color: #0E4C5A !important; }
.bcc-cat-header--mon-chien  .bcc-cat-header__title { color: #5A3E0E !important; }
.bcc-cat-header--mon-chat   .bcc-cat-header__title { color: #5A0E3E !important; }
/* Slugs en español */
.bcc-cat-header--suplementacion-equina .bcc-cat-header__title { color: #0E4C5A !important; }
.bcc-cat-header--suplementacion-canina .bcc-cat-header__title { color: #5A3E0E !important; }
.bcc-cat-header--suplementacion-felina .bcc-cat-header__title { color: #5A0E3E !important; }

/* Grid de sous-catégories */
.bcc-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (min-width: 480px) { .bcc-cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .bcc-cat-grid { grid-template-columns: repeat(4, 1fr); } }

/* Chip de catégorie */
.bcc-cat-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: #F5F3EF; /* Lovable: bg-card */
    border: 1px solid rgba(0,0,0,0.08);
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
    min-width: 0; /* el chip es un item de .bcc-cat-grid (CSS grid); sin
      esto, el item nunca encoge por debajo del ancho "natural" del texto
      mas largo del nombre de categoria, aunque .bcc-cat-chip__name ya
      tenga text-overflow:ellipsis -- eso es lo que empujaba toda la
      cuadricula fuera de la pantalla en vez de truncar con "...". */
}

.bcc-cat-chip:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    transform: scale(1.01);
}

.bcc-cat-chip:active { transform: scale(0.97); }

.bcc-cat-chip--pack {
    background: rgba(14, 76, 90, 0.071); /* #0E4C5A12 */
    border-color: rgba(14, 76, 90, 0.15);
    box-shadow: 0 1px 4px rgba(14, 76, 90, 0.08);
}

.bcc-cat-chip__bar {
    width: 3px;
    align-self: stretch;
    border-radius: 999px;
    flex-shrink: 0;
}

.bcc-cat-chip__inner {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bcc-cat-chip__name {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bcc-foreground, #1E2D26);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bcc-cat-chip__count {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.75rem;
    font-weight: 500;
}

/* ══════════════════════════════════════════════════════════
   SECTIONS PRODUITS PAR CATÉGORIE
══════════════════════════════════════════════════════════ */

.bcc-cat-sections {
    max-width: 1267px; /* +10% sobre 1152px, a pedido de Yanko (v2.3.38):
                           cards del catalogo mas grandes / imagenes con mas detalle */
    margin: 0 auto;
    padding: 3rem 1.25rem 5rem;
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

.bcc-cat-section {
    border-radius: 0.75rem;
    padding: 1.5rem 1.25rem 2rem;
    border-top: 3px solid;
    transition: box-shadow 0.3s;
}

.bcc-cat-section--highlight {
    box-shadow: 0 0 0 3px currentColor;
    animation: bcc-highlight-pulse 0.6s ease;
}

@keyframes bcc-highlight-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(14,76,89,0.4); }
    50%  { box-shadow: 0 0 0 8px rgba(14,76,89,0.1); }
    100% { box-shadow: 0 0 0 3px rgba(14,76,89,0.15); }
}

.bcc-cat-section__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.bcc-cat-section__title {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.bcc-cat-section__count {
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.85;
}

.bcc-btn-aide {
    display: inline-flex;
    align-items: center;
    height: 2.375rem;
    padding: 0 1.25rem;
    border-radius: 999px;
    background: var(--bcc-conseil, #DA053A);
    color: #fff;
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
    white-space: nowrap;
}

.bcc-btn-aide:hover {
    opacity: 0.9;
    color: #fff;
    transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════
   GRILLE DE PRODUITS
══════════════════════════════════════════════════════════ */

.bcc-products-grid {
    display: grid;
    grid-template-columns: 1fr; /* antes repeat(2,1fr): nunca existia una
      vista real de 1 sola columna, 2 columnas se forzaba desde 0px de
      ancho -- por eso estrellas/precio/boton quedaban muy apretados en
      celular. Las columnas en tablet/desktop (ver medias de abajo) no
      cambian. */
    gap: 1rem;
}

@media (min-width: 640px)  { .bcc-products-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; } }
@media (min-width: 1024px) { .bcc-products-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }
@media (min-width: 1280px) { .bcc-products-grid { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; } }

/* ── Product card — fidèle à Lovable ─────────────────── */
.bcc-product-card {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.06);
    text-decoration: none;
    color: inherit;
    height: 100%;
    position: relative; /* contexte pour .bcc-wishlist-btn */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bcc-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
    color: inherit;
}

/* Zone image */
.bcc-product-card__img-zone {
    position: relative;
    aspect-ratio: 1;
    background: #f0f9f9;
    overflow: hidden;
    /* Necesario para que el wishlist-btn (z-index:10) sea visible sobre el shimmer */
    isolation: isolate;
}

.bcc-product-card__img {
    width: 100%;
    height: 100%;
    display: block;
    transition: transform 0.4s ease;
}

.bcc-product-card:hover .bcc-product-card__img {
    transform: scale(1.04);
}

/* Badge type (Pack / Protocole / Spray) — fidèle à Lovable */
.bcc-product-card__type-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    padding: 0.375rem 1rem;
    border-radius: 999px;
    /* Le background est injecté inline via PHP (color par badge) */
    color: #fff;
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.875rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    overflow: hidden;
}

/* Shimmer animé comme Lovable */
.bcc-product-card__type-badge::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    background-size: 200% 100%;
    animation: bcc-shimmer 2.5s ease-in-out infinite;
}

@keyframes bcc-shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}

/* Body */
.bcc-product-card__body {
    padding: 0.75rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    flex: 1;
    text-align: center;
}

/* Descripción — aparece ANTES del nombre (orden Lovable) */
.bcc-product-card__desc {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.75rem;
    font-weight: 400;
    color: #677E73;
    text-align: center;
    margin: 0;
    line-height: 1.4;
    min-height: 2.1rem; /* altura fija (≈2 líneas) → alinea elementos siguientes entre cards */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Titre centré */
.bcc-product-card__title {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    min-height: 3.4rem; /* ≈3 líneas — cubre títulos largos de Packs sin descuadrar */
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #7B8FA1;
    margin: 0;
}

/* Prix */
.bcc-product-card__price-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-height: 1.5rem; /* altura fija → alinea elementos siguientes entre cards */
}

.bcc-product-card__price {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.9375rem;
    font-weight: 700;
}

.bcc-product-card__price-old {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.8125rem;
    font-weight: 400;
    color: #9ca3af;
    text-decoration: line-through;
}

/* Livraison */
.bcc-product-card__shipping {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bcc-conseil, #DA053A);
    margin: 0;
}

.bcc-product-card__shipping--hidden {
    visibility: hidden;
}

/* Étoiles — taille augmentée (Issue 4) */
.bcc-product-card__stars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    min-height: 1.5rem; /* altura fija → estrellas al mismo nivel en todas las cards */
    margin-bottom: 0.875rem; /* separación respecto al botón */
}
.bcc-product-card__stars svg {
    width: 18px !important;
    height: 18px !important;
}

.bcc-product-card__rating-val {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: 0.25rem;
}
/* "X opiniones" — mismo tamaño que la nota, separado por una barra */
.bcc-product-card__rating-count {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.8125rem;
    color: #6b7280;
    margin-left: 0.375rem;
    padding-left: 0.375rem;
    border-left: 1px solid #d1d5db;
}

/* Badges animaux */
.bcc-product-card__animals {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
}

.bcc-product-card__animal-badge {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.6875rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
}

/* Boutons panier */
.bcc-btn-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-radius: 999px;
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, opacity 0.2s;
    margin-top: auto;
    border: none;
    min-height: 2.75rem;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
}

.bcc-btn-cart--primary {
    background: var(--bcc-conseil, #DA053A);
    color: #fff;
    border: 2px solid #DA053A;
}

.bcc-btn-cart--primary:hover {
    background: #b8032f;
    border-color: #b8032f;
    color: #fff;
    transform: translateY(-1px);
}



.bcc-btn-cart--added {
    background: #188A81 !important;
    border-color: #188A81 !important;
}

.bcc-spin {
    animation: bcc-spin 0.8s linear infinite;
}

@keyframes bcc-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Archive standard ────────────────────────────────── */
.bcc-archive-standard {
    max-width: 1267px; /* +10% sobre 1152px, misma ampliacion que .bcc-cat-sections */
    margin: 0 auto;
    padding: 3rem 1.25rem 5rem;
}

.bcc-archive-standard__title {
    font-family: var(--bcc-font-serif, 'Playfair Display', serif);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    color: var(--bcc-foreground, #1E2D26);
    margin-bottom: 2rem;
}

/* ── État vide ────────────────────────────────────────── */
.bcc-cat-empty {
    text-align: center;
    padding: 4rem 1rem;
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    color: #8a9e99;
}

/* ══════════════════════════════════════════════════════════
   WISHLIST BUTTON — réplique exacte de ProductCard.tsx
   Position : top-3 left-3 sur la zone image
══════════════════════════════════════════════════════════ */

.bcc-wishlist-btn {
    /* Positionnement identique à Lovable : absolute top-3 left-3 z-10 */
    position: absolute !important;
    top: 0.75rem !important;
    left: 0.75rem !important;
    z-index: 10 !important;

    /* Apparence : p-1.5 rounded-full bg-white/80 shadow */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 2rem !important;
    height: 2rem !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18) !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
    transition: background 0.15s ease, transform 0.15s ease !important;
    line-height: 0 !important;
    /* Annule tout reset Elementor / WC qui pourrait cacher le bouton */
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    overflow: visible !important;
}

.bcc-wishlist-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

/* Icone - etat inactif : contour rouge, non rempli */
.bcc-wishlist-btn__icon {
    display: block !important;
    fill: none !important;
    stroke: #DA053A !important;
    stroke-width: 2 !important;
    flex-shrink: 0;
    transition: stroke 0.2s ease, fill 0.2s ease;
}
.bcc-wishlist-btn__icon path {
    fill: none;
    stroke: #DA053A;
    stroke-width: 2;
    transition: stroke 0.2s ease, fill 0.2s ease;
}

/* État actif — rouge #DA053A */
.bcc-wishlist-btn--active .bcc-wishlist-btn__icon {
    fill: #DA053A !important;
    stroke: #DA053A !important;
}
.bcc-wishlist-btn--active .bcc-wishlist-btn__icon path {
    fill: #DA053A !important;
    stroke: #DA053A !important;
}

/* Animation pop au clic */
.bcc-wishlist-btn--active {
    animation: bcc-heart-pop 0.35s ease;
}

@keyframes bcc-heart-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* .bcc-toast — movido a main.css (v2.3.38.1): este archivo (hcl-catalogue)
   solo se carga en tienda/categoría, pero el toast se usa en TODO el sitio
   (wishlist + confirmación de "añadido al carrito"), incluida la ficha de
   producto individual, donde este CSS nunca llegaba a cargar. */