/*
|--------------------------------------------------------------------------
| MiHariMASA public storefront CSS
|--------------------------------------------------------------------------
| Archivo sugerido:
| /assets/css/public-shop.css
|
| Uso:
| region.php
| shop.php
| product.php
|--------------------------------------------------------------------------
*/

/* =========================================================
   Base pública
   ========================================================= */

:root {
    --brand: #b3261e;
    --brand-dark: #8f1e18;
    --text: #2b211d;
    --muted: #766b66;
    --border: #eee;
    --bg: #faf7f3;
    --card: #fff;
    --success: #226622;
    --danger: #9b1c1c;
    --warning: #8a6500;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
}

/* =========================================================
   region.php - estados básicos / not found
   ========================================================= */

.not-found {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.not-found-card {
    max-width: 520px;
    background: #fff;
    border-radius: 18px;
    padding: 34px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.08);
}

.not-found-card h1 {
    margin: 0 0 10px;
    font-size: 30px;
}

.not-found-card p {
    color: #666;
    line-height: 1.6;
}

.not-found-card a {
    display: inline-block;
    margin-top: 14px;
    background: #111827;
    color: #fff;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 700;
}

/* =========================================================
   Componentes compartidos tienda
   ========================================================= */

.shop-announcement {
    background: #111827;
    color: #fff7ed;
    text-align: center;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 800;
}

.shop-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.shop-container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.shop-topbar-inner {
    min-height: 88px;
    padding: 9px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.shop-brand-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    flex: 1 1 auto;
}

.shop-brand-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.shop-brand {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    line-height: 1.15;
}

.shop-brand strong {
    display: block;
    font-size: 18px;
    color: var(--text);
}

.shop-brand span {
    display: block;
    font-size: 15px;
    color: var(--muted);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f97316, #facc15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 900;
    flex-shrink: 0;
}

.shop-nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
    flex-shrink: 0;
    width: auto;
}

.shop-link-button,
.shop-cart-button,
.shop-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.shop-link-button {
    border: 1px solid var(--border);
    border-radius: 999px;
    min-height: 42px;
    padding: 0 15px;
    background: #fff;
    font-size: 14px;
    color: var(--text);
    line-height: 1;
}

.shop-cart-button {
    gap: 8px;
    background: var(--brand);
    color: #fff;
    border-radius: 999px;
    min-height: 42px;
    padding: 0 16px;
    font-size: 14px;
    line-height: 1;
}

.shop-cart-button:hover,
.shop-button:hover {
    background: var(--brand-dark);
}

.shop-cart-button span {
    font-size: 12px;
    font-weight: 800;
    opacity: .92;
}

.shop-button {
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 14px;
}

.shop-button-secondary {
    background: #fff;
    color: var(--brand);
    border: 1px solid var(--brand);
}

.shop-button-secondary:hover {
    background: #fff7f4;
}

.shop-alert-success,
.shop-alert-error {
    border-radius: 14px;
    padding: 13px 15px;
    margin: 16px 0;
    font-size: 14px;
}

.shop-alert-success {
    background: #e7f7e7;
    color: var(--success);
    border: 1px solid #cceccc;
}

.shop-alert-error {
    background: #ffe4e4;
    color: var(--danger);
    border: 1px solid #ffd0d0;
}

.shop-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: bold;
    background: #eee;
    color: #555;
}

.shop-badge-green {
    background: #e7f7e7;
    color: var(--success);
}

.shop-badge-yellow {
    background: #fff5d6;
    color: var(--warning);
}

.shop-badge-dark {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.shop-empty {
    background: #fafafa;
    border: 1px dashed #ddd;
    border-radius: 16px;
    padding: 22px;
    color: var(--muted);
    line-height: 1.6;
}

.shop-footer {
    padding: 28px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    background: #fff;
}

/* =========================================================
   shop.php - catálogo
   ========================================================= */

.shop-hero {
    padding: 42px 0 24px;
}

.shop-hero-card {
    background: linear-gradient(135deg, #fff, #fff7f4);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 18px 45px rgba(0,0,0,.06);
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 22px;
    align-items: center;
}

.shop-hero-card h1 {
    margin: 0;
    font-size: clamp(28px, 5vw, 46px);
    line-height: 1.08;
}

.shop-hero-card p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
    max-width: 780px;
}

.shop-hero-side {
    background: #111827;
    color: #fff;
    border-radius: 22px;
    padding: 22px;
}

.shop-hero-side strong {
    display: block;
    font-size: 20px;
    margin-bottom: 8px;
}

.shop-hero-side span {
    display: block;
    color: #e5e7eb;
    line-height: 1.55;
}

.shop-hero-actions,
.shop-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.shop-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--border);
    color: #555;
    border-radius: 999px;
    padding: 8px 11px;
    font-size: 13px;
}

