/* =====================================================
   PUERTA ROJA — CART PAGE (Shopify Style)
   ===================================================== */

/* ── Reset & base ────────────────────────────────────── */
.pr-cart-page *,
.pr-cart-page *::before,
.pr-cart-page *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.pr-cart-page {
    font-family: var(--pr-font-family, 'Inter', -apple-system, sans-serif);
    font-size: 15px;
    color: #333;
    background: #fff;
    min-height: 100vh;
}

.pr-cart-page .site-header,
.pr-cart-page .site-footer,
.pr-cart-page .e-page-title,
.pr-cart-page #header {
    display: none !important;
}

/* Hide WC's own cart collaterals — we render our own sidebar */
.pr-cart-page .cart-collaterals {
    display: none !important;
}

/* ── Shared summary rows ─────────────────────────────── */
.pr-cart-page .pr-co-totals {}

.pr-cart-page .pr-co-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.pr-cart-page .pr-co-row:last-child {
    border-bottom: none;
}

.pr-cart-page .pr-co-row--discount {
    color: #008060;
}

.pr-cart-page .pr-co-row--total {
    font-size: 17px;
    font-weight: 800;
    padding-top: 14px;
    margin-top: 4px;
    border-top: 2px solid #222;
    border-bottom: none;
}

.pr-cart-page .pr-free {
    color: #008060;
    font-weight: 700;
}

/* ── Checkout-style header (logo + breadcrumb) ───────── */
.pr-cart-page .pr-co-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 40px;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

/* WordPress admin bar offset */
.admin-bar .pr-cart-page .pr-co-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .pr-cart-page .pr-co-header {
        top: 46px;
    }
}

.pr-cart-page .pr-co-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    width: 180px;
    flex-shrink: 0;
}

.pr-cart-page .pr-co-logo-img {
    max-height: 38px;
    width: auto;
}

.pr-cart-page .pr-co-logo-text {
    font-size: 20px;
    font-weight: 800;
    color: #111;
    letter-spacing: -0.5px;
}

/* Breadcrumb */
.pr-cart-page .pr-co-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.pr-cart-page .pr-crumb {
    color: #999;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.pr-cart-page .pr-crumb--active {
    color: #111;
    font-weight: 700;
}

.pr-cart-page .pr-crumb--pending {
    color: #ccc;
}

.pr-cart-page a.pr-crumb:hover {
    color: #555;
}

.pr-cart-page .pr-crumb-sep {
    color: #ccc;
    font-size: 14px;
    user-select: none;
}

/* ── Page body ───────────────────────────────────────── */
.pr-sp-body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 32px 80px;
}

.pr-sp-body h1 {
    font-size: 26px;
    font-weight: 800;
    color: #111;
    margin-bottom: 32px;
    letter-spacing: -0.5px;
}

/* ── Cart two-column layout ──────────────────────────── */
.pr-cart-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

/* ══ CART TABLE ══════════════════════════════════════════ */

/* Outer rounded container */
.pr-cart-page .woocommerce-cart-form {
    background: #fff;
    border: 1.5px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
}

/* Table base */
.pr-cart-page .shop_table.cart {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    border: 0 !important;
    margin: 0 !important;
}

/* ── Header row ──────────────────────────────────────── */
.pr-cart-page .shop_table.cart thead tr {
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

/* All header cells — same size & weight */
.pr-cart-page .shop_table.cart thead th {
    font-size: 11px !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #bbb !important;
    padding: 13px 12px 13px 0;
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
}

.pr-cart-page .shop_table.cart thead th:first-child {
    padding-left: 20px;
}

.pr-cart-page .shop_table.cart thead .product-thumbnail {
    width: 90px;
}

.pr-cart-page .shop_table.cart thead .product-remove {
    width: 36px;
}

.pr-cart-page .shop_table.cart thead .product-price,
.pr-cart-page .shop_table.cart thead .product-subtotal {
    text-align: right;
    padding-right: 20px;
}

.pr-cart-page .shop_table.cart thead .product-quantity {
    text-align: center;
}

/* ── Body rows — no internal borders ─────────────────── */
.pr-cart-page .shop_table.cart tbody tr td.actions {
    display: none !important;
}

.pr-cart-page .shop_table.cart tbody tr.cart_item {
    border: none;
    transition: background 0.15s;
}

.pr-cart-page .shop_table.cart tbody tr.cart_item:hover {
    background: #fafafa;
}

/* Subtle separator only between rows (not after last) */
.pr-cart-page .shop_table.cart tbody tr.cart_item:not(:last-child) td {
    border-bottom: 1px solid #f5f5f5;
}

.pr-cart-page .shop_table.cart td {
    padding: 20px 12px 20px 0;
    vertical-align: middle;
    border: none;
}

/* Remove button */
.pr-cart-page .shop_table.cart .product-remove {
    padding-left: 16px;
    width: 36px;
}

.pr-cart-page .shop_table.cart .product-remove a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    color: #ccc;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.pr-cart-page .shop_table.cart .product-remove a:hover {
    background: #ffe5e0;
    color: #e2401c;
}

