/* ============================================================
   Charge.az — Mağaza (səbət, checkout, sifariş vəziyyəti)
   main.css-in üzərinə əlavə olunur; yalnız mağaza səhifələrində yüklənir.
   ============================================================ */

.shop-page { padding: 40px 0 80px; }
.shop-title { font-size: clamp(26px, 4vw, 34px); margin: 0 0 26px; }

.shop-alert {
    padding: 13px 17px; border-radius: 10px; margin-bottom: 20px;
    font-size: 14.5px; line-height: 1.5;
}
.shop-alert-ok   { background: #e6f5ee; color: #1f8a5f; border: 1px solid #bde3ce; }
.shop-alert-warn { background: #fdf3e2; color: #a86b12; border: 1px solid #f0d9ae; }

.shop-empty { text-align: center; padding: 70px 20px; color: #6b7d79; }
.shop-empty p { font-size: 17px; margin-bottom: 20px; }

/* ── Səbət ───────────────────────────────────────────────── */
.cart-layout {
    display: grid; grid-template-columns: 1fr 330px; gap: 28px; align-items: start;
}

.cart-item {
    display: grid;
    grid-template-columns: 84px 1fr auto auto;
    gap: 16px; align-items: center;
    padding: 18px; margin-bottom: 12px;
    background: #fff; border: 1px solid #e2e8e7; border-radius: 12px;
    transition: opacity .15s;
}
.cart-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 9px; background: #f0f4f3; }
.cart-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cart-name { font-weight: 600; color: #14322c; font-size: 15.5px; }
.cart-meta, .cart-unit { font-size: 13px; color: #6b7d79; }
.cart-warn { font-size: 12.5px; color: #a86b12; }

.cart-qty { display: flex; align-items: center; gap: 6px; }
.qty-btn {
    width: 34px; height: 34px; border: 1px solid #e2e8e7; background: #fff;
    border-radius: 8px; font-size: 18px; line-height: 1; cursor: pointer;
    display: grid; place-items: center; color: #14322c;
}
.qty-btn:hover { background: #57a695; border-color: #57a695; color: #fff; }
.qty-input {
    width: 58px; text-align: center; padding: 7px; font-size: 15px;
    border: 1px solid #e2e8e7; border-radius: 8px;
    font-variant-numeric: tabular-nums;
}

.cart-line { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.line-total { font-size: 16px; color: #14322c; white-space: nowrap; }
.cart-remove {
    background: none; border: none; color: #c0392b; font-size: 12.5px;
    cursor: pointer; padding: 0; text-decoration: underline;
}

.cart-summary, .checkout-summary {
    background: #fff; border: 1px solid #e2e8e7; border-radius: 12px;
    padding: 22px; position: sticky; top: 90px;
}
.cart-summary h2, .checkout-summary h2 { font-size: 17px; margin: 0 0 16px; }

.summary-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 9px 0; font-size: 14.5px; border-bottom: 1px solid #eef2f1;
}
.summary-total {
    border-bottom: none; border-top: 2px solid #e2e8e7;
    margin-top: 6px; padding-top: 14px; font-size: 16px;
}
.summary-total strong { font-size: 21px; color: #57a695; }

.summary-items { list-style: none; padding: 0; margin: 0 0 6px; }
.summary-items li {
    display: grid; grid-template-columns: auto 1fr auto; gap: 9px;
    padding: 8px 0; font-size: 14px; border-bottom: 1px solid #eef2f1;
}
.si-qty { color: #6b7d79; font-variant-numeric: tabular-nums; }
.si-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.si-total { white-space: nowrap; font-weight: 600; }

.btn-block { display: block; width: 100%; text-align: center; margin-top: 16px; }
.btn-link-back { display: block; text-align: center; margin-top: 12px; font-size: 14px; color: #6b7d79; }
.summary-note { font-size: 12px; color: #8a9a96; line-height: 1.5; margin: 16px 0 0; }

/* ── Checkout ────────────────────────────────────────────── */
.checkout-layout { display: grid; grid-template-columns: 1fr 330px; gap: 28px; align-items: start; }

.steps {
    display: flex; list-style: none; padding: 0; margin: 0 0 24px;
    gap: 6px; flex-wrap: wrap; counter-reset: step;
}
.step {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: #8a9a96; padding: 8px 13px;
    border-radius: 30px; background: #f0f4f3; white-space: nowrap;
}
.step span {
    width: 21px; height: 21px; border-radius: 50%;
    background: #d7e3e0; color: #6b7d79;
    display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
}
.step.is-current { background: #57a695; color: #fff; }
.step.is-current span { background: rgba(255,255,255,.28); color: #fff; }
.step.is-done { background: #e6f5ee; color: #1f8a5f; }
.step.is-done span { background: #1f8a5f; color: #fff; }
.step.is-done span::after { content: '✓'; }
.step.is-done span { font-size: 0; }
.step.is-done span::after { font-size: 12px; }

.panel {
    background: #fff; border: 1px solid #e2e8e7; border-radius: 12px; padding: 26px;
}
.panel h2 { font-size: 19px; margin: 0 0 8px; }
.panel-hint { font-size: 14px; color: #6b7d79; margin: 0 0 22px; line-height: 1.55; }

.form-row { margin-bottom: 17px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: #1d2b28; }
.req { color: #c0392b; }
.form-row input, .form-row textarea {
    width: 100%; padding: 11px 13px; font: inherit; font-size: 15px;
    border: 1px solid #e2e8e7; border-radius: 9px; background: #fff;
    color: #1d2b28;
}
.form-row input:focus, .form-row textarea:focus {
    outline: none; border-color: #57a695; box-shadow: 0 0 0 3px rgba(87,166,149,.16);
}
.form-row input.has-error { border-color: #c0392b; background: #fdeceb; }
.field-hint { display: block; font-size: 12px; color: #8a9a96; margin-top: 5px; }

.otp-input {
    width: 100%; font-size: 30px; letter-spacing: .35em; text-align: center;
    padding: 15px; border: 2px solid #e2e8e7; border-radius: 12px;
    font-family: ui-monospace, monospace; margin-bottom: 15px;
}
.otp-input:focus { outline: none; border-color: #57a695; }

.btn-resend {
    display: block; width: 100%; margin-top: 14px; padding: 9px;
    background: none; border: none; color: #57a695; font-size: 13.5px;
    cursor: pointer; text-decoration: underline;
}
.btn-resend:disabled { color: #a8b8b4; cursor: default; text-decoration: none; }

.spinner {
    width: 34px; height: 34px; margin: 24px auto;
    border: 3px solid #e2e8e7; border-top-color: #57a695;
    border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Sifariş nəticəsi ────────────────────────────────────── */
.order-result {
    text-align: center; padding: 46px 26px; border-radius: 14px;
    margin-bottom: 24px; border: 1px solid #e2e8e7; background: #fff;
}
.order-result.is-ok      { background: #e6f5ee; border-color: #bde3ce; }
.order-result.is-bad     { background: #fdeceb; border-color: #f3cfcb; }
.order-result.is-pending { background: #fdf3e2; border-color: #f0d9ae; }

.result-icon {
    width: 62px; height: 62px; margin: 0 auto 18px; border-radius: 50%;
    display: grid; place-items: center; font-size: 30px; color: #fff;
    background: #8a9a96;
}
.is-ok .result-icon      { background: #1f8a5f; }
.is-bad .result-icon     { background: #c0392b; }
.is-pending .result-icon { background: #a86b12; }

.order-result h1 { font-size: 25px; margin: 0 0 10px; }
.result-ref { font-size: 14.5px; color: #6b7d79; margin: 0 0 14px; }
.result-msg { font-size: 15px; line-height: 1.6; max-width: 520px; margin: 0 auto 20px; }

.order-card {
    background: #fff; border: 1px solid #e2e8e7; border-radius: 12px;
    padding: 24px; max-width: 620px; margin: 0 auto;
}
.order-card h2 { font-size: 17px; margin: 0 0 14px; }
.order-meta { font-size: 13px; color: #6b7d79; margin-top: 16px; line-height: 1.6; }
.order-meta code { background: #f0f4f3; padding: 2px 7px; border-radius: 5px; font-size: 12.5px; }

/* ── Məhsul kartlarında qiymət / səbət (products.php) ────── */
.p-price {
    display: flex; align-items: baseline; gap: 9px; margin: 10px 0 4px;
}
.p-price strong { font-size: 20px; color: #14322c; }
.p-price .p-ask { font-size: 14.5px; color: #6b7d79; font-weight: 500; }

.p-stock { font-size: 12.5px; margin-bottom: 12px; }
.p-stock.ok   { color: #1f8a5f; }
.p-stock.low  { color: #a86b12; }
.p-stock.out  { color: #c0392b; }

.btn-cart {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 11px 16px; border: none; border-radius: 9px;
    background: #57a695; color: #fff; font: inherit; font-weight: 600;
    cursor: pointer; transition: background .15s;
}
.btn-cart:hover:not(:disabled) { background: #4a9384; }
.btn-cart:disabled { background: #d7e3e0; color: #8a9a96; cursor: not-allowed; }
.btn-cart.is-added { background: #1f8a5f; }

/* Başlıqdakı səbət nişanı */
.nav-cart { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.cart-count {
    position: absolute; top: -6px; right: -10px;
    min-width: 18px; height: 18px; padding: 0 5px;
    background: #57a695; color: #fff; border-radius: 10px;
    font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.cart-count:empty, .cart-count[data-count="0"] { display: none; }

@media (max-width: 900px) {
    .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
    .cart-summary, .checkout-summary { position: static; }
    .form-grid { grid-template-columns: 1fr; }
    .cart-item { grid-template-columns: 64px 1fr; gap: 12px; }
    .cart-thumb { width: 64px; height: 64px; }
    .cart-qty, .cart-line { grid-column: 2; }
    .cart-line { align-items: flex-start; flex-direction: row; gap: 14px; align-items: center; }
}
