/* ── Kings Corner – Premium Cart Widget ──────────────────────────────────── */
/* Design system: Inter, #1a1a2e text, #fff bg, --kc-accent CTA              */

/* ══════════════════════════════════════════════════════════════════════════ */
/* LAYOUT                                                                     */
/* ══════════════════════════════════════════════════════════════════════════ */

.kc-cart-container {
    display: flex;
    max-width: 1400px;
    margin: 40px auto;
    gap: 24px;
    padding: 0 24px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    align-items: flex-start;
    box-sizing: border-box;
}

.kc-cart-items-column {
    flex: 1;
    min-width: 0;
}

.kc-cart-totals-column {
    flex: 0 0 340px;
    width: 340px;
    position: sticky;
    top: 24px;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* BASE CARDS                                                                 */
/* ══════════════════════════════════════════════════════════════════════════ */

.kc-cart-items-card,
.kc-cart-totals-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #ebebeb;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0,0,0,0.02);
    box-sizing: border-box;
}

.kc-cart-items-card {
    padding: 28px 28px 20px;
}

.kc-cart-totals-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    box-sizing: border-box;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* HEADER – BRAND & TITLE                                                     */
/* ══════════════════════════════════════════════════════════════════════════ */

.kc-cart-brand {
    margin-bottom: 4px;
}

.kc-cart-logo {
    max-height: 36px;
    width: auto;
    display: block;
    margin-bottom: 16px;
}

.kc-cart-fallback-logo {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 900;
    color: #1a1a2e;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.kc-cart-section-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.2;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* EMPTY STATE                                                                */
/* ══════════════════════════════════════════════════════════════════════════ */

.kc-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    gap: 10px;
    text-align: center;
}

.kc-empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 8px;
}

.kc-empty-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.kc-empty-sub {
    font-size: 0.85rem;
    color: #aaa;
    margin: 0;
}