.pr-remove-icon {
    display: block;
    pointer-events: none;
}

/* Thumbnail */
.pr-cart-page .shop_table.cart .product-thumbnail {
    padding-left: 0;
    width: 90px;
}

.pr-cart-page .shop_table.cart .product-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid #eee;
    background: #fcfcfc;
    display: block;
    transition: transform 0.2s;
}

.pr-cart-page .shop_table.cart .product-thumbnail img:hover {
    transform: scale(1.04);
}

/* Product name */
.pr-cart-page .shop_table.cart .product-name {
    padding-right: 24px;
}

.pr-cart-page .shop_table.cart .product-name a {
    font-size: 15px;
    font-weight: 600;
    color: #111;
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    transition: color 0.15s;
}

.pr-cart-page .shop_table.cart .product-name a:hover {
    color: #555;
}

.pr-cart-page .shop_table.cart .product-name .variation {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
}

.pr-cart-page .shop_table.cart .product-name .variation dt {
    display: inline;
    font-weight: 600;
}

.pr-cart-page .shop_table.cart .product-name .variation dd {
    display: inline;
    margin: 0;
}

/* Price */
.pr-cart-page .shop_table.cart .product-price {
    text-align: right;
    font-size: 14px;
    color: #999;
    white-space: nowrap;
}

/* ── Quantity stepper with +/- buttons ───────────────── */
.pr-cart-page .shop_table.cart .product-quantity {
    text-align: center;
}

.pr-cart-page .shop_table.cart .quantity {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #e0e0e0;
    border-radius: 9px;
    overflow: hidden;
    background: #fff;
}

