/* =============================================================================
   Custom Cart Page
   Namespace: .custom-cart-page
   Mobile-first, no CSS variables, direct static values.
   ============================================================================= */

/* ── Wrapper & Container ───────────────────────────────────────────────────── */

.custom-cart-page {
    padding: 24px 0 48px;
}

.ccp-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ccp-items-col {
    width: 100%;
}

.ccp-summary-col {
    width: 100%;
}

/* ── Desktop 2-column layout ──────────────────────────────────────────────── */

@media (min-width: 992px) {
    .ccp-container {
        flex-direction: row;
        align-items: flex-start;
        gap: 32px;
    }

    .ccp-items-col {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .ccp-summary-col {
        flex: 1 1 auto;
        /* Sticky sidebar anchors below fixed header (~80px) */
        position: sticky;
        top: 96px;
    }
}

/* ── Items Card ────────────────────────────────────────────────────────────── */

.ccp-items-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
}

.ccp-card-header {
    margin-bottom: 35px;
}

.ccp-title {
    font-size: 40px;
    font-weight: 700;
    color: #000;
    margin: 0 0 4px;
    line-height: 1.25;
}

.ccp-subtitle {
    font-size: 20px;
    color: #3C3C3C;
    margin: 0;
    font-weight: 500;
}

/* ── Checkbox ──────────────────────────────────────────────────────────────── */

.ccp-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

/* Hide native checkbox — replaced by .ccp-checkbox-custom */
.ccp-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.ccp-checkbox-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #020087;
    border-radius: 4px;
    background: #ffffff;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ccp-checkbox:checked + .ccp-checkbox-custom {
    background: linear-gradient(276.97deg, #0200B9 0.03%, #020207 99.97%);
    border-color: transparent;
}

/* Checkmark drawn with border trick */
.ccp-checkbox:checked + .ccp-checkbox-custom::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #ffffff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.ccp-checkbox:focus-visible + .ccp-checkbox-custom {
    outline: 2px solid #1400ff;
    outline-offset: 2px;
}

/* ── Select-all Row ────────────────────────────────────────────────────────── */

.ccp-select-all-row {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 4px;
}

.ccp-select-all-text {
    font-size: 18px;
    color: #3C3C3C;
    margin: 0;
    font-weight: 500;
}

/* ── Cart Item Row ─────────────────────────────────────────────────────────── */

.ccp-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.ccp-item-checkbox-wrap {
    flex-shrink: 0;
    align-self: center;
}

/* Thumbnail */
.ccp-item-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
}

.ccp-item-thumb img,
.ccp-item-thumb .ccp-thumb-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    display: block;
}

/* Info column */
.ccp-item-info {
    flex: 1;
    min-width: 0;
}

.ccp-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #003465;
    margin-bottom: 4px;
    line-height: 1.4;
}

.ccp-item-name-link {
    color: #111827;
    text-decoration: none;
    transition: color 0.15s ease;
}

.ccp-item-name-link:hover {
    color: #1400ff;
}

