/* =============================================================
   SINGLE-PRODUCT.CSS — Página de producto individual
   ============================================================= */

/* ── BREADCRUMB ──────────────────────────────────────────── */
.cd-sp-breadcrumb {
    background: var(--cd-bg-alt);
    border-bottom: 1px solid var(--cd-border-light);
    padding: 0.875rem 0;
}
.cd-sp-breadcrumb nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.875rem;
}
.cd-sp-breadcrumb a {
    color: var(--cd-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.cd-sp-breadcrumb a:hover { color: var(--cd-primary); }
.cd-sp-breadcrumb span:not([aria-hidden]) {
    color: var(--cd-text-light);
    font-weight: 500;
}
.cd-sp-breadcrumb span { color: var(--cd-border); }

/* ── MAIN LAYOUT ─────────────────────────────────────────── */
.cd-sp-main { padding: 3rem 0 4rem; }

.cd-sp-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}
@media (max-width: 900px) {
    .cd-sp-layout { grid-template-columns: 1fr; gap: 2rem; }
}

/* ── GALERÍA ─────────────────────────────────────────────── */
.cd-sp-gallery { display: flex; flex-direction: column; gap: 1.25rem; }

.cd-sp-gallery__main {
    position: relative;
    border-radius: 1.25rem;
    overflow: hidden;
    background: var(--cd-bg-alt);
    aspect-ratio: 4/3;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.cd-sp-gallery__img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.cd-sp-gallery__badge {
    position: absolute;
    top: 16px; left: 16px;
    font-size: 0.75rem;
}
.cd-sp-gallery__placeholder {
    aspect-ratio: 4/3;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, var(--cd-bg-alt), var(--cd-primary-light));
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1rem; color: var(--cd-border);
}
.cd-sp-gallery__placeholder p { color: var(--cd-text-muted); font-size: 0.9rem; margin: 0; }

/* Trust badges */
.cd-sp-trust {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background: var(--cd-bg-alt);
    border-radius: 0.875rem;
    border: 1px solid var(--cd-border-light);
}
.cd-sp-trust__item {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--cd-text-light);
}
.cd-sp-trust__item svg { color: var(--cd-secondary); flex-shrink: 0; }

/* ── INFO PRODUCTO ───────────────────────────────────────── */
.cd-sp-info { display: flex; flex-direction: column; gap: 1.25rem; }

.cd-sp-info__cat {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cd-secondary-dark);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    text-decoration: none;
}
.cd-sp-info__cat:hover { color: var(--cd-primary); }

.cd-sp-info__title {
    font-family: var(--cd-font-display);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--cd-text);
    margin: 0;
}

.cd-sp-info__excerpt {
    font-size: 1rem;
    color: var(--cd-text-light);
    line-height: 1.7;
}
.cd-sp-info__excerpt p { margin: 0; }

/* Precio */
.cd-sp-info__price {
    padding: 1.25rem;
    background: var(--cd-bg-alt);
    border-radius: 0.875rem;
    border: 1px solid var(--cd-border-light);
}
.cd-sp-info__price .woocommerce-Price-amount {
    font-family: var(--cd-font-display);
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--cd-text);
}
.cd-sp-info__price ins { text-decoration: none; }
.cd-sp-info__price del {
    display: block;
    font-size: 1rem;
    color: var(--cd-text-muted);
    font-weight: 400;
    opacity: 0.7;
    margin-bottom: 0.25rem;
}
.cd-sp-info__price .woocommerce-price-suffix {
    font-size: 0.875rem;
    color: var(--cd-text-muted);
    font-weight: 400;
    margin-left: 0.25rem;
}

/* Formulario */
.cd-sp-info__form { display: flex; flex-direction: column; gap: 0.875rem; }

