/* ==========================================================================
   DAEY MARKETPLACE - FICHA DE PRODUCTO MODERNA (3 COLUMNAS)
   Fondo suave, tarjeta amplia 1240px, 3 columnas en escritorio, mobile-first.
   ========================================================================== */

:root {
    --daey-ml-bg: #f3f4f6;
    --daey-ml-border: #e5e7eb;
    --daey-ml-surface: #ffffff;
    --daey-ml-zebra: #f8fafc;
    --daey-ml-text: #1f2937;
    --daey-ml-muted: #64748b;
    --daey-ml-accent: #2563eb;
    --daey-ml-accent-soft: #eff6ff;
    --daey-ml-green: #15803d;
    --daey-ml-green-soft: #f0fdf4;
    --daey-ml-radius: 14px;
}

/* Fondo suave y contenedor amplio estilo MercadoLibre */
body.single-product,
body.single-product .site-content {
    background-color: var(--daey-ml-bg);
}

body.single-product .site-content > .ast-container,
body.single-product #content .ast-container {
    max-width: 1260px;
    padding-left: 16px;
    padding-right: 16px;
}

body.single-product div.product {
    background: var(--daey-ml-surface);
    border: 1px solid var(--daey-ml-border);
    border-radius: 18px;
    padding: 18px 16px;
    margin-top: 18px;
    margin-bottom: 28px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

/* Ajustes de legibilidad y limpieza de píldoras de categoría en columna central */
body.single-product .daey-ml-col-info .woocommerce-product-details__short-description,
body.single-product .daey-ml-col-info .woocommerce-product-details__short-description p {
    font-size: 14.5px;
    line-height: 1.48;
    margin-bottom: 12px;
    color: #475569;
}

body.single-product .daey-ml-col-info .daey-product-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 6px;
    padding: 0;
    border: none;
    background: transparent;
}

/* Eliminar el doble borde/margen del contenedor wrapper interno de las píldoras */
body.single-product .daey-ml-col-info .daey-product-meta-pills > span,
body.single-product .daey-ml-col-info .daey-product-meta-pills .posted_in,
body.single-product .daey-ml-col-info .daey-product-meta-pills .tagged_as {
    display: contents;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

body.single-product .daey-ml-col-info .daey-product-meta-pills a {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border-radius: 999px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    margin: 0;
    box-shadow: none;
}

body.single-product .daey-ml-col-info .daey-product-meta-pills a:hover {
    background: #d1fae5;
    color: #065f46;
}

/* Caja de Compra (Buy Box) */
.daey-ml-col-buybox {
    border: 1px solid var(--daey-ml-border);
    border-radius: 14px;
    padding: 18px;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.daey-ml-col-buybox form.cart {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 12px 0 14px;
}

.daey-ml-col-buybox form.cart .single_add_to_cart_button {
    flex: 1 1 160px;
    width: 100%;
    padding: 13px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
}

.daey-ml-col-buybox .ast-single-product-extras {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--daey-ml-border);
    font-size: 13px;
}

.daey-ml-col-buybox .ast-single-product-payments {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
}

.daey-ml-col-buybox .daey-delivery-bar {
    margin: 8px 0 10px;
    font-size: 12.5px;
}

.daey-ml-col-buybox .daey-single-product-pv-reward {
    margin-top: 10px;
    font-size: 12.5px;
}

/* Galería proporcionada y compacta sin espacio muerto */
body.single-product.woocommerce div.product .woocommerce-product-gallery img {
    max-height: 360px;
    width: auto;
    margin: 0 auto;
    object-fit: contain;
}

.daey-ml-wrapper {
    clear: both;
    width: 100%;
    margin: 24px 0 10px;
    background: var(--daey-ml-surface);
    border-top: 1px solid var(--daey-ml-border);
    padding: 20px 0 8px;
    box-sizing: border-box;
}

/* Barra de anclas rápidas */
.daey-ml-anchor-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 14px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--daey-ml-border);
    scrollbar-width: none;
}

.daey-ml-anchor-nav::-webkit-scrollbar {
    display: none;
}

.daey-ml-anchor-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--daey-ml-muted);
    background: #f1f5f9;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.daey-ml-anchor-pill:hover,
.daey-ml-anchor-pill.is-active {
    background: var(--daey-ml-accent-soft);
    color: var(--daey-ml-accent);
    text-decoration: none;
}

/* Secciones verticales separadas por línea limpia */
.daey-ml-section {
    padding: 24px 0;
    border-bottom: 1px solid var(--daey-ml-border);
    scroll-margin-top: 90px;
}

.daey-ml-section:last-child {
    border-bottom: none;
    padding-bottom: 8px;
}