/* Price — WooCommerce wraps sale in <ins>, old price in <del> */
.ccp-item-price {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.ccp-item-price .price {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.ccp-item-price ins {
    font-size: 15px;
    font-weight: 700;
    color: #1400ff;
    text-decoration: none;
}

.ccp-item-price del {
    font-size: 13px;
    font-weight: 400;
    color: #9ca3af;
}

.ccp-item-price > .woocommerce-Price-amount,
.ccp-item-price .price > .woocommerce-Price-amount {
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(321.04deg, #0200B9 22.36%, #020207 77.64%) text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ── Quantity Selector ─────────────────────────────────────────────────────── */

.ccp-qty-wrap {
    display: inline-flex;
    align-items: center;
    height: 32px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    overflow: hidden;
    background: #F8FAFC;
}

.ccp-qty-btn {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background 0.12s ease;
    flex-shrink: 0;
    margin: 0;
}

.ccp-qty-btn:hover {
    background: #f3f4f6;
}

.ccp-qty-btn:active {
    background: #e5e7eb;
}

.ccp-qty-input {
    width: 24px;
    height: 16px;
    margin: 0;
    border: none !important;
    box-shadow: none !important;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    background: transparent !important;
    padding: 0 !important;
    -moz-appearance: textfield;
    appearance: textfield;
}

.ccp-qty-input:focus {
    outline: none;
    background: #f9fbff;
}

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

/* ── Remove Button ─────────────────────────────────────────────────────────── */

.ccp-remove-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 8px;
    margin: 0 0 auto 0;
    border-radius: 8px;
    transition: color 0.15s ease, background 0.15s ease;
    margin-left: 4px;
}

.ccp-remove-btn:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* ── Item state classes ─────────────────────────────────────────────────────── */

.ccp-item.is-removing {
    opacity: 0;
    transform: translateX(20px);
}

.ccp-item.is-updating {
    opacity: 0.6;
    pointer-events: none;
}

/* ── Empty cart ─────────────────────────────────────────────────────────────── */

.ccp-empty {
    padding: 40px 0;
    text-align: center;
    color: #6b7280;
    font-size: 15px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RIGHT COLUMN — Order Summary Card
   ═══════════════════════════════════════════════════════════════════════════ */

.ccp-summary-card {
    background: linear-gradient(321.04deg, #0200B9 22.36%, #020207 77.64%);
    border-radius: 12px;
    padding: 24px;
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(20, 0, 255, 0.25);
}

/* Header */
.ccp-summary-title {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    padding-bottom: 16px;
    margin: 0 0 24px;
    line-height: 1.25;
    border-bottom: 1px solid #DCE2E8;
}

.ccp-summary-count {
    font-size: 20px;
    color: #fff;
    margin: 0 0 16px;
    font-weight: 600;
}

/* ── Selected items list ───────────────────────────────────────────────────── */

.ccp-summary-items {
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 20px;
}

.ccp-summary-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 18px;
    font-weight: 500;
    margin-left: 0 !important;
    line-height: 1.4;
    color: #fff;
}

.ccp-summary-item-qty {
    flex-shrink: 0;
    color: #fff;
    font-size: inherit;
    padding-top: 1px;
}

.ccp-summary-item-name {
    flex: 1;
}

.ccp-summary-item-price {
    flex-shrink: 0;
    font-weight: inherit;
    white-space: nowrap;
    font-size: inherit;
}

.ccp-summary-no-items {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    list-style: none;
}

/* ── Divider ────────────────────────────────────────────────────────────────── */

.ccp-summary-divider {
    height: 1px;
    background: #fff;
    margin: 16px 0;
}

.ccp-summary-divider--sm {
    margin: 12px 0;
}

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

.ccp-coupon-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 10px;
}

.ccp-coupon-row {
    display: flex;
    gap: 8px;
}

#wrapper .ccp-coupon-input {
    flex: 1;
    height: 40px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    color: #000;
    font-size: 14px;
    padding: 0 12px;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
    min-width: 0;
    margin: 0;
}

.ccp-coupon-input::placeholder {
    color: #94A3B8;
}

.ccp-coupon-btn {
    flex-shrink: 0;
    height: 40px;
    padding: 0 16px;
    background: #000000;
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin: 0;
    text-transform: none;
    white-space: nowrap;
    transition: opacity 0.15s ease;
}

.ccp-coupon-btn:hover {
    opacity: 0.9;
}

.ccp-coupon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ccp-coupon-msg {
    margin: 6px 0 0;
    font-size: 12px;
    min-height: 16px;
    line-height: 1.4;
}

.ccp-coupon-msg.is-success {
    color: #86efac;
}

.ccp-coupon-msg.is-error {
    color: #fca5a5;
}

/* Applied coupon tags */
.ccp-applied-coupons {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ccp-applied-coupon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 3px 10px 3px 12px;
    font-size: 12px;
    color: #ffffff;
    font-weight: 500;
}

.ccp-remove-coupon {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    padding: 0;
    font-size: 15px;
    line-height: 1;
    transition: color 0.12s ease;
}

.ccp-remove-coupon:hover {
    color: #fca5a5;
}

/* ── Totals ─────────────────────────────────────────────────────────────────── */

.ccp-totals {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ccp-totals-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ccp-totals-label {
    font-size: 16px;
    color: #fff;
    font-weight: 600;
}

.ccp-totals-value {
    font-size: 16px;
    color: #fff;
    font-weight: 600;
    text-align: right;
}

.ccp-totals-value .amount {
    color: #fff;
}

.ccp-totals-value--discount {
    color: #86efac;
}

/* Grand total */
.ccp-total-row {
    align-items: flex-start;
}

.ccp-total-label {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    padding-top: 4px;
}

.ccp-total-right {
    text-align: right;
}

.ccp-total-amount {
    display: block;
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.15;
}

/* Target the WooCommerce price wrapper inside #ccp-total */
#ccp-total .woocommerce-Price-amount {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
}

.ccp-vat-note {
    display: block;
    font-size: 14px;
    color: #FFFFFF;
    margin-top: 3px;
    font-weight: 400;
}

/* ── CTA Buttons ────────────────────────────────────────────────────────────── */

.ccp-cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.ccp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: none;
    transition: opacity 0.15s ease, background 0.15s ease;
    box-sizing: border-box;
}

.ccp-btn--checkout {
    background: #ffffff;
    color: #0200B9;
    text-transform: none;
    font-size: 18px;
    font-weight: 600;
}

.ccp-btn--continue {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: 2px solid #fff;
    font-size: 18px;
    font-weight: 600;
    text-transform: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Tablet adjustments
   ═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 768px) and (max-width: 991px) {
    .custom-cart-page {
        padding: 24px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile adjustments
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
    .custom-cart-page {
        padding: 16px 12px 40px;
    }

    .ccp-items-card {
        padding: 16px 14px;
    }

    .ccp-title {
        font-size: 20px;
    }

    .ccp-item {
        gap: 8px;
    }

    .ccp-item-thumb {
        width: 64px;
        height: 64px;
    }

    .ccp-item-thumb img,
    .ccp-item-thumb .ccp-thumb-img {
        width: 64px;
        height: 64px;
    }

    .ccp-summary-card {
        padding: 20px 16px;
    }

    .ccp-total-amount {
        font-size: 22px;
    }

    #ccp-total .woocommerce-Price-amount {
        font-size: 22px;
    }

    .ccp-coupon-btn {
        padding: 0 12px;
        font-size: 13px;
    }
}