.cd-sp-qty-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.cd-sp-qty {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--cd-border);
    border-radius: 0.5rem;
    overflow: hidden;
    height: 48px;
}
.cd-sp-qty__btn {
    width: 40px; height: 100%;
    background: var(--cd-bg-alt);
    border: none; cursor: pointer;
    font-size: 1.25rem; font-weight: 500;
    color: var(--cd-text-light);
    transition: background 0.2s, color 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.cd-sp-qty__btn:hover { background: var(--cd-primary); color: #fff; }
.cd-sp-qty__input {
    width: 52px; height: 100%;
    text-align: center;
    border: none; border-left: 1.5px solid var(--cd-border); border-right: 1.5px solid var(--cd-border);
    font-family: var(--cd-font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--cd-text);
    -moz-appearance: textfield;
}
.cd-sp-qty__input::-webkit-outer-spin-button,
.cd-sp-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; }
.cd-sp-qty__input:focus { outline: none; }

.cd-sp-cta {
    flex: 1;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    min-height: 48px;
    min-width: 180px;
}

/* Meta */
.cd-sp-info__meta {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding-top: 1rem;
    border-top: 1px solid var(--cd-border-light);
}
.cd-sp-info__meta span {
    font-size: 0.875rem;
    color: var(--cd-text-muted);
}
.cd-sp-info__meta a { color: var(--cd-primary); text-decoration: none; }
.cd-sp-info__meta a:hover { text-decoration: underline; }

/* ── TABS ────────────────────────────────────────────────── */
.cd-sp-tabs-section {
    padding: 0 0 4rem;
    border-top: 1px solid var(--cd-border-light);
}
.cd-sp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--cd-border-light);
    margin-bottom: 2.5rem;
}
.cd-sp-tab {
    padding: 1rem 1.75rem;
    font-family: var(--cd-font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cd-text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.2s;
    margin-bottom: -2px;
}
.cd-sp-tab:hover { color: var(--cd-text); }
.cd-sp-tab--active {
    color: var(--cd-primary);
    border-bottom-color: var(--cd-primary);
}

.cd-sp-tab-content { display: none; }
.cd-sp-tab-content--active { display: block; }

/* Prose (contenido largo) */
.cd-prose {
    max-width: 740px;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--cd-text-light);
}
.cd-prose p { margin-bottom: 1.25rem; }
.cd-prose h2 { font-size: 1.5rem; font-weight: 700; color: var(--cd-text); margin: 2rem 0 1rem; }
.cd-prose h3 { font-size: 1.25rem; font-weight: 700; color: var(--cd-text); margin: 1.5rem 0 0.75rem; }
.cd-prose ul, .cd-prose ol { padding-left: 1.75rem; margin-bottom: 1.25rem; }
.cd-prose li { margin-bottom: 0.5rem; }
.cd-prose strong { font-weight: 700; color: var(--cd-text); }
.cd-prose a { color: var(--cd-primary); }
.cd-prose img { max-width: 100%; border-radius: 0.75rem; margin: 1.5rem 0; }
.cd-prose blockquote {
    border-left: 4px solid var(--cd-primary);
    padding: 1rem 1.5rem;
    background: var(--cd-primary-light);
    border-radius: 0 0.5rem 0.5rem 0;
    margin: 1.5rem 0;
    color: var(--cd-text);
    font-style: italic;
}

/* Valoraciones de WooCommerce */
.cd-sp-tab-content #reviews { padding: 0; }
.cd-sp-tab-content .comment-form-rating .stars a {
    font-size: 1.5rem;
    color: var(--cd-border);
    text-decoration: none;
}
.cd-sp-tab-content .comment-form-rating .stars a:hover,
.cd-sp-tab-content .comment-form-rating .stars.selected a { color: #F59E0B; }

.cd-sp-tab-content input[type="text"],
.cd-sp-tab-content input[type="email"],
.cd-sp-tab-content textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--cd-border);
    border-radius: 0.5rem;
    font-family: var(--cd-font-body);
    font-size: 0.9rem;
    color: var(--cd-text);
    transition: border-color 0.2s;
    background: var(--cd-bg);
}
.cd-sp-tab-content input:focus,
.cd-sp-tab-content textarea:focus {
    outline: none;
    border-color: var(--cd-primary);
    box-shadow: 0 0 0 3px rgba(0,102,255,0.08);
}
.cd-sp-tab-content .submit input[type="submit"],
.cd-sp-tab-content button[type="submit"] {
    background: var(--cd-primary);
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-family: var(--cd-font-display);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}
.cd-sp-tab-content .submit input:hover,
.cd-sp-tab-content button[type="submit"]:hover { background: var(--cd-primary-dark); }

.cd-sp-no-reviews { color: var(--cd-text-muted); font-size: 0.9rem; }

/* ── RELACIONADOS ────────────────────────────────────────── */
.cd-sp-related {
    padding: 3rem 0 5rem;
    background: var(--cd-bg-alt);
    border-top: 1px solid var(--cd-border-light);
}
.cd-sp-related__title {
    font-family: var(--cd-font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--cd-text);
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .cd-sp-main { padding: 1.5rem 0 2.5rem; }
    .cd-sp-info__price .woocommerce-Price-amount { font-size: 1.75rem; }
    .cd-sp-trust { gap: 0.875rem; }
    .cd-sp-trust__item { font-size: 0.75rem; }
    .cd-sp-tabs { overflow-x: auto; }
    .cd-sp-tab { padding: 0.875rem 1.25rem; white-space: nowrap; }
    .cd-sp-qty-row { flex-direction: column; align-items: stretch; }
    .cd-sp-cta { width: 100%; }
}
@media (max-width: 480px) {
    .cd-sp-gallery__main { aspect-ratio: 4/3; }
    .cd-sp-info__title { font-size: 1.5rem; }
    .cd-product-card__footer { flex-direction: column; align-items: stretch; }
    .cd-product-card__footer .cd-btn { width: 100%; text-align: center; justify-content: center; }
}