.pr-qty-btn {
    width: 34px;
    height: 38px;
    border: none;
    background: transparent;
    font-size: 18px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pr-qty-btn:hover {
    background: #f0f0f0;
    color: #111;
}

.pr-qty-btn:active {
    background: #e5e5e5;
}

.pr-cart-page .shop_table.cart .qty {
    width: 44px;
    padding: 6px 2px;
    border: none;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    color: #111;
    font-family: inherit;
    background: transparent;
    -moz-appearance: textfield;
    outline: none;
}

.pr-cart-page .shop_table.cart .qty::-webkit-outer-spin-button,
.pr-cart-page .shop_table.cart .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

/* Subtotal */
.pr-cart-page .shop_table.cart .product-subtotal {
    text-align: right;
    font-size: 15px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
    padding-right: 20px;
}

/* ── Cart actions row — hidden (coupon moved outside, btn auto-triggered) ─ */
.pr-cart-page .shop_table.cart tr.actions {
    display: none !important;
}

/* Hide "Update cart" button — qty changes auto-update */
.pr-cart-page [name="update_cart"] {
    display: none !important;
}

/* ── Coupon wrapper — outside the table ──────────────── */
.pr-coupon-wrap {
    margin-top: 16px;
    padding: 18px 20px;
    background: #f9f9f9;
    border: 1.5px solid #e8e8e8;
    border-radius: 12px;
}

.pr-coupon-wrap .coupon {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.pr-coupon-wrap .coupon::before {
    content: "¿Tienes un cupón?";
    font-size: 13px;
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
    margin-right: 4px;
}

/* Coupon input — selector by name since JS removes the id to avoid duplicates */
.pr-coupon-wrap .coupon input[name="coupon_code"] {
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 9px;
    font-size: 14px;
    font-family: inherit;
    width: 200px;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
    color: #111;
}

.pr-coupon-wrap .coupon input[name="coupon_code"]:focus {
    border-color: #111;
}

.pr-coupon-wrap .coupon input[name="coupon_code"]::placeholder {
    color: #ccc;
}

.pr-coupon-wrap .coupon [name="apply_coupon"] {
    padding: 10px 18px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
    white-space: nowrap;
}

.pr-coupon-wrap .coupon [name="apply_coupon"]:hover {
    background: #333;
}

.pr-coupon-wrap .coupon [name="apply_coupon"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Coupon AJAX notice */
.pr-coupon-notice {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    animation: prFadeIn 0.2s ease;
}

.pr-coupon-notice .woocommerce-message,
.pr-coupon-notice .woocommerce-error {
    margin: 0;
}

@keyframes prFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Order summary sidebar ───────────────────────────── */
.pr-cart-summary {
    background: #f7f7f7;
    border-radius: 14px;
    padding: 28px 24px;
    position: sticky;
    top: 76px;
    transition: opacity 0.25s;
}

.pr-cart-summary.pr-loading {
    opacity: 0.5;
    pointer-events: none;
}

.pr-cart-summary h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e0e0e0;
    color: #111;
}

/* Checkout button */
#add_payment_method .wc-proceed-to-checkout,
.woocommerce-cart .wc-proceed-to-checkout,
.woocommerce-checkout .wc-proceed-to-checkout {
    padding: 0 !important;
    margin-top: 20px;
}

.pr-cart-page .checkout-button {
    display: block;
    width: 100%;
    padding: 15px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    margin: 0 !important;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
    letter-spacing: 0.2px;
}

.pr-cart-page .checkout-button:hover {
    background: #333;
    transform: translateY(-1px);
    color: #fff;
}

/* ── Empty cart ──────────────────────────────────────── */
.pr-cart-page .cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.pr-cart-page .return-to-shop {
    text-align: center;
}

.pr-cart-page .return-to-shop a,
.pr-cart-page .return-to-shop .button {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 28px;
    background: #111;
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: background 0.2s;
}

.pr-cart-page .return-to-shop a:hover,
.pr-cart-page .return-to-shop .button:hover {
    background: #333;
}

/* ── Minimal footer ──────────────────────────────────── */
.pr-sp-footer {
    border-top: 1px solid #eee;
    padding: 20px 40px;
    font-size: 13px;
    color: #888;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.pr-sp-footer a {
    color: #888;
    text-decoration: none;
}

.pr-sp-footer a:hover {
    color: #111;
    text-decoration: underline;
}

/* ── WC notices ──────────────────────────────────────── */
.pr-cart-page .woocommerce-error,
.pr-cart-page .woocommerce-message,
.pr-cart-page .woocommerce-info {
    padding: 14px 18px 14px 44px;
    border-radius: 8px;
    border-top: 0 !important;
    margin-bottom: 20px;
    font-size: 14px;
    list-style: none;
}

.pr-cart-page .woocommerce-error {
    background: #fff0ee;
    border-left: 4px solid #e2401c;
    color: #9b2a1a;
}

.pr-cart-page .woocommerce-error::before {
    color: #e2401c;
}

.pr-cart-page .woocommerce-message {
    background: #f0faf4;
    border-left: 4px solid #46a35e;
    color: #1b5e20;
}

.pr-cart-page .woocommerce-message::before {
    color: #46a35e;
}

.pr-cart-page .woocommerce-info {
    background: #f0f4ff;
    border-left: 4px solid #3d66d5;
    color: #1a2e6e;
}

.pr-cart-page .woocommerce-info::before {
    color: #3d66d5;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 860px) {
    .pr-cart-layout {
        grid-template-columns: 1fr;
    }

    .pr-cart-summary {
        position: static;
        order: -1;
    }

    .pr-cart-page .pr-co-header {
        padding: 14px 20px;
    }

    .pr-sp-body {
        padding: 28px 20px 60px;
    }

    .pr-sp-footer {
        padding: 16px 20px;
    }

    .pr-cart-page .shop_table.cart .product-price {
        display: none;
    }
}

@media (max-width: 560px) {
    .pr-cart-page .shop_table.cart thead {
        display: none;
    }

    .pr-cart-page .shop_table.cart tbody tr.cart_item {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "remove thumb name"
            "remove thumb qty"
            "remove thumb subtotal";
        row-gap: 4px;
        padding: 16px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .pr-cart-page .shop_table.cart td {
        padding: 0;
        border: none;
    }

    .pr-cart-page .shop_table.cart .product-remove {
        grid-area: remove;
        align-self: center;
    }

    .pr-cart-page .shop_table.cart .product-thumbnail {
        grid-area: thumb;
        padding: 0 12px;
    }

    .pr-cart-page .shop_table.cart .product-name {
        grid-area: name;
    }

    .pr-cart-page .shop_table.cart .product-quantity {
        grid-area: qty;
        text-align: left;
    }

    .pr-cart-page .shop_table.cart .product-subtotal {
        grid-area: subtotal;
        text-align: left;
        font-size: 14px;
    }

    .pr-cart-page .shop_table.cart .product-price {
        display: none;
    }
}