/* producto.css - Página de producto (/producto/<id>) y Preguntas frecuentes.
   Usa la paleta de theme.css (fondo hueso, tarjetas blancas, acentos negros). */

/* ---------- Página de producto ---------- */
.pdp-page {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    /* El encabezado es fijo: mismo espacio superior que las demás páginas (seguimiento.css) */
    padding: calc(var(--header-height, 96px) + 24px) 20px 64px;
    min-height: 60vh;
}

.pdp-loading {
    padding: 80px 0;
    text-align: center;
    color: var(--m-muted, #6e6a64);
}

.pdp-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    color: var(--m-muted, #6e6a64);
}

.pdp-breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.pdp-breadcrumb a:hover {
    color: var(--m-ink, #141414);
    text-decoration: underline;
}

.pdp-breadcrumb [aria-current] {
    color: var(--m-ink, #141414);
}

.pdp {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.pdp-media {
    position: sticky;
    top: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    padding: 32px;
    border: 1px solid var(--m-line, #e7e2da);
    border-radius: 18px;
    /* Blanco: las fotos de los productos vienen con fondo blanco y así no se nota el recorte */
    background: #fff;
}

.pdp-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pdp-image--empty {
    width: 60%;
    height: 60%;
    border-radius: 12px;
    background: var(--m-line, #e7e2da);
}

.pdp-brand {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--m-muted, #6e6a64);
    text-decoration: none;
}

.pdp-brand:hover {
    color: var(--m-ink, #141414);
}

.pdp-title {
    margin: 0 0 14px;
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    line-height: 1.2;
    color: var(--m-ink, #141414);
}

.pdp-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}

.pdp-price-final {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--m-ink, #141414);
}

.pdp-price-original {
    font-size: 1rem;
    color: var(--m-muted, #6e6a64);
    text-decoration: line-through;
}

.pdp-price-badge {
    padding: 3px 9px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.pdp-stock {
    margin: 0 0 18px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pdp-stock--ok { color: #1f7a3d; }
.pdp-stock--low { color: #b54708; }
.pdp-stock--out { color: #b42318; }

.pdp-buy {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.pdp-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--m-line, #e7e2da);
    border-radius: 12px;
    background: var(--m-card, #fff);
}

.pdp-qty button {
    width: 42px;
    height: 48px;
    border: 0;
    background: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--m-ink, #141414);
}

.pdp-qty button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.pdp-qty span {
    min-width: 28px;
    text-align: center;
    font-weight: 700;
}

.pdp-add {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border: 0;
    border-radius: 12px;
    background: #111;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.pdp-add:hover {
    background: #333;
}

.pdp-add:disabled {
    background: #bbb;
    cursor: not-allowed;
}

.pdp-share {
    padding: 6px 0;
    border: 0;
    background: none;
    color: var(--m-muted, #6e6a64);
    font-size: 0.82rem;
    text-decoration: underline;
    cursor: pointer;
}

.pdp-perks {
    margin: 18px 0 24px;
    padding: 16px 18px;
    border: 1px solid var(--m-line, #e7e2da);
    border-radius: 14px;
    background: var(--m-card, #fff);
    list-style: none;
    font-size: 0.85rem;
    line-height: 1.6;
}

.pdp-perks a {
    color: inherit;
}

.pdp-section h2 {
    margin: 22px 0 8px;
    font-size: 1rem;
}

.pdp-section p {
    margin: 0;
    line-height: 1.65;
    color: #333;
    white-space: pre-line;
}

.pdp-details {
    display: grid;
    gap: 8px;
    margin: 24px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--m-line, #e7e2da);
    font-size: 0.85rem;
}

.pdp-details div {
    display: flex;
    gap: 12px;
}

.pdp-details dt {
    min-width: 90px;
    color: var(--m-muted, #6e6a64);
}

.pdp-details dd {
    margin: 0;
}

.pdp-related {
    margin-top: 56px;
}

.pdp-related h2 {
    margin-bottom: 16px;
    font-size: 1.2rem;
}

.pdp-related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    max-width: 880px;
}

/* Todas las tarjetas iguales: foto de alto fijo, nombre en 2 líneas y precio abajo */
.pdp-related-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    padding: 12px;
    border: 1px solid var(--m-line, #e7e2da);
    border-radius: 14px;
    background: var(--m-card, #fff);
    color: var(--m-ink, #141414);
    text-decoration: none;
}

.pdp-related-card:hover {
    border-color: #111;
}

.pdp-related-image {
    display: block;
    height: 150px;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.pdp-related-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pdp-related-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
    font-size: 0.82rem;
    line-height: 1.35;
}

.pdp-related-price {
    margin-top: auto;
    font-size: 0.95rem;
    font-weight: 700;
}

.pdp-missing {
    padding: 80px 0;
    text-align: center;
}

.pdp-missing .pdp-add {
    flex: none;
    margin-top: 12px;
}

@media (max-width: 860px) {
    .pdp-page { padding-top: calc(var(--header-height, 80px) + 16px); }
    .faq-page { padding-top: calc(var(--header-height, 80px) + 20px); }

    .pdp {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .pdp-media {
        position: static;
        padding: 20px;
    }

    .pdp-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pdp-related-image {
        height: 130px;
    }
}

/* ---------- Preguntas frecuentes ---------- */
.faq-page {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: calc(var(--header-height, 96px) + 32px) 20px 72px;
}

.faq-eyebrow {
    margin: 0 0 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--m-muted, #6e6a64);
}

.faq-page h1 {
    margin: 0 0 10px;
    font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.faq-lead {
    margin: 0 0 28px;
    color: #444;
    line-height: 1.6;
}

.faq-lead a,
.faq-more a {
    color: inherit;
    font-weight: 600;
}

.faq-group {
    margin: 32px 0 12px;
    font-size: 1.1rem;
}

.faq-item {
    margin-bottom: 10px;
    border: 1px solid var(--m-line, #e7e2da);
    border-radius: 14px;
    background: var(--m-card, #fff);
}

.faq-item summary {
    position: relative;
    padding: 16px 48px 16px 18px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    font-size: 1.3rem;
    font-weight: 400;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item p {
    margin: 0;
    padding: 0 18px 16px;
    line-height: 1.65;
    color: #333;
}

.faq-more {
    margin-top: 28px;
    font-size: 0.9rem;
    color: var(--m-muted, #6e6a64);
}

/* Enlaces del pie en estas páginas */
.footer-links a {
    color: inherit;
}
