/* ==========================================================
   Rintin Starter — Cart Page
   Layout, products, totals, shipping, mobile responsive
   ========================================================== */

/* ==========================================================
   Cart Page — Redesign v2
   ========================================================== */

/* ---- WooCommerce notices on cart page (shadcn style) ---- */
.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-error,
.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-info {
    list-style: none;
    border-radius: 10px;
    font-size: 0.875rem;
    padding: 0.875rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid;
    box-shadow: none;
}

.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-message {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-info {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #334155;
}

/* Hide WC duplicate cart totals heading (we provide our own) */
.rintin-cart__totals-sidebar .cart_totals > h2,
.rintin-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Layout ---- */
.rintin-cart {
    padding: 1.5rem 0 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ---- Title row ---- */
.rintin-cart__title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.rintin-cart__title {
    font-size: 28px;
    font-weight: 800;
    color: var(--rt-text);
    margin: 0;
    line-height: 1.2;
}

.rintin-cart__pack-count {
    font-size: 14px;
    font-weight: 400;
    color: var(--rt-text-muted);
}

/* ---- Shared card style ---- */
.rintin-cart__card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    padding: 1.5rem 1.75rem;
}

/* ---- Free shipping progress bar ---- */
.rintin-cart__shipping-bar {
    margin-bottom: 1rem;
    border-radius: 12px;
    padding: 16px 20px;
}

.rintin-cart__shipping-bar--warning {
    background: #FFF3E0;
    border: 1px solid #FFE0B2;
}

.rintin-cart__shipping-bar--shipping {
    background: var(--rt-green-light);
    border: 1px solid #C8E6C9;
}

.rintin-cart__shipping-bar-content {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.5rem;
}

.rintin-cart__shipping-bar-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
    line-height: 1;
}

.rintin-cart__shipping-bar--warning .rintin-cart__shipping-bar-icon {
    color: #E65100;
}

.rintin-cart__shipping-bar--shipping .rintin-cart__shipping-bar-icon {
    color: var(--rt-green-dark);
}

.rintin-cart__shipping-bar-text {
    font-size: 0.875rem;
    color: var(--rt-text);
    font-weight: 500;
    flex: 1;
}

.rintin-cart__shipping-bar-text .woocommerce-Price-amount {
    font-weight: 700;
    color: var(--rt-green-dark);
}

.rintin-cart__shipping-bar--warning .rintin-cart__shipping-bar-text .woocommerce-Price-amount {
    color: #E65100;
}

.rintin-cart__shipping-bar-pct {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6c757d;
    white-space: nowrap;
}

.rintin-cart__shipping-bar-track {
    width: 100%;
    height: 6px;
    background: #fff;
    border-radius: 999px;
    overflow: hidden;
}

.rintin-cart__shipping-bar-fill {
    height: 100%;
    background: var(--rt-green);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.rintin-cart__shipping-bar-fill--warning {
    background: #ff9800;
}

/* ---- Table header (shadcn style) ---- */
.rintin-cart__table-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    margin: -1.5rem -1.75rem 0;
    padding: 0.875rem 1.75rem;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #e2e8f0;
}

.rintin-cart__th {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rintin-cart__th--product {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 2.25rem;
}

.rintin-cart__th--price {
    width: 110px;
    text-align: center;
}

.rintin-cart__th--qty {
    width: 130px;
    text-align: center;
}

.rintin-cart__th--subtotal {
    width: 110px;
    text-align: right;
}

.rintin-cart__separator {
    display: none;
}

/* ---- Product row ---- */
.rintin-cart__row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.rintin-cart__row:last-child {
    border-bottom: none;
}

/* Remove button (circular 28x28) */
.rintin-cart__row-remove {
    flex-shrink: 0;
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rintin-cart__remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--rt-border);
    background: transparent;
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.rintin-cart__remove-btn:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fca5a5;
}