.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 22px;
    align-items: start;
    padding: 22px 0 50px;
}

#shop-catalogo,
#productos {
    scroll-margin-top: 18px;
}

.shop-sidebar,
.shop-main-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0,0,0,.05);
}

.shop-sidebar {
    padding: 18px;
    position: sticky;
    top: 108px;
}

.shop-sidebar h2 {
    margin: 0 0 12px;
    font-size: 17px;
}

.shop-search {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.shop-search input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 14px;
}

.shop-category-list {
    display: grid;
    gap: 8px;
}

.shop-category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 10px 11px;
    color: var(--text);
    background: #fff;
    font-size: 14px;
}

.shop-category-link:hover,
.shop-category-link.active {
    border-color: var(--brand);
    background: #fff7f4;
    color: var(--brand);
}

.shop-category-count {
    color: var(--muted);
    font-size: 12px;
}

.shop-delivery-box {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.shop-delivery-zone {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 10px;
    margin-bottom: 8px;
    background: #fff;
}

.shop-main-card {
    padding: 20px;
}

.shop-main-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.shop-main-header h2 {
    margin: 0;
    font-size: 22px;
}

.shop-main-header span {
    color: var(--muted);
    font-size: 13px;
}

.shop-products-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.shop-product-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.shop-product-card.is-added {
    border-color: #16a34a;
    box-shadow: 0 18px 45px rgba(22, 163, 74, .15);
}

.shop-product-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 34px;
    overflow: hidden;
}

.shop-product-image img {
    height: 100%;
    object-fit: cover;
    display: block;
}

.shop-product-link,
.shop-product-title-link {
    text-decoration: none;
    color: inherit;
}

.shop-product-title-link:hover {
    color: var(--brand);
}

.shop-product-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.shop-product-body h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.3;
}

.shop-product-description {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    min-height: 38px;
}

.shop-product-price {
    font-size: 19px;
    font-weight: bold;
    color: var(--brand);
}

.shop-product-compare {
    color: #999;
    font-size: 13px;
    text-decoration: line-through;
    margin-left: 6px;
    font-weight: normal;
}

.shop-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.shop-add-form {
    margin-top: auto;
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 8px;
}

.shop-add-form input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 10px;
    font-size: 14px;
}

.shop-add-form .shop-button.is-added-button {
    background: #16a34a;
}

.shop-add-form .shop-button.is-submitting {
    opacity: .9;
    transform: scale(.98);
}

/* =========================================================
   product.php - ficha de producto
   ========================================================= */

.product-wrap {
    padding: 26px 0 62px;
}

.product-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 16px;
}

.product-breadcrumb a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 800;
}

.product-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(0,0,0,.06);
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    gap: 0;
}

.product-media {
    background: #fffaf7;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px;
    border-right: 1px solid var(--border);
}

.product-media img {
    max-width: 100%;
    max-height: 560px;
    object-fit: contain;
    display: block;
    border-radius: 18px;
}

.product-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 2px dashed #eadfd8;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b09d92;
    font-size: 56px;
}

.product-info {
    padding: 30px;
}

.product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.product-info h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.06;
}

.product-short {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.65;
    margin: 14px 0 0;
}

.product-price {
    color: var(--brand);
    font-weight: 900;
    font-size: clamp(28px, 4vw, 40px);
    margin-top: 20px;
}

.product-compare {
    color: #999;
    font-size: 17px;
    text-decoration: line-through;
    margin-left: 8px;
    font-weight: 500;
}

.product-detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.product-detail-item {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 14px;
    padding: 11px 12px;
    color: var(--muted);
    font-size: 13px;
}

.product-detail-item strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 3px;
}

.product-form {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    display: grid;
    gap: 14px;
}

.product-qty-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.product-qty-row label {
    font-weight: 800;
}

.product-qty-row input {
    width: 120px;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 12px;
    font-size: 16px;
    font-weight: 800;
}

.product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.product-description-card,
.related-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 12px 35px rgba(0,0,0,.05);
    margin-top: 22px;
    padding: 24px;
}