.kc-btn-outline {
    margin-top: 12px;
    padding: 10px 22px;
    border-radius: 8px;
    border: 2px solid var(--kc-accent, #00b4a0);
    color: var(--kc-accent, #00b4a0);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    display: inline-block;
}

.kc-btn-outline:hover {
    background: var(--kc-accent, #00b4a0);
    color: #fff;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* COLUMN LABELS                                                              */
/* ══════════════════════════════════════════════════════════════════════════ */

.kc-cart-col-labels {
    display: grid;
    grid-template-columns: 28px 72px 1fr 88px 108px 88px;
    gap: 14px;
    padding: 0 0 10px;
    margin-bottom: 2px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: #bbb;
    align-items: center;
}

.kc-col-product {
    grid-column: 2 / 4; /* spans image + name */
}

.kc-col-price {
    text-align: right;
}

.kc-col-qty {
    text-align: center;
}

.kc-col-subtotal {
    text-align: right;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* CART ITEMS LIST                                                            */
/* ══════════════════════════════════════════════════════════════════════════ */

.kc-cart-items-list {
    display: flex;
    flex-direction: column;
}

/* ── Single item row ─────────────────────────────────────────────────────── */
/*  [remove 28px] [img 72px] [info 1fr] [price 88px] [qty 108px] [sub 88px]  */

.kc-cart-item {
    display: grid;
    grid-template-columns: 28px 72px 1fr 88px 108px 88px;
    gap: 14px;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
    position: relative;
}

.kc-cart-item:last-child {
    border-bottom: none;
}

/* ── Remove button ───────────────────────────────────────────────────────── */

.kc-item-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f5f5f7;
    color: #c0c0c0;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.kc-item-remove:hover {
    background: #ffe5e5;
    color: #d94040;
}

/* ── Image ───────────────────────────────────────────────────────────────── */

.kc-item-image {
    flex-shrink: 0;
}

.kc-item-image a {
    display: block;
    line-height: 0;
}

.kc-item-img {
    width: 72px !important;
    height: 72px !important;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    border: 1px solid #f0f0f0;
}

/* ── Name + meta ─────────────────────────────────────────────────────────── */

.kc-item-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.kc-item-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.4;
}

.kc-item-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

.kc-item-name a:hover {
    color: var(--kc-accent, #00b4a0);
}

.kc-item-meta {
    font-size: 0.75rem;
    color: #aaa;
    line-height: 1.4;
}

.kc-item-meta span {
    font-weight: 600;
    color: #999;
}

/* ── Unit price ──────────────────────────────────────────────────────────── */

.kc-item-price {
    text-align: right;
    font-size: 0.88rem;
    font-weight: 600;
    color: #888;
    white-space: nowrap;
}

.kc-item-price .woocommerce-Price-amount {
    font-weight: 600;
    color: #888;
}

/* ── Qty stepper ─────────────────────────────────────────────────────────── */

.kc-item-qty {
    display: flex;
    justify-content: center;
}

.kc-qty-wrap {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.kc-qty-wrap:focus-within {
    border-color: var(--kc-accent, #00b4a0);
    box-shadow: 0 0 0 3px rgba(0, 180, 160, 0.1);
    background: #fff;
}

.kc-qty-btn {
    width: 30px;
    height: 34px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
    outline: none;
}

.kc-qty-btn:hover {
    color: var(--kc-accent, #00b4a0);
    background: rgba(0, 180, 160, 0.06);
}

.kc-qty-input {
    width: 38px;
    height: 34px;
    border: none;
    border-left: 1px solid #e5e5e5;
    border-right: 1px solid #e5e5e5;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
    padding: 0;
    box-sizing: border-box;
}

.kc-qty-input::-webkit-outer-spin-button,
.kc-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

/* ── Line subtotal ───────────────────────────────────────────────────────── */

.kc-item-subtotal {
    text-align: right;
    font-size: 0.95rem;
    font-weight: 800;
    color: #1a1a2e;
    white-space: nowrap;
}

.kc-item-subtotal .woocommerce-Price-amount {
    font-weight: 800;
    color: #1a1a2e;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* CART ACTIONS (UPDATE BUTTON)                                               */
/* ══════════════════════════════════════════════════════════════════════════ */

.kc-cart-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 16px;
    margin-top: 4px;
    border-top: 1px solid #f0f0f0;
}

.kc-btn-update {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1.5px solid #e5e5e5;
    background: #fff;
    color: #ccc;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, opacity 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.kc-btn-update:disabled {
    opacity: 0.6;
    cursor: default;
}

.kc-btn-update.is-active,
.kc-btn-update:not(:disabled) {
    border-color: var(--kc-accent, #00b4a0);
    color: var(--kc-accent, #00b4a0);
}

.kc-btn-update:not(:disabled):hover {
    background: rgba(0, 180, 160, 0.05);
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* SIDEBAR – TOTALS CARD                                                      */
/* ══════════════════════════════════════════════════════════════════════════ */

/* ── Heading ─────────────────────────────────────────────────────────────── */

.kc-totals-heading {
    font-size: 0.68rem;
    font-weight: 800;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

/* ── Coupon section ──────────────────────────────────────────────────────── */

.kc-coupon-section {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.kc-coupon-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #888;
    margin: 0 0 10px;
}

.kc-coupon-form {
    width: 100%;
}

.kc-coupon-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.kc-coupon-input {
    flex: 1;
    min-width: 0;
    padding: 10px 13px;
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #1a1a2e;
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.kc-coupon-input::placeholder {
    color: #c0c0c0;
}

.kc-coupon-input:focus {
    border-color: var(--kc-accent, #00b4a0);
    box-shadow: 0 0 0 3px rgba(0, 180, 160, 0.09);
    background: #fff;
}

.kc-coupon-btn {
    flex-shrink: 0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 800;
    border: none;
    background: #1a1a2e;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.kc-coupon-btn:hover {
    opacity: 0.82;
}

/* ── Applied coupon tag ──────────────────────────────────────────────────── */

.kc-applied-coupon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    background: rgba(0, 180, 160, 0.08);
    border: 1px solid rgba(0, 180, 160, 0.25);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--kc-accent, #00b4a0);
    letter-spacing: 0.5px;
}

.kc-remove-coupon {
    color: var(--kc-accent, #00b4a0);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s;
    margin-left: 2px;
}

.kc-remove-coupon:hover {
    opacity: 1;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* ORDER TOTALS ROWS                                                          */
/* ══════════════════════════════════════════════════════════════════════════ */

.kc-totals-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 16px;
}

.kc-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    gap: 8px;
}

.kc-totals-row:last-child {
    border-bottom: none;
}

.kc-totals-label {
    font-size: 0.87rem;
    font-weight: 600;
    color: #888;
    flex-shrink: 0;
}

.kc-totals-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1a1a2e;
    text-align: right;
}

.kc-totals-value .woocommerce-Price-amount {
    font-weight: 700;
    color: #1a1a2e;
}

/* Discount row */
.kc-totals-discount .kc-totals-label,
.kc-totals-discount .kc-totals-value {
    color: var(--kc-accent, #00b4a0);
    font-weight: 700;
}

/* Final total row */
.kc-totals-final {
    padding-top: 14px;
    margin-top: 4px;
    border-top: 2px solid #f0f0f0 !important;
    border-bottom: none !important;
}

.kc-totals-final .kc-totals-label {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1a1a2e;
}

.kc-totals-final .kc-totals-value {
    font-size: 1.1rem;
    font-weight: 900;
    color: #1a1a2e;
}

.kc-totals-final .kc-totals-value .woocommerce-Price-amount {
    font-weight: 900;
    color: #1a1a2e;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* CHECKOUT CTA                                                               */
/* ══════════════════════════════════════════════════════════════════════════ */

.kc-checkout-btn {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 15px 20px !important;
    background: var(--kc-accent, #00b4a0) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 0.97rem !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: filter 0.2s, transform 0.18s !important;
    letter-spacing: 0.1px !important;
    line-height: 1.4 !important;
    margin-bottom: 0 !important;
    font-family: inherit !important;
}

.kc-checkout-btn:hover {
    filter: brightness(0.9) !important;
    transform: translateY(-1px) !important;
    color: #fff !important;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* ACCREDITATION                                                              */
/* ══════════════════════════════════════════════════════════════════════════ */

.kc-cart-accred {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 0 0;
    margin-top: 14px;
    border-top: 1px solid #f0f0f0;
}

.kc-cart-accred-text {
    font-size: 0.78rem;
    font-weight: 600;
    color: #999;
}

.kc-cart-accred-logo {
    max-height: 20px;
    width: auto;
    display: block;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* PAYMENT GATEWAYS                                                           */
/* ══════════════════════════════════════════════════════════════════════════ */

.kc-cart-payment-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

.kc-payment-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

.kc-payment-pills {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
}

.kc-gateway-pill {
    padding: 4px 10px;
    border-radius: 5px;
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: -0.2px;
    line-height: 1.4;
}

.kc-pill-sequra { background: #112d6a; color: #fff; }
.kc-pill-klarna { background: #ffb3c7; color: #1a1a2e; }
.kc-pill-stripe { background: #635bff; color: #fff; }
.kc-pill-paypal { background: #003087; color: #fff; }

/* ══════════════════════════════════════════════════════════════════════════ */
/* WOOCOMMERCE NOTICES (shown above widget by WC)                             */
/* ══════════════════════════════════════════════════════════════════════════ */

.kc-cart-container ~ .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-message {
    background: #f0fdf9;
    border-left: 3px solid var(--kc-accent, #00b4a0);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #1a1a2e;
    list-style: none;
    margin-bottom: 18px;
}

.kc-cart-container ~ .woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-error {
    background: #fff5f5;
    border-left: 3px solid #d94040;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #d94040;
    list-style: none;
    margin-bottom: 18px;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* RESPONSIVE                                                                 */
/* ══════════════════════════════════════════════════════════════════════════ */

/* ── Tablet (≤1024px): stack columns ─────────────────────────────────────── */
@media (max-width: 1024px) {
    .kc-cart-container {
        flex-direction: column;
        padding: 0 20px;
    }

    .kc-cart-totals-column {
        flex: none;
        width: 100%;
        position: relative;
        top: 0;
    }
}

/* ── Mobile (≤768px) ─────────────────────────────────────────────────────── */
/*
 * 4-column grid: [×24px] [img56px] [info 1fr] [subtotal auto]
 * Row 1: remove | image | name+meta | subtotal
 * Row 2:        | image | qty       |
 */
@media (max-width: 768px) {
    .kc-cart-container {
        padding: 0 16px;
        margin: 24px auto;
        gap: 16px;
    }

    .kc-cart-items-card {
        padding: 22px 18px 16px;
    }

    .kc-cart-col-labels {
        display: none;
    }

    .kc-cart-section-title {
        font-size: 1.15rem;
        margin-bottom: 16px;
    }

    .kc-cart-item {
        grid-template-columns: 24px 56px 1fr auto;
        grid-template-rows: auto auto;
        gap: 6px 12px;
        padding: 16px 0;
        align-items: start;
    }

    .kc-item-remove {
        grid-column: 1;
        grid-row: 1;
        margin-top: 2px;
    }

    .kc-item-image {
        grid-column: 2;
        grid-row: 1 / 3;
    }

    .kc-item-img {
        width: 56px !important;
        height: 56px !important;
    }

    .kc-item-info {
        grid-column: 3;
        grid-row: 1;
    }

    /* Unit price hidden — subtotal is in col 4 */
    .kc-item-price {
        display: none;
    }

    /* Subtotal top-right */
    .kc-item-subtotal {
        grid-column: 4;
        grid-row: 1;
        text-align: right;
        font-size: 0.9rem;
        white-space: nowrap;
        align-self: start;
    }

    /* Qty stepper below the info */
    .kc-item-qty {
        grid-column: 3;
        grid-row: 2;
        justify-content: flex-start;
        margin-top: 2px;
    }
}

/* ── Small mobile (≤480px) ───────────────────────────────────────────────── */
/*
 * Same 4-column grid but with 52px image and tighter gaps.
 */
@media (max-width: 480px) {
    .kc-cart-container {
        padding: 0 12px;
        margin: 16px auto;
        gap: 12px;
    }

    .kc-cart-items-card {
        padding: 18px 14px 14px;
    }

    .kc-cart-totals-card {
        padding: 18px 16px;
    }

    .kc-cart-item {
        grid-template-columns: 22px 52px 1fr auto;
        gap: 6px 10px;
        padding: 14px 0;
    }

    .kc-item-img {
        width: 52px !important;
        height: 52px !important;
    }

    .kc-item-subtotal {
        font-size: 0.88rem;
    }

    /* Qty stepper — shrink slightly */
    .kc-qty-btn {
        width: 26px;
        height: 30px;
    }

    .kc-qty-input {
        width: 32px;
        height: 30px;
        font-size: 0.82rem;
    }

    .kc-coupon-row {
        flex-direction: column;
    }

    .kc-coupon-btn {
        width: 100%;
        text-align: center;
    }

    .kc-cart-actions {
        padding-top: 12px;
    }

    .kc-btn-update {
        font-size: 0.78rem;
        padding: 8px 12px;
    }
}