/* Product image */
.rintin-cart__row-image {
    flex-shrink: 0;
    width: 88px;
    height: 110px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.rintin-cart__row-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product info */
.rintin-cart__row-info {
    flex: 1 1 0;
    min-width: 0;
}

.rintin-cart__row-name {
    font-weight: 600;
    font-size: 1rem;
    color: #0f172a;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.rintin-cart__row-name a {
    color: inherit;
    text-decoration: none;
}

.rintin-cart__row-name a:hover {
    color: var(--rintin-green);
}

.rintin-cart__row-vendor {
    display: block;
    font-size: 0.8125rem;
    font-weight: 400;
    color: #64748b;
    margin-top: 0.25rem;
}

.rintin-cart__row-vendor-name {
    color: #16a34a;
    font-weight: 500;
}

/* Pack badge */
.rintin-cart__row-pack-badge {
    display: inline-block;
    background: var(--rt-green-light);
    color: var(--rt-green-dark);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
    line-height: 1.4;
}

/* Price column */
.rintin-cart__row-price {
    width: 110px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rintin-cart__row-price-pack {
    font-size: 15px;
    font-weight: 700;
    color: #334155;
}

.rintin-cart__row-price-unit {
    font-size: 11px;
    color: var(--rt-text-muted);
    font-weight: 400;
    margin-top: 1px;
}

/* Quantity column — shadcn style */
.rintin-cart__row-qty {
    width: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rintin-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.rintin-qty__btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.125rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    line-height: 1;
}

.rintin-qty__btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.rintin-qty .qty {
    width: 40px;
    height: 36px;
    border: none;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    background: #fff;
    -moz-appearance: textfield;
    padding: 0;
}

.rintin-qty .qty::-webkit-outer-spin-button,
.rintin-qty .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rintin-qty .qty:focus {
    outline: none;
    background: #f8fafc;
}

/* Subtotal column */
.rintin-cart__row-subtotal {
    width: 110px;
    text-align: right;
    font-weight: 700;
    font-size: 1.0625rem;
    color: #16a34a;
    white-space: nowrap;
}

/* ---- Cart actions ---- */
.rintin-cart__actions {
    margin-top: 1rem;
    padding-top: 0.75rem;
}

.rintin-cart__update-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--rintin-border);
    border-radius: 8px;
    background: #fff;
    color: var(--rintin-text);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.rintin-cart__update-btn:hover {
    border-color: var(--rintin-green);
    color: var(--rintin-green);
}

/* ---- Replacement question ---- */
.rintin-cart__replacement {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rintin-cart__replacement-heading {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--rt-text);
    display: block;
    margin-bottom: 0.25rem;
}

.rintin-cart__replacement-desc {
    font-size: 0.8125rem;
    color: var(--rt-text-secondary);
    line-height: 1.4;
    margin-bottom: 0.625rem;
}

.rintin-cart__replacement-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--rintin-text);
    margin-bottom: 0.625rem;
    display: block;
    line-height: 1.4;
}

.rintin-cart__replacement-select {
    font-size: 0.875rem;
    border-radius: 8px;
    border-color: var(--rintin-border);
    padding: 0.5rem 2rem 0.5rem 0.75rem;
}

/* ---- Coupon form ---- */
.rintin-cart__coupon {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rintin-cart__coupon-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--rintin-text);
    margin-bottom: 0.625rem;
    display: block;
}

.rintin-cart__coupon-group {
    border-radius: 8px;
    overflow: hidden;
}

.rintin-cart__coupon-input {
    font-size: 0.875rem;
    border: 1px solid var(--rintin-border);
    border-right: none;
    border-radius: 8px 0 0 8px !important;
    padding: 0.5rem 0.75rem;
}

.rintin-cart__coupon-input:focus {
    border-color: var(--rintin-green);
    box-shadow: none;
}

.rintin-cart__coupon-btn {
    background: #2196f3;
    color: #fff;
    border: 1px solid #2196f3;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.5rem 1.25rem;
    border-radius: 0 8px 8px 0 !important;
    transition: background 0.2s;
    white-space: nowrap;
}

.rintin-cart__coupon-btn:hover {
    background: #1976d2;
    border-color: #1976d2;
    color: #fff;
}

/* ---- Available coupons banner (shadcn) ---- */
.rintin-cart__coupons-available {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.rintin-cart__coupons-available-inner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.rintin-cart__coupons-icon {
    font-size: 1.25rem;
    color: var(--rt-green-dark);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.rintin-cart__coupons-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rintin-text);
    display: block;
    margin-bottom: 0.25rem;
}

.rintin-cart__coupons-text {
    font-size: 0.8125rem;
    color: #6c757d;
    line-height: 1.45;
}