.daey-ml-section-title {
    margin: 0 0 18px;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

/* Chips de destacados */
.daey-ml-highlights {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.daey-ml-highlight-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--daey-ml-zebra);
    border: 1px solid var(--daey-ml-border);
    border-radius: 10px;
    font-size: 13.5px;
    color: var(--daey-ml-text);
}

.daey-ml-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--daey-ml-accent);
    flex-shrink: 0;
}

.daey-ml-chip-label {
    color: var(--daey-ml-muted);
}

.daey-ml-chip-val {
    color: #0f172a;
    font-weight: 600;
}

/* Tabla cebra de características estilo MercadoLibre */
.daey-ml-specs-grid {
    display: grid;
    grid-template-columns: 1fr;
    border: 1px solid var(--daey-ml-border);
    border-radius: 12px;
    overflow: hidden;
}

.daey-ml-spec-row {
    display: grid;
    grid-template-columns: 42% 58%;
    border-bottom: 1px solid var(--daey-ml-border);
    font-size: 14px;
    line-height: 1.45;
}

.daey-ml-spec-row:last-child {
    border-bottom: none;
}

.daey-ml-spec-row:nth-child(odd) {
    background: var(--daey-ml-zebra);
}

.daey-ml-spec-row:nth-child(even) {
    background: #ffffff;
}

.daey-ml-spec-key {
    padding: 12px 14px;
    font-weight: 600;
    color: #334155;
    border-right: 1px solid var(--daey-ml-border);
}

.daey-ml-spec-val {
    padding: 12px 14px;
    color: #0f172a;
    word-break: break-word;
}

.daey-ml-spec-row.is-extra-spec {
    display: none;
}

.daey-ml-specs-grid.is-expanded .daey-ml-spec-row.is-extra-spec {
    display: grid;
}

/* Descripción limpia y compacta */
.daey-ml-description-body {
    position: relative;
    font-size: 15px;
    line-height: 1.55;
    color: #334155;
    max-width: 860px;
}

.daey-ml-description-body.is-collapsed {
    max-height: 400px;
    overflow: hidden;
}

.daey-ml-description-body.is-collapsed::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 88px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    pointer-events: none;
}

.daey-ml-description-body p {
    margin: 0 0 10px;
}

.daey-ml-description-body h3,
.daey-ml-description-body h4 {
    margin: 16px 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.daey-ml-description-body ul {
    margin: 0 0 12px;
    padding-left: 20px;
}

.daey-ml-description-body li {
    margin-bottom: 5px;
}

.daey-ml-description-body .daey-legal-note {
    margin-top: 18px;
    padding: 12px 14px;
    background: #f8fafc;
    border-left: 3px solid #94a3b8;
    border-radius: 6px;
    color: #475569;
    font-size: 12.5px;
    line-height: 1.5;
}

/* Botón expandir/colapsar estilo MercadoLibre */
.daey-ml-toggle-btn {
    margin-top: 14px;
    background: none;
    border: none;
    padding: 6px 0;
    color: var(--daey-ml-accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.daey-ml-toggle-btn:hover {
    text-decoration: underline;
    background: none;
    color: #1d4ed8;
}

.daey-ml-toggle-btn.is-hidden {
    display: none;
}

/* Tarjeta de Vendedor y Compra Protegida */
.daey-ml-seller-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.daey-ml-seller-card,
.daey-ml-trust-card {
    border: 1px solid var(--daey-ml-border);
    border-radius: var(--daey-ml-radius);
    padding: 18px;
    background: #ffffff;
}

.daey-ml-seller-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.daey-ml-seller-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--daey-ml-border);
    flex-shrink: 0;
}

.daey-ml-seller-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--daey-ml-accent-soft);
    color: var(--daey-ml-accent);
    font-size: 22px;
    font-weight: 800;
}

.daey-ml-seller-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--daey-ml-green);
    background: var(--daey-ml-green-soft);
    padding: 3px 9px;
    border-radius: 999px;
    margin-bottom: 4px;
}

.daey-ml-seller-name {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

.daey-ml-seller-loc {
    margin: 3px 0 0;
    font-size: 13px;
    color: var(--daey-ml-muted);
}

.daey-ml-seller-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 11px 16px;
    border-radius: 10px;
    background: var(--daey-ml-accent-soft);
    color: var(--daey-ml-accent);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease;
    box-sizing: border-box;
}

.daey-ml-seller-btn:hover {
    background: #dbeafe;
    color: #1d4ed8;
    text-decoration: none;
}

