﻿/* ============================================
   Cart page — theme-matched (extends checkout.css tokens)
   Theme palette:
     primary: #D10024  (sale / danger / primary CTA)
     dark:    #15161D  (text, dark surfaces)
     body:    #2B2D42  (body text)
     grey:    #8D99AE  (secondary text)
     border:  #E4E7ED  (dividers)
     surface: #FBFBFC  (light bg)
   ============================================ */
.ct-section { padding-top: 30px; padding-bottom: 60px; }

/* Reuses .ck-layout, .ck-main, .ck-summary, .ck-card, .ck-card-header,
   .ck-card-title, .ck-card-body, .ck-totals, .ck-total-row, .ck-total-grand,
   .ck-total-discount, .ck-free, .ck-item-count, .ck-summary-card .ck-card-header,
   .ck-input, .ck-btn, .ck-btn-primary, .ck-btn-ghost, .ck-trust-list, .ck-alert,
   .ck-inline-info, .ck-inline-warning from checkout.css. */

/* Empty state */
.ct-empty {
    text-align: center;
    padding: 50px 20px;
}

.ct-empty-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--ck-surface);
    border: 1px solid var(--ck-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    color: var(--ck-grey);
    margin-bottom: 18px;
}

.ct-empty h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--ck-dark);
}

.ct-empty p {
    color: var(--ck-grey);
    margin: 0 0 24px;
}

/* Table */
.ct-table-wrap { overflow-x: auto; }

.ct-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.ct-table thead tr {
    background: var(--ck-surface);
    border-bottom: 2px solid var(--ck-border);
}

.ct-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ck-grey);
    font-weight: 700;
    border: 0;
}

.ct-col-price, .ct-col-qty, .ct-col-total { text-align: center !important; }
.ct-col-remove { width: 50px; }

.ct-table tbody tr {
    border-bottom: 1px solid var(--ck-border);
    transition: background 0.15s ease;
}

.ct-table tbody tr:hover {
    background: rgba(13, 158, 113, 0.02);
}

.ct-table tbody tr:last-child { border-bottom: 0; }

.ct-table td {
    padding: 18px 16px;
    vertical-align: middle;
    color: var(--ck-body);
    border: 0;
}

.ct-table .ct-col-total { text-align: right; }
.ct-table .ct-col-remove { text-align: center; }

/* Product cell */
.ct-product {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

.ct-product-img {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: var(--ck-surface);
    border: 1px solid var(--ck-border);
}

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

.ct-product-qty {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--ck-primary);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid #ffffff;
}

.ct-product-body { min-width: 0; }

.ct-product-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--ck-dark);
    line-height: 1.35;
    text-transform: none;
}

.ct-product:hover .ct-product-name { color: var(--ck-primary); }

.ct-product-brand,
.ct-product-variant {
    font-size: 11px;
    color: var(--ck-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.ct-product-variant { color: var(--ck-primary); }

.ct-product-meta {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ct-product-meta li {
    font-size: 11px;
    color: var(--ck-grey);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ct-product-meta li i {
    color: var(--ck-primary);
    font-size: 11px;
    width: 12px;
    text-align: center;
}

.ct-meta-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 260px;
}

/* Price */
.ct-price {
    color: var(--ck-primary);
    font-weight: 700;
    font-size: 14px;
}

.ct-line-total {
    color: var(--ck-dark);
    font-weight: 700;
    font-size: 15px;
}

/* Quantity selector */
.ct-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--ck-border);
    border-radius: 4px;
    overflow: hidden;
    background: #ffffff;
    height: 38px;
}

.ct-qty-btn {
    width: 34px;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--ck-body);
    cursor: pointer;
    font-size: 11px;
    transition: background 0.15s ease, color 0.15s ease;
}

.ct-qty-btn:hover {
    background: var(--ck-primary);
    color: #ffffff;
}

.ct-qty input {
    width: 42px;
    height: 100%;
    border: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--ck-dark);
    background: transparent;
    -moz-appearance: textfield;
}

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

.ct-qty-sm { height: 36px; }
.ct-qty-sm .ct-qty-btn { width: 30px; font-size: 10px; }
.ct-qty-sm input { width: 36px; font-size: 13px; }

.ct-qty-readonly {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--ck-border);
    border-radius: 4px;
    background: var(--ck-surface);
    color: var(--ck-body);
    font-weight: 600;
}

/* Remove button */
.ct-remove {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--ck-border);
    background: #ffffff;
    color: var(--ck-grey);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    font-size: 13px;
}

.ct-remove:hover {
    border-color: var(--ck-primary);
    color: var(--ck-primary);
    background: rgba(209, 0, 36, 0.05);
}

.ct-remove:active { transform: scale(0.95); }

/* Cart actions row */
.ct-cart-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.ct-cart-actions .ck-btn:first-child { margin-right: auto; }

/* Coupon */
.ct-coupon {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--ck-border);
}

.ct-coupon-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--ck-body);
    margin-bottom: 8px;
}

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