/* ---- Right column: Cart totals sidebar ---- */
.rintin-cart__totals-sidebar {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 100px;
    overflow: hidden;
}

.rintin-cart__totals-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    text-transform: none;
    letter-spacing: 0;
    margin: 0;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

/* WooCommerce cart_totals — flatten table to block layout */
.rintin-cart__totals-sidebar .cart_totals {
    padding: 0;
}

.rintin-cart__totals-sidebar .cart_totals table,
.rintin-cart__totals-sidebar .cart_totals .shop_table {
    display: block !important;
    border: none !important;
    margin: 0;
    width: 100%;
}

.rintin-cart__totals-sidebar .cart_totals tbody {
    display: block !important;
}

.rintin-cart__totals-sidebar .cart_totals tr {
    display: flex !important;
    flex-wrap: wrap;
    border: none !important;
}

.rintin-cart__totals-sidebar .cart_totals tr.rintin-shipping-hidden-pkg {
    display: none !important;
}

.rintin-cart__totals-sidebar .cart_totals th,
.rintin-cart__totals-sidebar .cart_totals td {
    display: block !important;
    border: none !important;
    background: transparent !important;
}

/* Subtotal row */
.rintin-cart__totals-sidebar .cart-subtotal {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #f1f5f9 !important;
    justify-content: space-between;
    align-items: center;
}

.rintin-cart__totals-sidebar .cart-subtotal th {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    padding: 0 !important;
}

.rintin-cart__totals-sidebar .cart-subtotal td {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0f172a;
    padding: 0 !important;
    text-align: right;
}

/* Shipping heading row */
.rintin-cart__totals-sidebar .woocommerce-shipping-totals:not(.rintin-shipping-cards-row) {
    padding: 0 !important;
    border: none !important;
}

.rintin-cart__totals-sidebar .woocommerce-shipping-totals th[colspan] {
    width: 100% !important;
    padding: 0 !important;
}

/* Shipping section label */
.rintin-cart__shipping-section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    display: block;
    padding: 0.75rem 1.25rem 0.375rem;
    border-top: 1px solid #f1f5f9;
}

/* Shipping cards row */
.rintin-shipping-cards-row {
    padding: 0 !important;
}

.rintin-shipping-cards-row td {
    width: 100% !important;
    padding: 0.25rem 1.25rem 0.75rem !important;
}

/* ---- Shipping radio cards (shadcn) ---- */
.rintin-shipping-cards {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.rintin-shipping-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    background: #fff;
}

.rintin-shipping-card:hover {
    border-color: #cbd5e1;
    background: #fafbfc;
}

.rintin-shipping-card--selected {
    border-color: var(--rt-green);
    border-width: 2px;
    background: var(--rt-green-light);
    box-shadow: none;
}

.rintin-shipping-card--selected:hover {
    border-color: var(--rintin-green);
}

/* Radio circle */
.rintin-shipping-card__radio {
    flex-shrink: 0;
    padding-top: 0.125rem;
}

.rintin-shipping-card__input {
    width: 18px;
    height: 18px;
    accent-color: var(--rintin-green);
    cursor: pointer;
}

/* Card content */
.rintin-shipping-card__content {
    flex: 1;
    min-width: 0;
}

.rintin-shipping-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.rintin-shipping-card__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--rintin-text);
}

