/* ===============================================================
   ShopPro — cart, checkout and order confirmation
   =============================================================== */

/* ---------------- Cart ---------------- */

.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; align-items: start; padding-bottom: 40px; }

.cart-lines { display: flex; flex-direction: column; gap: 12px; }

.cart-line {
    display: grid; grid-template-columns: 90px minmax(0, 1fr) auto auto;
    gap: 16px; align-items: center;
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--r-lg); padding: 14px;
}

.cart-thumb { width: 90px; height: 90px; border-radius: var(--r); overflow: hidden;
              background: var(--line-2); display: grid; place-items: center; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }

.cart-info h3 { font-size: 15px; font-weight: 650; margin: 0 0 5px; line-height: 1.4; }
.cart-info h3 a:hover { color: var(--blue); }
.cart-options { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 4px; font-size: 12.5px; color: var(--muted); }
.cart-sku { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.cart-alert { font-size: 12.5px; color: var(--amber); font-weight: 600; margin: 0 0 6px; }
.cart-remove button { background: none; border: 0; color: var(--muted); font-size: 12.5px;
                      cursor: pointer; padding: 0; text-decoration: underline; }
.cart-remove button:hover { color: var(--red); }

.cart-qty { display: flex; flex-direction: column; gap: 7px; align-items: center; }
.cart-update-btn { display: none; }

.cart-price { text-align: right; min-width: 110px; }
.cart-price strong { display: block; font-size: 16px; font-weight: 700; }
.cart-price small { display: block; font-size: 12px; color: var(--muted); }
.cart-price .was { text-decoration: line-through; }

/* ---------------- Summary panels ---------------- */

.cart-summary, .checkout-summary {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--r-lg); padding: 20px; position: sticky; top: 96px;
}
.cart-summary h2, .checkout-summary h2 { font-size: 16px; font-weight: 700; margin: 0 0 16px; }

.coupon-form { display: flex; gap: 8px; margin-bottom: 16px; }
.coupon-form input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--line);
                     border-radius: var(--r-sm); font: inherit; font-size: 13.5px; }
.coupon-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.13); }

.coupon-applied {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d;
    border-radius: var(--r-sm); padding: 9px 12px; margin-bottom: 16px; font-size: 13px;
}
.coupon-applied em { font-style: normal; opacity: .8; margin-left: 4px; }
.coupon-applied button { background: none; border: 0; color: inherit; font-size: 18px; cursor: pointer; line-height: 1; }

.totals { margin: 0 0 18px; }
.totals > div { display: flex; align-items: baseline; justify-content: space-between;
                gap: 12px; padding: 7px 0; font-size: 14px; }
.totals dt { color: var(--muted); margin: 0; }
.totals dt small { display: block; font-size: 11.5px; opacity: .85; }
.totals dd { margin: 0; font-weight: 600; text-align: right; white-space: nowrap; }
.totals .is-discount dd { color: var(--green); }
.totals .is-tax { font-size: 13px; }
.totals .free { color: var(--green); font-weight: 700; }
.totals .grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 13px; }
.totals .grand dt { color: var(--ink); font-size: 15.5px; font-weight: 700; }
.totals .grand dd { font-size: 21px; font-weight: 800; letter-spacing: -.5px; }

.totals-note { font-size: 12px; color: var(--muted); margin: 0 0 14px; line-height: 1.55; }

.trust-mini { display: flex; justify-content: center; gap: 16px; margin-top: 14px;
              font-size: 12px; color: var(--muted); }

/* ---------------- Checkout ---------------- */

.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 26px;
            align-items: start; padding-bottom: 40px; }
.checkout-main { display: flex; flex-direction: column; gap: 16px; }

.co-block { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.co-block h2 { display: flex; align-items: center; gap: 11px; font-size: 16px;
               font-weight: 700; margin: 0 0 18px; }
.co-block h3 { font-size: 13px; font-weight: 700; margin: 18px 0 5px; color: var(--muted);
               text-transform: uppercase; letter-spacing: .6px; }
.co-step { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px;
           background: var(--navy); color: #fff; font-size: 13px; font-weight: 700; flex: 0 0 26px; }

.co-block .field { margin-bottom: 15px; }
.co-block .field:last-child { margin-bottom: 0; }
.co-block label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.co-block .req { color: var(--red); }
.co-block input[type="text"], .co-block input[type="email"], .co-block input[type="tel"],
.co-block select, .co-block textarea {
    width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--r-sm);
    font: inherit; font-size: 14px; background: var(--white); color: var(--ink);
}
.co-block input:focus, .co-block select:focus, .co-block textarea:focus {
    outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}
.co-block input.is-invalid, .co-block select.is-invalid { border-color: var(--red); }
.co-block .hint { font-size: 12px; color: var(--muted); margin: 5px 0 0; font-weight: 400; }
.co-block .err { font-size: 12px; color: var(--red); margin: 5px 0 0; font-weight: 600; }
.co-block textarea { resize: vertical; min-height: 76px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row.three { grid-template-columns: repeat(3, 1fr); }

.co-check { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px;
            font-weight: 400 !important; cursor: pointer; margin: 14px 0 0; color: var(--ink-2); }
.co-check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--blue);
                  cursor: pointer; flex: 0 0 16px; }