.daey-ml-trust-card {
    background: var(--daey-ml-zebra);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.daey-ml-trust-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.daey-ml-trust-icon {
    font-size: 20px;
    line-height: 1.2;
    flex-shrink: 0;
}

.daey-ml-trust-item strong {
    display: block;
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 2px;
}

.daey-ml-trust-item p {
    margin: 0;
    font-size: 13px;
    color: var(--daey-ml-muted);
    line-height: 1.45;
}

/* Opiniones */
.daey-ml-reviews-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.daey-ml-rating-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--daey-ml-accent-soft);
    padding: 6px 14px;
    border-radius: 999px;
}

.daey-ml-rating-score {
    font-size: 20px;
    font-weight: 800;
    color: var(--daey-ml-accent);
}

.daey-ml-rating-stars {
    color: #f59e0b;
    font-size: 14px;
    letter-spacing: 1px;
}

.daey-ml-rating-count {
    font-size: 12.5px;
    color: var(--daey-ml-muted);
    font-weight: 600;
}

.daey-ml-reviews-body #reviews #comments h2.woocommerce-Reviews-title {
    display: none;
}

@media (max-width: 767px) {
    body.single-product .site-content > .ast-container,
    body.single-product #content .ast-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body.single-product div.product {
        padding: 14px 0 !important;
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-top: 0;
        margin-bottom: 16px;
    }

    body.single-product div.product .summary.entry-summary,
    body.single-product .daey-ml-anchor-nav,
    body.single-product .daey-ml-section {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    body.single-product .daey-ml-wrapper {
        padding: 14px 0 8px !important;
    }

    /* Barra sticky inferior compacta para evitar desborde en 360px */
    body.single-product .ast-sticky-add-to-cart .ast-container {
        padding: 0 10px !important;
    }

    body.single-product .ast-sticky-add-to-cart .ast-sticky-add-to-cart-content {
        gap: 6px !important;
    }

    body.single-product .ast-sticky-add-to-cart .ast-sticky-add-to-cart-title-wrap img {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
    }

    body.single-product .ast-sticky-add-to-cart .ast-sticky-add-to-cart-action-wrap {
        gap: 6px !important;
        flex: 1 1 auto !important;
        justify-content: space-between !important;
        min-width: 0 !important;
    }

    body.single-product .ast-sticky-add-to-cart .ast-sticky-add-to-cart-action-price {
        font-size: 13.5px !important;
        gap: 4px !important;
        padding: 0 !important;
    }

    body.single-product .ast-sticky-add-to-cart .daey-product-tier-badge,
    body.single-product .ast-sticky-add-to-cart [class*="tier"],
    body.single-product .ast-sticky-add-to-cart [class*="pv"] {
        padding: 3px 6px !important;
        font-size: 11px !important;
        white-space: nowrap !important;
    }

    body.single-product .ast-sticky-add-to-cart .button,
    body.single-product .ast-sticky-add-to-cart .single_add_to_cart_button {
        padding: 7px 12px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
}

/* Tablet y Desktop */
@media (min-width: 768px) {
    body.single-product div.product {
        padding: 28px 32px;
    }

    .daey-ml-wrapper {
        padding: 26px 0 8px;
    }

    .daey-ml-section-title {
        font-size: 22px;
    }

    .daey-ml-highlights {
        grid-template-columns: repeat(3, 1fr);
    }

    .daey-ml-specs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .daey-ml-specs-grid .daey-ml-spec-row:nth-child(odd) {
        border-right: 1px solid var(--daey-ml-border);
    }

    .daey-ml-seller-grid {
        grid-template-columns: 1fr 1.35fr;
        align-items: stretch;
    }
}

/* Escritorio amplio: 3 columnas exactas sin huecos entre galería e info */
@media (min-width: 1024px) {
    body.single-product.woocommerce div.product div.images.woocommerce-product-gallery,
    body.single-product.woocommerce-page div.product div.images.woocommerce-product-gallery {
        width: 34% !important;
        max-width: 400px !important;
        float: left !important;
        margin-right: 0 !important;
        margin-bottom: 20px;
    }

    body.single-product.woocommerce div.product div.summary.entry-summary,
    body.single-product.woocommerce-page div.product div.summary.entry-summary {
        width: 63% !important;
        max-width: none !important;
        float: right !important;
        padding-left: 0 !important;
        margin-left: 0 !important;
        margin-bottom: 20px;
    }

    body.single-product div.product div.summary.entry-summary.daey-ml-summary-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 315px;
        gap: 24px;
        align-items: start;
    }

    body.single-product .daey-ml-col-info h1.product_title {
        font-size: 23px;
        line-height: 1.22;
        margin-bottom: 8px;
    }

    body.single-product .daey-ml-col-info p.price {
        font-size: 28px;
        line-height: 1.2;
        margin-bottom: 10px;
    }

    body.single-product .daey-ml-col-buybox {
        position: sticky;
        top: 90px;
        padding: 16px;
    }
}