.product-description-card h2,
.related-card h2 {
    margin: 0 0 12px;
    font-size: 22px;
}

.product-description-body {
    color: #4b403b;
    line-height: 1.75;
    font-size: 15px;
}

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

.related-product {
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    text-decoration: none;
    display: block;
}

.related-image {
    aspect-ratio: 4 / 3;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 30px;
}

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

.related-body {
    padding: 12px;
}

.related-body strong {
    display: block;
    font-size: 14px;
    line-height: 1.35;
    margin-bottom: 7px;
}

.related-price {
    color: var(--brand);
    font-weight: 900;
    font-size: 15px;
}

/* =========================================================
   Carrito flotante / confirmación
   Soporta nombres usados en shop.php y product.php
   ========================================================= */

.shop-cart-floating,
.shop-floating-cart {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 80;
    width: 62px;
    height: 62px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 18px 38px rgba(179, 38, 30, .32);
    border: 3px solid #fff;
    font-size: 26px;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.shop-cart-floating:hover,
.shop-floating-cart:hover {
    transform: translateY(-2px) scale(1.03);
    background: var(--brand-dark);
    box-shadow: 0 20px 44px rgba(179, 38, 30, .40);
}

.shop-cart-floating-badge,
.shop-floating-cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 25px;
    height: 25px;
    padding: 0 7px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    border: 2px solid #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.shop-cart-toast,
.shop-toast {
    position: fixed;
    left: 50%;
    bottom: 92px;
    transform: translate(-50%, 18px);
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #111827;
    color: #fff;
    border-radius: 999px;
    padding: 12px 17px 12px 12px;
    box-shadow: 0 18px 45px rgba(0,0,0,.20);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
    font-size: 14px;
    font-weight: 800;
}

.shop-cart-toast.is-visible,
.shop-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.shop-cart-toast-check,
.shop-added-check {
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    flex-shrink: 0;
}

.shop-cart-toast-check {
    width: 28px;
    height: 28px;
}

.shop-added-check {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 34px;
    height: 34px;
    font-size: 18px;
    box-shadow: 0 10px 24px rgba(22, 163, 74, .30);
    opacity: 0;
    transform: scale(.7);
    transition: opacity .22s ease, transform .22s ease;
}

.shop-product-card.is-added .shop-added-check,
.shop-added-check.show {
    opacity: 1;
    transform: scale(1);
}

.product-add-confirmation {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    color: var(--success);
    font-weight: 900;
}

/* Ajuste específico para product.php:
   la palomita debe vivir dentro del mensaje, no flotando arriba/derecha. */
.product-add-confirmation .shop-added-check {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    width: 52px;
    height: 52px;
    font-size: 30px;
    display: inline-flex;
    box-shadow: 0 16px 30px rgba(22, 163, 74, .35);
    opacity: 0;
    transform: scale(.85);
    transition: opacity .2s ease, transform .2s ease;
}

.product-add-confirmation .shop-added-check.show {
    opacity: 1;
    transform: scale(1);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1050px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }

    .shop-sidebar {
        position: static;
    }

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

@media (max-width: 860px) {
    .product-card {
        grid-template-columns: 1fr;
    }

    .product-media {
        border-right: 0;
        border-bottom: 1px solid var(--border);
        min-height: 300px;
    }

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

    .shop-topbar-inner {
        min-height: 76px;
    }

    .shop-brand-logo {
        width: 58px;
        height: 58px;
    }
}

@media (max-width: 760px) {
    .shop-hero-card {
        display: block;
    }

    .shop-hero-side {
        margin-top: 18px;
    }
}

@media (max-width: 650px) {
    .shop-container {
        width: min(100% - 20px, 1180px);
    }

    .shop-announcement {
        font-size: 12px;
        padding: 8px 10px;
    }

    .shop-topbar-inner {
        min-height: 74px;
        padding: 8px 0;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .shop-brand-wrap {
        gap: 8px;
        flex: 1 1 auto;
        min-width: 0;
    }

    .shop-brand-logo {
        width: 56px;
        height: 56px;
    }

    .shop-brand span {
        max-width: 150px;
        font-size: 12px;
    }

    .shop-nav-actions {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 7px;
        flex-wrap: nowrap;
        flex-shrink: 0;
        width: auto;
    }

    .shop-link-button,
    .shop-cart-button {
        width: auto;
        min-height: 38px;
        padding: 0 11px;
        font-size: 12px;
        margin-top: 0;
    }

    .shop-cart-button span {
        display: none;
    }

    .shop-hero {
        padding-top: 24px;
    }

    .shop-hero-card {
        padding: 22px;
    }

    .shop-main-header {
        display: block;
    }

    .shop-products-grid {
        grid-template-columns: 1fr;
    }

    .shop-cart-floating,
    .shop-floating-cart {
        right: 14px;
        bottom: 14px;
        width: 58px;
        height: 58px;
        font-size: 24px;
    }

    .shop-cart-toast,
    .shop-toast {
        width: calc(100% - 28px);
        justify-content: center;
        border-radius: 18px;
        bottom: 84px;
    }
}

@media (max-width: 560px) {
    .shop-container {
        width: min(100% - 22px, 1180px);
    }

    .product-wrap {
        padding-top: 16px;
    }

    .product-info {
        padding: 20px;
    }

    .product-detail-list {
        grid-template-columns: 1fr;
    }

    .product-actions {
        display: grid;
    }

    .product-actions .shop-button {
        width: 100%;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .shop-cart-button {
        padding: 0 12px;
    }

    .shop-cart-button span {
        display: none;
    }
}

@media (max-width: 430px) {
    .shop-container {
        width: min(100% - 16px, 1180px);
    }

    .shop-topbar-inner {
        min-height: 66px;
        gap: 6px;
    }

    .shop-brand-wrap {
        flex: 0 0 auto;
        width: auto;
    }

    .shop-brand-logo {
        width: 78px;
        height: 78px;
    }

    .shop-brand {
        display: none;
    }

    .shop-nav-actions {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        flex-wrap: nowrap;
        flex: 1 1 auto;
        min-width: 0;
    }

    .shop-link-button,
    .shop-cart-button {
        width: auto;
        min-height: 34px;
        padding: 0 10px;
        font-size: 11px;
        white-space: nowrap;
    }

    .shop-cart-button span {
        display: none;
    }
}

@media (max-width: 360px) {
    .shop-brand-logo {
        width: 46px;
        height: 46px;
    }

    .shop-nav-actions {
        gap: 5px;
    }

    .shop-link-button,
    .shop-cart-button {
        min-height: 32px;
        padding: 0 8px;
        font-size: 10.5px;
    }
}

/* =========================================================
   cart.php
   ========================================================= */

.cart-container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.cart-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.cart-topbar-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.cart-brand {
    text-decoration: none;
    color: var(--text);
}

.cart-brand strong {
    display: block;
    font-size: 18px;
}

.cart-brand span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

.cart-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: 11px 15px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.cart-button:hover {
    background: var(--brand-dark);
}

.cart-button-secondary {
    background: #fff;
    color: var(--brand);
    border: 1px solid var(--brand);
}

.cart-button-secondary:hover {
    background: #fff7f4;
}

.cart-button-danger {
    background: #fff;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.cart-button-danger:hover {
    background: #fff3f3;
}

.cart-button-disabled {
    opacity: .55;
    pointer-events: none;
}

.cart-hero {
    padding: 36px 0 20px;
}

.cart-hero-card {
    background: linear-gradient(135deg, #fff, #fff7f4);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 18px 45px rgba(0,0,0,.06);
}

.cart-hero-card h1 {
    margin: 0;
    font-size: clamp(28px, 5vw, 42px);
    line-height: 1.08;
}

.cart-hero-card p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.cart-alert-success,
.cart-alert-error,
.cart-alert-warning {
    border-radius: 14px;
    padding: 13px 15px;
    margin: 16px 0;
    font-size: 14px;
}

.cart-alert-success {
    background: #e7f7e7;
    color: var(--success);
    border: 1px solid #cceccc;
}

.cart-alert-error {
    background: #ffe4e4;
    color: var(--danger);
    border: 1px solid #ffd0d0;
}

.cart-alert-warning {
    background: #fff5d6;
    color: var(--warning);
    border: 1px solid #f7e2a1;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 22px;
    align-items: start;
    padding: 22px 0 50px;
}

.cart-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0,0,0,.05);
    padding: 20px;
}

.cart-card h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

.cart-empty {
    background: #fafafa;
    border: 1px dashed #ddd;
    border-radius: 16px;
    padding: 22px;
    color: var(--muted);
    line-height: 1.6;
}

.cart-items {
    display: grid;
    gap: 14px;
}

.cart-item {
    display: grid;
    grid-template-columns: 86px 1fr 120px 120px 80px;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    background: #fff;
}

.cart-item-image {
    width: 86px;
    height: 86px;
    border-radius: 14px;
    background: #fafafa;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 28px;
    overflow: hidden;
}

.cart-item-image img {
    height: 100%;
    object-fit: cover;
    display: block;
}

.cart-item-title strong {
    display: block;
    font-size: 16px;
    line-height: 1.35;
}

.cart-muted {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    margin-top: 4px;
}

.cart-item-price strong,
.cart-item-total strong {
    display: block;
    font-size: 15px;
}

.cart-quantity input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 10px;
    font-size: 14px;
}

.cart-remove-form {
    margin: 0;
}

.cart-remove-button {
    width: 100%;
    border: 1px solid #ddd;
    background: #fff;
    color: var(--danger);
    border-radius: 12px;
    padding: 9px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
}

.cart-remove-button:hover {
    border-color: var(--danger);
    background: #fff3f3;
}

.cart-auto-status {
    align-self: center;
    color: var(--success);
    font-size: 13px;
    font-weight: bold;
    min-height: 18px;
}

.cart-quantity-input.is-dirty {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(179,38,30,.10);
}

.cart-quantity-input.is-saving {
    opacity: .7;
}

.cart-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.cart-actions-left,
.cart-actions-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cart-summary {
    position: sticky;
    top: 88px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.cart-summary-row strong {
    font-size: 18px;
}

.cart-summary-total {
    border-bottom: 0;
    padding-top: 16px;
}

.cart-summary-total span,
.cart-summary-total strong {
    font-size: 21px;
    color: var(--brand);
}

.cart-summary-actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.cart-shop-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.cart-footer {
    padding: 28px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    background: #fff;
}

/* =========================================================
   checkout.php
   ========================================================= */

.checkout-container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.checkout-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.checkout-topbar-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.checkout-brand {
    text-decoration: none;
    color: var(--text);
}

.checkout-brand strong {
    display: block;
    font-size: 18px;
}

.checkout-brand span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

.checkout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: 11px 15px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.checkout-button:hover {
    background: var(--brand-dark);
}

.checkout-button-secondary {
    background: #fff;
    color: var(--brand);
    border: 1px solid var(--brand);
}

.checkout-button-secondary:hover {
    background: #fff7f4;
}

.checkout-hero {
    padding: 36px 0 20px;
}

.checkout-hero-card {
    background: linear-gradient(135deg, #fff, #fff7f4);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 18px 45px rgba(0,0,0,.06);
}

.checkout-hero-card h1 {
    margin: 0;
    font-size: clamp(28px, 5vw, 42px);
    line-height: 1.08;
}

.checkout-hero-card p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.checkout-alert-success,
.checkout-alert-error,
.checkout-alert-warning {
    border-radius: 14px;
    padding: 13px 15px;
    margin: 16px 0;
    font-size: 14px;
}

.checkout-alert-success {
    background: #e7f7e7;
    color: var(--success);
    border: 1px solid #cceccc;
}

.checkout-alert-error {
    background: #ffe4e4;
    color: var(--danger);
    border: 1px solid #ffd0d0;
}

.checkout-alert-warning {
    background: #fff5d6;
    color: var(--warning);
    border: 1px solid #f7e2a1;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 22px;
    align-items: start;
    padding: 22px 0 50px;
}

.checkout-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0,0,0,.05);
    padding: 20px;
}

.checkout-card h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

.checkout-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.checkout-form-full {
    grid-column: 1 / -1;
}

.checkout-field label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    color: #444;
    margin-bottom: 6px;
}