.ct-coupon-row .ck-input {
    flex: 1;
    height: 40px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.ct-coupon-row .ck-btn-primary {
    height: 40px;
    padding: 0 18px;
    font-size: 12px;
}

.ct-coupon-msg {
    margin-top: 8px;
    font-size: 12px;
    min-height: 16px;
}

.ct-coupon-msg.is-success { color: #0d9e71; }
.ct-coupon-msg.is-error   { color: var(--ck-primary); }

/* Proceed button */
.ck-btn-proceed {
    width: 100%;
    height: 54px;
    font-size: 14px;
    margin-top: 18px;
}

/* Trust list (reuse .ck-trust-list from checkout.css) */
.ct-trust {
    list-style: none;
    margin: 20px 0 0;
    padding: 16px 0 0;
    border-top: 1px solid var(--ck-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ct-trust li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 12px;
    color: var(--ck-grey);
}

.ct-trust li i {
    color: #0d9e71;
    font-size: 14px;
    margin-top: 2px;
}

.ct-trust li strong {
    display: block;
    color: var(--ck-dark);
    font-size: 13px;
}

/* Mobile list */
.ct-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ct-mobile-item {
    position: relative;
    background: #ffffff;
    border: 1px solid var(--ck-border);
    border-radius: 4px;
    padding: 14px;
}

.ct-remove-mobile {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    font-size: 11px;
}

.ct-mobile-product {
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding-right: 28px;
}

.ct-mobile-product img {
    width: 64px;
    height: 64px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--ck-border);
}

.ct-mobile-info { min-width: 0; flex: 1; }

.ct-mobile-bottom {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--ck-border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ct-mobile-price {
    font-size: 13px;
    color: var(--ck-primary);
    font-weight: 700;
}

.ct-mobile-each {
    font-size: 11px;
    color: var(--ck-grey);
    font-weight: 500;
    margin-left: 2px;
}

.ct-mobile-total {
    margin-left: auto;
    font-size: 16px;
    font-weight: 700;
    color: var(--ck-dark);
}

/* Responsive toggle (reuses .hide-on-mobile / .show-on-mobile if defined) */
.show-on-mobile { display: none; }
.hide-on-mobile { display: block; }

@media only screen and (max-width: 767px) {
    .hide-on-mobile { display: none !important; }
    .show-on-mobile { display: flex !important; flex-direction: column; }
}

/* RTL */
.locale-rtl .ct-product { flex-direction: row-reverse; }
.locale-rtl .ct-table th { text-align: right; }
.locale-rtl .ct-meta-truncate { direction: ltr; text-align: right; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ct-remove, .ct-qty-btn, .ct-table tbody tr { transition: none !important; }
}

/* =============================================================
 * Universal Offers & Promotions Engine — cart breakdown
 * ============================================================= */
.ck-applied-offers {
    margin: 10px 0 14px;
    border: 1px dashed #d6b27d;
    border-radius: 10px;
    background: linear-gradient(135deg, #fff8e8 0%, #fff3dc 100%);
    padding: 4px 12px;
}
.ck-applied-offers summary {
    cursor: pointer;
    list-style: none;
    padding: 10px 0;
    font-weight: 700;
    color: #8a5a16;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.ck-applied-offers summary::-webkit-details-marker { display: none; }
.ck-offer-savings {
    color: #c83232;
    font-weight: 800;
    font-size: 0.9em;
    background: #fff;
    border-radius: 999px;
    padding: 2px 10px;
    border: 1px solid #e9c98a;
}
.ck-offer-list {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
}
.ck-offer-item {
    padding: 8px 0;
    border-top: 1px dashed rgba(138, 90, 22, 0.18);
    font-size: 0.92em;
}
.ck-offer-item:first-child { border-top: 0; }
.ck-offer-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.ck-offer-name { font-weight: 600; }
.ck-offer-code {
    font-family: 'SF Mono', Menlo, monospace;
    font-size: 0.78em;
    background: #fff;
    border: 1px solid #e0c890;
    border-radius: 4px;
    padding: 1px 6px;
    color: #8a5a16;
}
.ck-offer-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: #6b6b6b;
}
.ck-offer-type { font-style: italic; }
.ck-offer-amount { color: #c83232; font-weight: 700; }
.ck-offer-frees {
    list-style: none;
    margin: 4px 0 0;
    padding: 0 0 0 14px;
    font-size: 0.85em;
    color: #2d6a4f;
}
.ck-offer-frees li::before {
    content: '+';
    margin-right: 6px;
    color: #2d6a4f;
    font-weight: 700;
}

.ck-bundle-offers {
    margin: 10px 0 14px;
}
.ck-bundle-card {
    border: 1px solid #f0c878;
    border-radius: 10px;
    background: #fff9ec;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.ck-bundle-head {
    font-weight: 700;
    color: #8a5a16;
    margin-bottom: 6px;
}
.ck-bundle-body { font-size: 0.88em; }
.ck-bundle-row {
    display: flex;
    justify-content: space-between;
    margin: 2px 0;
    color: #5b5b5b;
}
.ck-bundle-save { color: #c83232; font-weight: 700; }

.ck-gift-offers {
    margin: 10px 0 14px;
    border: 1px solid #c9e3d0;
    border-radius: 10px;
    background: linear-gradient(135deg, #f0faf2 0%, #e0f4e6 100%);
    padding: 10px 12px;
}
.ck-gift-head {
    font-weight: 700;
    color: #2d6a4f;
    margin-bottom: 6px;
}
.ck-gift-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ck-gift-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    font-size: 0.92em;
}
.ck-gift-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #d4e8db;
}
.ck-gift-name { flex: 1; }
.ck-gift-price { color: #2d6a4f; font-weight: 700; }

.ck-total-savings {
    color: #2d6a4f !important;
    font-weight: 700;
    background: #e9f7ee;
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 6px;
}

/* BOGOF (Buy & Get) auto-added free product line */
.ct-row-bogof-free {
    background: linear-gradient(90deg, #f0faf2 0%, #fff 100%);
    border-left: 3px solid #2d6a4f;
}
.ct-bogof-badge {
    display: inline-block;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    font-size: 0.65em;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-left: 6px;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(22, 163, 74, 0.3);
}
.ct-row-bogof-free .ct-price,
.ct-row-bogof-free .ct-line-total {
    color: #16a34a;
    font-weight: 700;
    text-decoration: line-through;
    text-decoration-color: rgba(22, 163, 74, 0.3);
}