.co-check a { color: var(--blue); text-decoration: underline; }

.co-option {
    display: flex; align-items: center; gap: 13px; padding: 13px 15px;
    border: 1.5px solid var(--line); border-radius: var(--r); margin-bottom: 9px;
    cursor: pointer; transition: border-color .12s, background .12s;
}
.co-option:hover { border-color: #cbd5e1; }
.co-option:has(input:checked) { border-color: var(--navy); background: #f8fafc; }
.co-option input { width: 17px; height: 17px; accent-color: var(--navy); cursor: pointer; flex: 0 0 17px; }
.co-option-body { flex: 1; }
.co-option-body strong { display: block; font-size: 14px; }
.co-option-body small { display: block; font-size: 12.5px; color: var(--muted); }
.co-option-price { font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.co-option-price .free, .co-option-price em { color: var(--green); font-style: normal; }

.co-warning { background: #fffbeb; border: 1px solid #fde68a; color: #b45309;
              border-radius: var(--r-sm); padding: 12px 14px; font-size: 13.5px; margin: 0; }

.co-items { max-height: 320px; overflow-y: auto; margin-bottom: 16px;
            border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.co-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.co-item-img { position: relative; flex: 0 0 52px; width: 52px; height: 52px;
               border-radius: var(--r-sm); overflow: visible; background: var(--line-2); }
.co-item-img img { width: 52px; height: 52px; border-radius: var(--r-sm); object-fit: cover; }
.co-item-img em {
    position: absolute; top: -7px; right: -7px; background: var(--navy); color: #fff;
    border-radius: 999px; min-width: 19px; height: 19px; display: grid; place-items: center;
    font-size: 11px; font-weight: 700; font-style: normal; padding: 0 5px;
}
.co-item-info { flex: 1; min-width: 0; }
.co-item-info strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.4; }
.co-item-info small { display: block; font-size: 11.5px; color: var(--muted); }
.co-item-price { font-size: 13.5px; font-weight: 650; white-space: nowrap; }

.co-secure { font-size: 11.5px; color: var(--muted); text-align: center; margin: 12px 0 0; line-height: 1.5; }

/* ---------------- Confirmation ---------------- */

.confirm { text-align: center; padding: 40px 20px 30px; }
.confirm-mark {
    width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 999px;
    background: #dcfce7; color: #15803d; display: grid; place-items: center;
    font-size: 32px; font-weight: 700;
}
.confirm h1 { font-size: 28px; font-weight: 750; letter-spacing: -.7px; margin: 0 0 10px; }
.confirm-sub { color: var(--muted); font-size: 15px; margin: 0 auto 18px; max-width: 60ch; }
.confirm .notice { max-width: 640px; margin: 0 auto; }

.confirm-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px;
                gap: 20px; align-items: start; padding-bottom: 44px; }
.confirm-address { font-size: 13.5px; line-height: 1.75; color: var(--ink-2); margin: 0; }
.confirm-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 20px; }

.status-pill { display: inline-block; background: #dbeafe; color: #1d4ed8;
               border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 700; }

/* ---------------- Checkout credits ---------------- */

.credit-applied { margin-top: 12px; padding: 12px; background: #f0fdf4;
                  border: 1px solid #bbf7d0; border-radius: var(--r-sm); }
.credit-header { display: flex; align-items: center; justify-content: space-between;
                 gap: 12px; font-size: 13px; margin-bottom: 8px; font-weight: 600; }
.credit-total { color: var(--green); font-weight: 700; }
.credit-line { display: flex; align-items: center; justify-content: space-between;
               gap: 12px; font-size: 12.5px; color: var(--ink-2); padding: 3px 0; }
.credit-line .credit-amount { color: var(--green); font-weight: 600; }

.credit-payable { margin-top: 8px; }
.payable-total { font-size: 21px !important; font-weight: 800; letter-spacing: -.5px; color: var(--navy); }
.credit-free { margin: 14px 0; }

/* ---------------- Responsive ---------------- */

@media (max-width: 1000px) {
    .cart-layout, .checkout, .confirm-grid { grid-template-columns: 1fr; }
    .cart-summary, .checkout-summary { position: static; }
}

@media (max-width: 700px) {
    .cart-line { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
    .cart-thumb { width: 72px; height: 72px; }
    .cart-qty { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; }
    .cart-update-btn { display: inline-flex; }
    .cart-price { grid-column: 1 / -1; text-align: left; }
    .field-row, .field-row.three { grid-template-columns: 1fr; }
    .confirm h1 { font-size: 22px; }
}
