:root {
    --ink: #1a1a1a;
    --muted: #6b6b6b;
    --line: #e3e3e3;
    --soft: #f7f7f7;
    --accent: #8a6d3b;
    --error: #b42318;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #fff;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

a { color: inherit; }

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1120px;
    margin: 0 auto;
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
}

.brand img {
    display: block;
    height: 34px;
    width: auto;
    filter: brightness(0);
}

.secure-label { color: var(--muted); font-size: 13px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 40px 24px 80px; }
.wrap.narrow { max-width: 620px; }

.eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 34px; font-weight: 600; }
h2 { font-size: 24px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }

.btn {
    display: inline-block;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 14px 20px;
    font: inherit;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover:not(:disabled) { background: #333; }
.btn-dark:disabled { opacity: .5; cursor: not-allowed; }
.btn-light { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-small { padding: 6px 10px; font-size: 12px; }
.btn-pay { width: 100%; padding: 16px; font-size: 16px; }

/* Producto */
.product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    padding-bottom: 56px;
    border-bottom: 1px solid var(--line);
}

.product-photo {
    background: var(--soft);
    border-radius: 6px;
    padding: 32px;
    text-align: center;
}

.product-photo img { max-width: 100%; max-height: 420px; }
.product-subtitle { color: var(--muted); margin: 0 0 16px; }
.product-description { margin: 0 0 24px; max-width: 52ch; }

.price-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.price-link {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13px;
    text-decoration: none;
    color: var(--muted);
}

.price-link.is-active { border-color: var(--ink); color: var(--ink); font-weight: 600; }

.product-price { display: flex; align-items: baseline; gap: 10px; margin: 0 0 20px; }
.product-price strong { font-size: 30px; font-weight: 600; }
.product-price span { color: var(--muted); font-size: 13px; }

/* Checkout */
.checkout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 48px;
    padding: 56px 0;
    border-bottom: 1px solid var(--line);
}

.checkout-intro { color: var(--muted); margin: 0 0 8px; }
.form-block { padding: 24px 0; border-top: 1px solid var(--line); }
.form-block:first-of-type { border-top: 0; }

.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-short { max-width: 260px; }

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
}

.field input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #c8c8c8;
    border-radius: 4px;
    font: inherit;
    font-size: 16px;
    background: #fff;
}

.field input:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.req { color: var(--error); }
.optional { color: var(--muted); font-weight: 400; }
.error { display: block; min-height: 0; margin-top: 4px; color: var(--error); font-size: 12px; }
.form-error { color: var(--error); font-size: 13px; }

.shipping-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--ink);
    border-radius: 4px;
    background: var(--soft);
}

.shipping-option small { display: block; color: var(--muted); }
.shipping-option > strong:last-child { margin-left: auto; }
.radio-ui {
    width: 16px; height: 16px; border: 1px solid var(--ink); border-radius: 50%;
    background: radial-gradient(circle, var(--ink) 0 45%, transparent 46%);
    flex: none;
}