.rintin-shipping-card__price {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.rintin-shipping-card__price--free {
    color: #16a34a;
}

.rintin-shipping-card__details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.rintin-shipping-card__address {
    font-size: 0.75rem;
    color: #888;
    line-height: 1.35;
}

.rintin-shipping-card__date {
    font-size: 0.75rem;
    color: #888;
}

.rintin-shipping-card__date strong {
    color: var(--rintin-text);
}

/* Change address link */
.rintin-shipping-change {
    margin-top: 0.375rem;
}

.rintin-shipping-change a,
.shipping-calculator-button {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #16a34a;
    text-decoration: none;
}

.rintin-shipping-change a:hover,
.shipping-calculator-button:hover {
    color: #15803d;
    text-decoration: underline;
}

/* Package details (product list inside shipping) */
.rintin-cart__totals-sidebar .woocommerce-shipping-contents {
    font-size: 0.6875rem;
    color: #94a3b8;
    padding: 0 1.25rem;
    margin: 0;
}

/* Change address link inside sidebar */
.rintin-cart__totals-sidebar .rintin-shipping-change {
    padding: 0 1.25rem;
    margin-bottom: 0.5rem;
}

/* Total row */
.rintin-cart__totals-sidebar .order-total th,
.rintin-cart__totals-sidebar .order-total td {
    padding: 0.875rem 1.25rem !important;
    border-top: 1px solid #e2e8f0 !important;
}

.rintin-cart__totals-sidebar .order-total th {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
}

.rintin-cart__totals-sidebar .order-total td {
    font-size: 24px;
    font-weight: 800;
    color: var(--rt-green-dark);
}

/* Checkout button (green) */
.rintin-cart__totals-sidebar .wc-proceed-to-checkout {
    padding: 0 1.25rem 1.25rem;
}

.rintin-cart__totals-sidebar .wc-proceed-to-checkout a,
.rintin-cart__checkout-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem;
    width: 100%;
    padding: 0 1rem !important;
    border: none !important;
    border-radius: 12px;
    background: var(--rt-green) !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 0.9375rem;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none !important;
    margin-top: 0.75rem;
    letter-spacing: 0.03em;
    transition: background 0.15s, box-shadow 0.15s;
    height: 50px;
    line-height: 1;
    box-sizing: border-box;
}

.rintin-cart__totals-sidebar .wc-proceed-to-checkout a:hover,
.rintin-cart__checkout-btn:hover {
    background: var(--rt-green-dark) !important;
    box-shadow: 0 2px 8px rgba(57, 181, 74, 0.3);
}

/* ---- Secure payment badge ---- */
.rintin-cart__secure-badge {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid #f1f5f9;
}

.rintin-cart__secure-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 0.625rem;
}

.rintin-cart__secure-text i {
    font-size: 0.9375rem;
    color: var(--rt-green);
}

.rintin-cart__payment-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}

.rintin-cart__payment-icons img {
    height: 22px;
    width: auto;
    opacity: 0.7;
}

.rintin-cart__payment-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.625rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.625rem;
    font-weight: 700;
    color: #64748b;
    background: #f8fafc;
    letter-spacing: 0.04em;
}