.checkout-field input,
.checkout-field select,
.checkout-field textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 14px;
    background: #fff;
}

.checkout-field textarea {
    min-height: 90px;
    resize: vertical;
}

.checkout-help {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    margin-top: 5px;
}

.checkout-radio-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.checkout-radio {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 12px;
    font-size: 13px;
    color: #333;
}

.checkout-radio input {
    width: auto;
    margin-top: 2px;
}

.checkout-summary {
    position: sticky;
    top: 88px;
}

.checkout-items {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.checkout-item {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.checkout-item-img {
    width: 58px;
    height: 58px;
    border-radius: 12px;
    background: #fafafa;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #aaa;
    font-size: 22px;
}

.checkout-item-img img {
    /*width: 100%;*/
    height: 100%;
    object-fit: cover;
    display: block;
}

.checkout-muted {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    margin-top: 3px;
}

.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.checkout-summary-total {
    border-bottom: 0;
    padding-top: 16px;
}

.checkout-summary-total span,
.checkout-summary-total strong {
    font-size: 21px;
    color: var(--brand);
}

.checkout-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.checkout-footer {
    padding: 28px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    background: #fff;
}

/* =========================================================
   order-success.php
   ========================================================= */

.success-container {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
}

.success-topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.success-topbar-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.success-brand {
    color: var(--text);
    text-decoration: none;
}

.success-brand strong {
    display: block;
    font-size: 18px;
}

.success-brand span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.success-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: 11px 15px;
    font-weight: bold;
    text-decoration: none;
    font-size: 14px;
}

.success-button:hover {
    background: var(--brand-dark);
}

.success-button-secondary {
    background: #fff;
    color: var(--brand);
    border: 1px solid var(--brand);
}

.success-button-secondary:hover {
    background: #fff7f4;
}

.success-hero {
    padding: 38px 0 20px;
}

.success-hero-card {
    background: linear-gradient(135deg, #fff, #f3fff3);
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 32px;
    box-shadow: 0 18px 45px rgba(0,0,0,.06);
}

.success-check {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: #e7f7e7;
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 16px;
}

.success-hero-card h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 46px);
    line-height: 1.08;
}

