/* ============================================================
   Cart page: com_cart_1
   Uses the same colours as product-cart.css
   ============================================================ */

.com_cart_1 {
    --amt-brand: #40349a;
    --amt-brand-dark: #2f2675;
    --amt-border: #e4e2ef;
    --amt-text: #1a1a1a;
    --amt-muted: #6b6b7b;
    --amt-danger: #c0392b;

    max-width: 1100px;
    margin: 300px auto;
    padding: 0 16px;
    color: var(--amt-text);
}

.com_cart_1 .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.cart-title {
    font-size: 2rem;
    margin: 0 0 28px;
}

/* ---- Empty state ---- */
.cart-empty {
    text-align: center;
    padding: 60px 20px;
    border: 1.5px dashed var(--amt-border);
    border-radius: 14px;
}

.cart-empty p {
    font-size: 1.1rem;
    color: var(--amt-muted);
    margin: 0 0 20px;
}

/* ---- Layout ---- */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

/* ---- Items ---- */
.cart-items {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--amt-border);
}

.cart-item {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--amt-border);
}

.cart-item-image img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border-radius: 10px;
    background: #f7f7fb;
    display: block;
}

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

.cart-item-name {
    font-weight: 600;
    color: var(--amt-text);
    text-decoration: none;
    line-height: 1.35;
}

.cart-item-name:hover {
    color: var(--amt-brand);
}

.cart-item-price {
    font-size: 0.9rem;
    color: var(--amt-muted);
}

.cart-item-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 4px;
}

.cart-qty-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-qty-form input[type="number"] {
    width: 64px;
    height: 36px;
    border: 1.5px solid var(--amt-border);
    border-radius: 8px;
    text-align: center;
    font: inherit;
}

.cart-qty-form input[readonly] {
    background: #f7f7fb;
    color: var(--amt-muted);
}

.cart-note {
    font-size: 0.85rem;
    color: var(--amt-muted);
}

.cart-link {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-size: 0.9rem;
    color: var(--amt-brand);
    text-decoration: underline;
    cursor: pointer;
}

.cart-remove {
    color: var(--amt-danger);
}

.cart-item-total {
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
}

/* ---- Summary ---- */
.cart-summary {
    position: sticky;
    top: 20px;
    padding: 24px;
    border: 1px solid var(--amt-border);
    border-radius: 14px;
    background: #fafafd;
}

.cart-summary h2 {
    font-size: 1.2rem;
    margin: 0 0 18px;
}

.cart-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
}

.cart-row.muted {
    color: var(--amt-muted);
    font-size: 0.9rem;
}

.cart-row.total {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--amt-border);
    font-size: 1.25rem;
    font-weight: 700;
}

.cart-gst {
    margin: 4px 0 20px;
    font-size: 0.85rem;
    color: var(--amt-muted);
}

.cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 28px;
    border-radius: 10px;
    background: var(--amt-brand);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(64, 52, 154, 0.25);
    transition: background 0.15s;
}

.cart-btn:hover {
    background: var(--amt-brand-dark);
    color: #fff;
}

.cart-checkout {
    width: 100%;
    box-sizing: border-box;
}

.cart-continue {
    display: block;
    margin-top: 14px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--amt-brand);
    text-decoration: none;
}

/* ---- Mobile ---- */
@media (max-width: 860px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
    .cart-summary {
        position: static;
    }
}

@media (max-width: 520px) {
    .cart-item {
        grid-template-columns: 72px 1fr;
    }
    .cart-item-image img {
        width: 72px;
        height: 72px;
    }
    .cart-item-total {
        grid-column: 2;
    }
}

/* ============================================================
   Checkout box (opens from "Proceed to Checkout")
   ============================================================ */

button.cart-btn {
    border: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

button.cart-btn:disabled {
    background: #b9b6cc;
    box-shadow: none;
    cursor: not-allowed;
}

.checkout-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
    background: rgba(20, 18, 40, 0.55);
}

.checkout-overlay[hidden] {
    display: none;
}

.checkout-box {
    position: relative;
    width: 100%;
    max-width: 560px;
    padding: 28px;
    border-radius: 16px;
    background: #fff;
    color: var(--amt-text);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: checkout-in 0.2s ease-out;
}

@keyframes checkout-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

.checkout-box h2 {
    margin: 0 0 18px;
    font-size: 1.5rem;
}

.checkout-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f1f0f8;
    color: var(--amt-text);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.checkout-close:hover {
    background: #e4e2ef;
}

/* Review notice */
.checkout-notice {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid #f3d98b;
    border-radius: 12px;
    background: #fff8e1;
    color: #5c4400;
}

.checkout-notice strong {
    display: block;
    margin-bottom: 4px;
}

.checkout-notice p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.checkout-notice-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e0a800;
    color: #fff;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, serif;
}

.checkout-mini-summary {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 10px;
    background: #f7f7fb;
}

/* Form */
.checkout-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 14px;
    padding: 0;
    border: 0;
}

.checkout-field[hidden] {
    display: none;
}

.checkout-field label,
.checkout-field legend {
    font-size: 0.9rem;
    font-weight: 600;
}

.checkout-field input[type="text"],
.checkout-field input[type="email"],
.checkout-field input[type="tel"],
.checkout-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1.5px solid var(--amt-border);
    border-radius: 10px;
    font: inherit;
    font-size: 1rem;
    background: #fff;
}

.checkout-field input:focus,
.checkout-field textarea:focus {
    outline: none;
    border-color: var(--amt-brand);
    box-shadow: 0 0 0 3px rgba(64, 52, 154, 0.15);
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.checkout-choice label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1.5px solid var(--amt-border);
    border-radius: 10px;
    font-weight: 400;
    cursor: pointer;
}

.checkout-choice label:has(input:checked) {
    border-color: var(--amt-brand);
    background: #f6f5fc;
}

.checkout-choice input {
    accent-color: var(--amt-brand);
}

.checkout-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.checkout-error {
    margin: 0 0 14px;
    padding: 10px 14px;
    border: 1px solid #f1c6c1;
    border-radius: 10px;
    background: #fbeaea;
    color: #8a2419;
    font-size: 0.9rem;
}

.checkout-error[hidden] {
    display: none;
}

/* Done */
.checkout-done {
    text-align: center;
    padding: 10px 0;
}

.checkout-done-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e6f5ec;
    color: #1e8e4e;
    font-size: 2rem;
    font-weight: 700;
}

.checkout-done p {
    color: var(--amt-muted);
    line-height: 1.6;
}

.checkout-done .cart-btn {
    margin-top: 10px;
}

@media (max-width: 520px) {
    .checkout-overlay {
        padding: 0;
        align-items: stretch;
    }
    .checkout-box {
        border-radius: 0;
        min-height: 100%;
        padding: 24px 16px;
    }
    .checkout-grid {
        grid-template-columns: 1fr;
    }
}