.pay-note { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
#payment-element { margin-bottom: 12px; }
.payment-message { color: var(--error); font-size: 13px; min-height: 18px; }
.trust-line { color: var(--muted); font-size: 12px; text-align: center; margin: 12px 0 0; }

.summary {
    position: sticky;
    top: 20px;
    align-self: start;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 22px;
}

.summary h2 { font-size: 18px; }
.summary-product { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.summary-product img { width: 72px; height: 72px; object-fit: contain; border-radius: 4px; background: #fff; }
.summary-product strong { display: block; font-size: 13px; }
.summary-product small { display: block; color: var(--muted); font-size: 12px; }
.summary-product span { display: block; margin-top: 4px; font-size: 13px; }

.qty-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
.qty-control { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.qty-control button { width: 32px; height: 32px; border: 0; background: none; cursor: pointer; font-size: 16px; }
.qty-control span { min-width: 24px; text-align: center; }

.summary-lines { padding: 14px 0 0; }
.summary-lines > div { display: flex; justify-content: space-between; margin-bottom: 8px; }
.summary-total { padding-top: 12px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 600; }
.summary-note { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

/* Historia */
.story { padding: 56px 0 0; }
.story-intro { color: var(--muted); }
.story audio { width: 100%; margin: 12px 0 28px; }

.tab-list { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tab-button {
    border: 0; border-bottom: 2px solid transparent; background: none;
    padding: 10px 12px; cursor: pointer; color: var(--muted); font: inherit; font-size: 13px;
}
.tab-button.is-active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tab-panel { padding: 20px 4px; max-width: 78ch; white-space: normal; color: #333; }

/* Confirmación */
.confirm-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 36px;
    text-align: center;
    background: #fff;
}

.confirm-icon {
    width: 56px; height: 56px; margin: 0 auto 18px;
    border-radius: 50%; background: #e7f4ea; color: #1a7f37;
    display: flex; align-items: center; justify-content: center; font-size: 28px;
}

.confirm-details { text-align: left; margin: 24px 0; border-top: 1px solid var(--line); }
.confirm-details div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.confirm-details dt { color: var(--muted); }
.confirm-details dd { margin: 0; text-align: right; }
.confirm-note { color: var(--muted); font-size: 13px; }

.site-footer {
    border-top: 1px solid var(--line);
    padding: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

/* Admin */
.admin-login-page, .admin-page { background: var(--soft); }
.admin-login { max-width: 380px; margin: 12vh auto; padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 32px 24px 60px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; }
.admin-flash { padding: 10px 14px; background: #e7f4ea; color: #1a7f37; border-radius: 4px; }
.admin-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.admin-filters a { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 12px; background: #fff; }
.admin-filters a.is-active { background: var(--ink); color: #fff; }
.admin-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.admin-table th { background: var(--soft); font-size: 12px; }
.admin-table small { display: block; color: var(--muted); font-size: 11px; }
.admin-table select { padding: 6px; border: 1px solid var(--line); border-radius: 4px; font: inherit; }
.admin-empty { text-align: center; color: var(--muted); padding: 30px; }

@media (max-width: 900px) {
    .product, .checkout { grid-template-columns: 1fr; gap: 28px; }
    .summary { position: static; }
}

@media (max-width: 520px) {
    .field-row { grid-template-columns: 1fr; gap: 0; }
    h1 { font-size: 28px; }
    .secure-label { display: none; }
}

/* Botones redondeados */
.btn-pill { border-radius: 8px; padding-left: 28px; padding-right: 28px; }

/* Galería del producto */
.product-photo { padding: 24px; }
.gallery > #main-photo { display: block; width: 100%; max-height: 420px; object-fit: contain; border-radius: 6px; background: #fff; }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 0; }
.thumb {
    flex: 0 0 64px; height: 64px; padding: 0; border: 2px solid transparent;
    border-radius: 6px; background: var(--soft); cursor: pointer; overflow: hidden;
}
.thumb.is-active { border-color: var(--ink); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Información del aceite */
.info { padding: 56px 0; border-bottom: 1px solid var(--line); }
.info-intro { color: var(--muted); }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.info-card { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.info-card img { display: block; width: 100%; height: 200px; object-fit: cover; background: var(--soft); }
.info-card h3 { margin: 16px 16px 6px; }
.info-card p { margin: 0 16px 18px; color: #444; }

/* Reproductor de audio */
.audio-player {
    display: flex; align-items: center; gap: 18px; padding: 14px; margin: 12px 0 28px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--soft);
}
.audio-cover { width: 92px; height: 92px; border-radius: 8px; object-fit: cover; flex: none; }
.audio-body { flex: 1; min-width: 0; }
.audio-title { margin: 0 0 10px; font-weight: 600; }
.audio-controls { display: flex; align-items: center; gap: 12px; }
.audio-play {
    width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%;
    background: var(--ink); color: #fff; font-size: 16px; cursor: pointer;
}
.audio-progress { flex: 1; min-width: 80px; accent-color: var(--ink); cursor: pointer; }
.audio-volume { width: 90px; accent-color: var(--ink); }
.audio-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
#leyenda-audio { display: none; }

@media (max-width: 700px) {
    .info-grid { grid-template-columns: 1fr; }
    .audio-player { flex-direction: column; align-items: stretch; }
    .audio-cover { width: 100%; height: 180px; }
    .audio-volume { display: none; }
}

/* Pie de página */
.site-footer { padding: 32px 24px; }
.footer-inner {
    max-width: 1120px; margin: 0 auto;
    display: flex; flex-direction: column; gap: 18px;
}
.footer-top { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-brand img { height: 30px; width: auto; filter: brightness(0); }
.footer-credit { margin: 0; text-align: right; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; max-width: 640px; }
.footer-links a { font-size: 13px; text-decoration: none; border-bottom: 1px solid transparent; }
.footer-links a:hover { border-bottom-color: var(--ink); }

/* Detalle de pedido en el admin */
.admin-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 18px; }
.admin-detail section { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 20px; }
.admin-detail h2 { font-size: 18px; }
.admin-detail select { margin-right: 8px; }
.legal-page h1 { margin-bottom: 20px; }
.legal-text { color: #333; }
.legal-text p { margin: 0 0 14px; }

@media (max-width: 700px) {
    .admin-detail { grid-template-columns: 1fr; }
    .footer-credit { text-align: left; }
}

/* Detalle desplegable de pedidos en el admin */
.order-toggle { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; }
.order-details-row td { background: var(--soft); padding: 18px 20px; }
.order-details-row h2 { font-size: 16px; margin: 0 0 12px; }
.order-details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; max-width: 720px; }
.order-details-grid div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 6px 0; font-size: 13px; }
.order-details-grid dt { color: var(--muted); }
.order-details-grid dd { margin: 0; text-align: right; }
@media (max-width: 700px) { .order-details-grid { grid-template-columns: 1fr; } }