.success-hero-card p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
    max-width: 760px;
}

.success-alert {
    border-radius: 14px;
    padding: 13px 15px;
    margin-top: 16px;
    font-size: 14px;
    background: #e7f7e7;
    color: var(--success);
    border: 1px solid #cceccc;
}

.success-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 22px;
    align-items: start;
    padding: 22px 0 50px;
}

.success-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0,0,0,.05);
    padding: 20px;
}

.success-card h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

.success-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.success-info-box {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    background: #fff;
}

.success-info-box span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 5px;
}

.success-info-box strong {
    display: block;
    font-size: 15px;
    line-height: 1.4;
}

.success-items {
    display: grid;
    gap: 10px;
}

.success-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 11px;
}

.success-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.success-muted {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    margin-top: 3px;
}

.success-summary {
    position: sticky;
    top: 20px;
}

.success-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.success-summary-total {
    border-bottom: 0;
    padding-top: 16px;
}

.success-summary-total span,
.success-summary-total strong {
    font-size: 21px;
    color: var(--brand);
}

.success-actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.success-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: bold;
    background: #fff5d6;
    color: var(--warning);
}

.success-footer {
    padding: 28px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    background: #fff;
}

/* =========================================================
   Responsive carrito / checkout / éxito
   ========================================================= */