.rintin-cart__terms-text {
    font-size: 0.6875rem;
    color: #94a3b8;
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

.rintin-cart__terms-text a {
    color: #64748b;
    text-decoration: underline;
    text-decoration-color: #cbd5e1;
    text-underline-offset: 2px;
}

.rintin-cart__terms-text a:hover {
    color: #0f172a;
    text-decoration-color: #0f172a;
}

/* ---- Coupon display inside totals ---- */
.rintin-cart__totals-sidebar .cart-discount th,
.rintin-cart__totals-sidebar .cart-discount td {
    color: var(--rintin-green);
}

.rintin-cart__totals-sidebar .cart-discount td a {
    color: #dc3545;
    font-size: 0.75rem;
}

/* ---- WooCommerce shipping calculator override (shadcn) ---- */
.rintin-cart__totals-sidebar .shipping-calculator-form {
    margin-top: 0.5rem;
    padding: 0.75rem 1.25rem 1rem;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

.rintin-cart__totals-sidebar .shipping-calculator-form .form-row {
    margin-bottom: 0.625rem;
    position: relative;
}

.rintin-cart__totals-sidebar .shipping-calculator-form .form-row:last-of-type {
    margin-bottom: 0.75rem;
}

/* Native selects & text inputs */
.rintin-cart__totals-sidebar .shipping-calculator-form select,
.rintin-cart__totals-sidebar .shipping-calculator-form input.input-text {
    width: 100%;
    font-size: 0.8125rem;
    font-family: inherit;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    line-height: 1.5;
}

.rintin-cart__totals-sidebar .shipping-calculator-form select:focus,
.rintin-cart__totals-sidebar .shipping-calculator-form input.input-text:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.rintin-cart__totals-sidebar .shipping-calculator-form input.input-text::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Select2 container (shadcn) */
.rintin-cart__totals-sidebar .select2-container {
    width: 100% !important;
}

.rintin-cart__totals-sidebar .select2-container .select2-selection--single {
    height: auto !important;
    min-height: 38px;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    background: #fff !important;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.rintin-cart__totals-sidebar .select2-container--open .select2-selection--single,
.rintin-cart__totals-sidebar .select2-container--focus .select2-selection--single {
    border-color: #16a34a !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1) !important;
}

.rintin-cart__totals-sidebar .select2-selection__rendered {
    font-size: 0.8125rem !important;
    color: #0f172a !important;
    line-height: 1.5 !important;
    padding: 0 !important;
}

.rintin-cart__totals-sidebar .select2-selection__arrow {
    top: 50% !important;
    right: 0.625rem !important;
    transform: translateY(-50%);
    height: auto !important;
}

.rintin-cart__totals-sidebar .select2-selection__arrow b {
    border-color: #64748b transparent transparent !important;
}

/* Button (shadcn dark) */
.rintin-cart__totals-sidebar .shipping-calculator-form button,
.rintin-cart__totals-sidebar .shipping-calculator-form button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.625rem 1rem;
    background: #0f172a !important;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.rintin-cart__totals-sidebar .shipping-calculator-form button:hover,
.rintin-cart__totals-sidebar .shipping-calculator-form button.button:hover {
    background: #1e293b !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Wrapper paragraph for button — remove default margin */
.rintin-cart__totals-sidebar .shipping-calculator-form > p:last-of-type {
    margin-bottom: 0;
}

/* Select2 dropdown panel (shadcn) — global since dropdown appends to body */
.select2-container--open .select2-dropdown {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.select2-container--open .select2-dropdown .select2-search__field {
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #0f172a;
}

.select2-container--open .select2-dropdown .select2-search__field:focus {
    border-color: #16a34a !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.select2-container--open .select2-results__option {
    font-size: 0.8125rem;
    color: #334155;
    padding: 0.5rem 0.75rem;
}

.select2-container--open .select2-results__option--highlighted {
    background: #f0fdf4 !important;
    color: #0f172a !important;
}

.select2-container--open .select2-results__option[aria-selected="true"] {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

/* ---- Full-page cart loader (shadcn) ---- */
#rintin-cart-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

#rintin-cart-loader.is-active {
    opacity: 1;
    visibility: visible;
}

.rintin-cart-loader__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem 2.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
}

.rintin-cart-loader__spinner {
    color: #0f172a;
    animation: rintin-spin 0.8s linear infinite;
}

.rintin-cart-loader__text {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.01em;
}

@keyframes rintin-spin {
    to { transform: rotate(360deg); }
}

/* ---- Hide floating elements on cart page (mobile) ---- */
body.woocommerce-cart .rintin-mobile-nav,
body.woocommerce-cart .rintin-mobile-nav__fab-wrapper,
body.woocommerce-cart .rintin-mnav {
    display: none !important;
}

/* ---- Mobile sticky checkout bar (hidden on desktop) ---- */
.rintin-cart__sticky-checkout {
    display: none;
}

/* ---- Mobile responsive ---- */
@media (max-width: 991px) {
    .rintin-cart__totals-sidebar {
        position: static;
    }

    /* Show mobile sticky checkout */
    .rintin-cart__sticky-checkout {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1050;
        background: #fff;
        border-top: 1px solid var(--rt-border);
        padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
        text-align: center;
    }

    .rintin-cart__sticky-total {
        display: block;
        font-size: 15px;
        font-weight: 700;
        color: var(--rt-text);
        margin-bottom: 8px;
    }

    .rintin-cart__sticky-checkout-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        height: 50px;
        background: var(--rt-green);
        color: #fff;
        border: none;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        text-decoration: none;
        margin-bottom: 6px;
        transition: background 0.15s;
    }

    .rintin-cart__sticky-checkout-btn:hover {
        background: var(--rt-green-dark);
        color: #fff;
    }

    .rintin-cart__sticky-trust {
        font-size: 10px;
        color: var(--rt-text-muted);
        font-weight: 400;
    }

    /* Add padding to body to avoid sticky bar overlap */
    body.woocommerce-cart {
        padding-bottom: 140px;
    }
}

@media (max-width: 767px) {

    /* ---- Title row mobile ---- */
    .rintin-cart__title {
        font-size: 22px;
    }

    .rintin-cart__pack-count {
        font-size: 13px;
    }

    /* ---- Cart layout: single column ---- */
    .rintin-cart {
        padding: 0.5rem 0 1.5rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .rintin-cart .row.g-4 {
        display: flex;
        flex-direction: column;
        gap: 0 !important;
    }

    .rintin-cart .col-lg-8,
    .rintin-cart .col-lg-4 {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0;
    }

    /* ---- Shipping bar mobile ---- */
    .rintin-cart__shipping-bar {
        margin-bottom: 0.75rem;
        border-radius: 10px;
        padding: 12px 14px;
    }

    .rintin-cart__shipping-bar-track {
        height: 5px;
    }

    .rintin-cart__shipping-bar-pct {
        font-size: 0.75rem;
    }

    /* ---- Product card wrapper ---- */
    .rintin-cart__card {
        padding: 0;
        border: none;
        box-shadow: none;
        background: transparent;
        border-radius: 0;
    }

    .rintin-cart__table-header {
        display: none !important;
    }

    .rintin-cart__separator {
        display: none !important;
    }

    /* ---- Product row: each row is its own card ---- */
    .rintin-cart__row {
        display: grid;
        grid-template-columns: 80px 1fr auto;
        grid-template-rows: auto auto auto;
        gap: 0 0.75rem;
        padding: 16px;
        align-items: start;
        background: #fff;
        border: 1px solid var(--rt-border);
        border-radius: 12px;
        margin-bottom: 0.5rem;
        border-bottom: none;
    }

    .rintin-cart__row:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

    /* Image: row 1-2, col 1 */
    .rintin-cart__row-image {
        grid-row: 1 / 3;
        grid-column: 1;
        width: 80px;
        height: 100px;
        border-radius: 10px;
        border-color: #e2e8f0;
    }

    /* Info (name + vendor + badge): row 1, col 2 */
    .rintin-cart__row-info {
        grid-row: 1;
        grid-column: 2;
        min-width: 0;
    }

    .rintin-cart__row-name {
        font-size: 0.8125rem;
        font-weight: 700;
        line-height: 1.3;
        margin-bottom: 0.125rem;
        text-transform: uppercase;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .rintin-cart__row-name a {
        font-weight: 700;
    }

    .rintin-cart__row-vendor {
        font-size: 0.75rem;
        margin-top: 0.125rem;
    }

    .rintin-cart__row-vendor-name {
        color: var(--rt-green);
        font-weight: 600;
    }

    .rintin-cart__row-pack-badge {
        font-size: 10px;
        margin-top: 3px;
    }

    /* Remove button: row 1, col 3 (top-right) */
    .rintin-cart__row-remove {
        grid-row: 1;
        grid-column: 3;
        width: auto;
        justify-content: flex-end;
    }

    .rintin-cart__remove-btn {
        width: 26px;
        height: 26px;
        font-size: 0.875rem;
    }

    /* Price + Qty + Subtotal: row 3, spanning full width */
    .rintin-cart__row-price,
    .rintin-cart__row-qty,
    .rintin-cart__row-subtotal {
        grid-row: 3;
        border-top: 1px solid var(--rt-border-light);
        padding-top: 10px;
        margin-top: 10px;
    }

    .rintin-cart__row-price {
        grid-column: 1;
        width: auto;
        align-items: flex-start;
        text-align: left;
        align-self: center;
    }

    .rintin-cart__row-price-pack {
        font-size: 14px;
        font-weight: 700;
        color: #0f172a;
    }

    .rintin-cart__row-price-unit {
        font-size: 10px;
    }

    /* Hide data-label prefix on mobile */
    .rintin-cart__row-price::before,
    .rintin-cart__row-qty::before,
    .rintin-cart__row-subtotal::before {
        display: none;
    }

    .rintin-cart__row-qty {
        grid-column: 2;
        width: auto;
        justify-content: center;
        align-self: center;
    }

    .rintin-qty {
        border-radius: 10px;
        border-color: #e2e8f0;
        background: #fff;
    }

    .rintin-qty__btn {
        width: 34px;
        height: 34px;
        font-size: 1.125rem;
        color: #64748b;
    }

    .rintin-qty .qty {
        width: 36px;
        height: 34px;
        font-size: 0.875rem;
        font-weight: 600;
    }

    /* Show subtotal on mobile */
    .rintin-cart__row-subtotal {
        grid-column: 3;
        width: auto;
        text-align: right;
        font-size: 15px;
        font-weight: 700;
        color: var(--rt-green-dark);
        align-self: center;
        display: block;
    }

    /* ---- Replacement & coupon ---- */
    .rintin-cart__replacement {
        padding: 1rem;
    }

    .rintin-cart__replacement-label {
        font-size: 0.8125rem;
        margin-bottom: 0.5rem;
    }

    .rintin-cart__replacement-select {
        width: 100%;
    }

    .rintin-cart__coupon {
        padding: 1rem;
    }

    /* ---- Coupons available banner ---- */
    .rintin-cart__coupons-available {
        border-radius: 10px;
        padding: 0.75rem 1rem;
    }

    /* ---- Update cart button ---- */
    .rintin-cart__actions {
        display: none;
    }

    /* ---- Totals sidebar: inline card for mobile ---- */
    .rintin-cart__totals-sidebar {
        position: static;
        border: 1px solid var(--rt-border);
        border-radius: 12px;
        box-shadow: none;
        background: #fff;
        margin-top: 1rem;
        padding-top: 0;
    }

    .rintin-cart__totals-title {
        font-size: 0.9375rem;
        display: block;
    }

    /* Shipping section label inside totals */
    .rintin-cart__shipping-section-label {
        padding: 0.75rem 0 0.375rem;
        font-size: 0.6875rem;
    }

    .rintin-shipping-cards-row td {
        padding: 0.25rem 0 0.75rem !important;
        /* Hide WooCommerce "Shipping: Vendor:" text nodes */
        font-size: 0;
        line-height: 0;
    }

    .rintin-shipping-cards-row td > * {
        font-size: 0.8125rem;
        line-height: 1.5;
    }

    /* Shipping cards mobile */
    .rintin-shipping-card {
        padding: 0.75rem;
        border-radius: 10px;
    }

    .rintin-shipping-card__name {
        font-size: 0.8125rem;
        font-weight: 700;
    }

    .rintin-shipping-card__address {
        font-size: 0.75rem;
        line-height: 1.4;
        color: #64748b;
    }

    .rintin-shipping-card__date strong {
        color: var(--rt-green);
    }

    /* Change address link */
    .rintin-cart__totals-sidebar .rintin-shipping-change {
        padding: 0;
    }

    .shipping-calculator-button {
        font-size: 0.75rem;
        color: var(--rt-green) !important;
    }

    /* Hide WooCommerce auto-generated "Subtotal:" text inside cells */
    .rintin-cart__totals-sidebar .cart_totals td,
    .rintin-cart__totals-sidebar .cart_totals th {
        font-size: 0;
    }

    .rintin-cart__totals-sidebar .cart_totals td > *,
    .rintin-cart__totals-sidebar .cart_totals th > * {
        font-size: revert;
    }

    /* Total row on mobile — simple inline */
    .rintin-cart__totals-sidebar .order-total {
        padding: 0.75rem 0 !important;
        border-top: 1px solid #e2e8f0 !important;
        display: flex !important;
        justify-content: space-between;
        align-items: baseline;
    }

    .rintin-cart__totals-sidebar .order-total th {
        font-size: 0 !important;
        font-weight: 500;
        color: #64748b;
        padding: 0 !important;
        white-space: nowrap;
    }

    .rintin-cart__totals-sidebar .order-total th::before {
        content: 'Total:';
        font-size: 0.875rem;
        font-weight: 500;
        color: #64748b;
    }

    /* Hide the WC "Total:" text node in td, show only the strong price */
    .rintin-cart__totals-sidebar .order-total td {
        font-size: 0 !important;
        padding: 0 !important;
        text-align: right;
    }

    .rintin-cart__totals-sidebar .order-total td strong {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--rt-green-dark);
    }

    /* Hide checkout button in sidebar on mobile (use sticky bar) */
    .rintin-cart__totals-sidebar .wc-proceed-to-checkout {
        display: none;
    }

    /* Hide secure badge in sidebar on mobile (shown in sticky bar) */
    .rintin-cart__secure-badge {
        display: none;
    }

    /* Package details (items in shipping) */
    .rintin-cart__totals-sidebar .woocommerce-shipping-contents {
        padding: 0;
        font-size: 0.6875rem;
    }
}

@media (max-width: 991.98px) {
    .rintin-cart__totals-sidebar .shipping-calculator-form select,
    .rintin-cart__totals-sidebar .shipping-calculator-form input.input-text {
        font-size: 1rem;
    }
}