@media (max-width: 1050px) {
    .cart-layout,
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary,
    .checkout-summary {
        position: static;
    }
}

@media (max-width: 950px) {
    .success-layout {
        grid-template-columns: 1fr;
    }

    .success-summary {
        position: static;
    }
}

@media (max-width: 850px) {
    .cart-item {
        grid-template-columns: 76px 1fr;
        align-items: start;
    }

    .cart-item-price,
    .cart-quantity,
    .cart-item-total,
    .cart-item-remove {
        grid-column: 2 / -1;
    }
}

@media (max-width: 700px) {
    .checkout-container {
        width: min(100% - 20px, 1180px);
    }

    .checkout-topbar-inner {
        display: block;
        padding: 12px 0;
    }

    .checkout-topbar-inner .checkout-button {
        width: 100%;
        margin-top: 10px;
    }

    .checkout-form-grid,
    .checkout-radio-grid {
        grid-template-columns: 1fr;
    }

    .checkout-hero-card {
        padding: 22px;
    }
}

@media (max-width: 650px) {
    .cart-container {
        width: min(100% - 20px, 1180px);
    }

    .cart-topbar-inner {
        display: block;
        padding: 12px 0;
    }

    .cart-topbar-inner .cart-button {
        width: 100%;
        margin-top: 10px;
    }

    .cart-hero {
        padding-top: 24px;
    }

    .cart-hero-card {
        padding: 22px;
    }

    .cart-actions {
        display: block;
    }

    .cart-actions-left,
    .cart-actions-right {
        display: grid;
        margin-top: 10px;
    }

    .success-container {
        width: min(100% - 20px, 1080px);
    }

    .success-topbar-inner {
        display: block;
        padding: 12px 0;
    }

    .success-topbar-inner .success-button {
        width: 100%;
        margin-top: 10px;
    }

    .success-hero-card {
        padding: 24px;
    }

    .success-grid {
        grid-template-columns: 1fr;
    }
}
