/* ─── Page Layout ─── */
main.checkout-page {
    position: relative; z-index: 10;
    padding-top: calc(var(--topbar-h) + var(--header-h) + 48px);
    padding-bottom: 100px;
    min-height: 100vh;
}

.checkout-title {
    font-size: 32px; font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}
.checkout-title span { color: var(--primary); }
.checkout-subtitle {
    font-size: 14px;
    color: var(--text-sec);
    margin-bottom: 36px;
}

/* ─── Checkout Grid ─── */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}

/* ─── Section Cards ─── */
.checkout-section { margin-bottom: 24px; }

.section-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 16px;
}
.section-header i { color: var(--primary); width: 20px; }
.section-header h4 {
    font-size: 13px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--text-sec);
}
.section-header .item-count {
    margin-left: auto;
    background: rgba(238,0,0,0.15);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}

/* ─── Cart Items ─── */
.cart-items {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius);
    padding: 4px 0;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.cart-item {
    display: flex; align-items: center; gap: 18px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background .2s;
}
.cart-item:hover {
    background: rgba(255,255,255,0.02);
}
.cart-item:last-child { border-bottom: none; }

.cart-item img {
    width: 72px; height: 72px;
    border-radius: 12px; object-fit: cover;
    background: rgba(0,0,0,0.4); flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .info h5 {
    font-size: 15px; font-weight: 700; color: #fff;
    margin-bottom: 10px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cart-item .info .cart-item-category {
    font-size: 10px;
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}

/* Quantity Selector */
.cart-item-qty {
    display: inline-flex; align-items: center; gap: 0;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    overflow: hidden;
}
.cart-item-qty button {
    background: none; border: none;
    color: #fff; font-size: 16px; font-weight: 700;
    cursor: pointer; line-height: 1;
    padding: 8px 14px;
    transition: all .2s;
}
.cart-item-qty button:hover { 
    background: rgba(238,0,0,0.15);
    color: var(--primary); 
}
.cart-item-qty span { 
    font-size: 14px; font-weight: 700; 
    min-width: 32px; text-align: center;
    padding: 8px 4px;
    border-left: 1px solid rgba(255,255,255,0.06);
    border-right: 1px solid rgba(255,255,255,0.06);
}

/* Price & Remove */
.cart-item .price {
    text-align: right; flex-shrink: 0;
    display: flex; flex-direction: column;
    align-items: flex-end; gap: 8px;
}
.cart-item .price .price-amount {
    font-weight: 800; font-size: 16px;
    color: #fff;
}
.cart-item .price .price-unit {
    font-size: 11px;
    color: var(--text-sec);
}
.cart-item-remove {
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,74,74,0.08);
    border: 1px solid rgba(255,74,74,0.15);
    color: rgba(255,74,74,.6); cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 8px;
    transition: all .25s;
}
.cart-item-remove:hover { 
    color: #ff4a4a; 
    background: rgba(255,74,74,0.15);
    border-color: rgba(255,74,74,0.3);
    transform: scale(1.08); 
}

/* ─── Empty Cart State ─── */
.empty-cart {
    text-align: center;
    padding: 80px 30px;
}
.empty-cart-icon {
    width: 80px; height: 80px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px;
}
.empty-cart-icon i { color: var(--text-sec); opacity: 0.4; }
.empty-cart h3 { font-size: 20px; margin-bottom: 10px; }
.empty-cart p { color: var(--text-sec); margin-bottom: 30px; font-size: 14px; }
.empty-cart .btn-go-shop {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 32px;
    background: var(--primary);
    color: #fff; font-weight: 800; font-size: 14px;
    border-radius: 12px; text-decoration: none;
    transition: all .25s;
    box-shadow: 0 6px 20px rgba(238,0,0,0.25);
}
.empty-cart .btn-go-shop:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(238,0,0,0.4);
}

/* ─── Form ─── */
.checkout-form-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    padding: 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.form-group label {
    display: block;
    font-size: 11px; font-weight: 800;
    color: var(--text-sec);
    text-transform: uppercase; letter-spacing: .8px;
    margin-bottom: 9px;
}
.form-group input {
    width: 100%;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 14px 16px;
    color: #fff; font-size: 14px;
    outline: none; transition: border-color .25s, background .25s, box-shadow .25s;
}
.form-group input:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,.06);
    box-shadow: 0 0 0 3px rgba(238,0,0,0.1);
}
.form-group input::placeholder { color: rgba(255,255,255,.2); }

/* ─── Order Summary Sidebar ─── */
.checkout-sidebar { position: sticky; top: calc(var(--topbar-h) + var(--header-h) + 24px); }

.order-summary-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 28px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.summary-header {
    display: flex; align-items: center;
    justify-content: space-between;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.summary-header h4 { font-size: 17px; font-weight: 800; }
.summary-header i { color: #22c55e; width: 20px; }

.summary-items-list {
    max-height: 280px; overflow-y: auto;
    margin-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(238,0,0,0.3) transparent;
}
.summary-product-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.summary-product-item:last-child { border: none; padding-bottom: 0; }

/* ─── Coupon ─── */
.coupon-area { margin-bottom: 24px; }
.coupon-area label {
    display: block; font-size: 11px; font-weight: 800;
    color: var(--text-sec); text-transform: uppercase;
    letter-spacing: .8px; margin-bottom: 9px;
}
.coupon-input-group { display: flex; gap: 8px; }
.coupon-input-group input {
    flex: 1; background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; padding: 12px 14px;
    color: #fff; font-size: 13px; outline: none;
    transition: border-color .25s, box-shadow .25s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}
.coupon-input-group input:focus { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(238,0,0,0.1);
}
.coupon-input-group button {
    background: rgba(255,255,255,.06);
    color: #fff; border: 1px solid rgba(255,255,255,0.08);
    padding: 0 20px; border-radius: 10px;
    font-weight: 800; font-size: 12px;
    cursor: pointer; transition: all .2s;
    white-space: nowrap;
}
.coupon-input-group button:hover { 
    background: rgba(238,0,0,0.15); 
    border-color: rgba(238,0,0,0.3);
    color: var(--primary);
}

/* ─── Totals ─── */
.summary-totals {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 18px;
}
.total-line {
    display: flex; justify-content: space-between;
    font-size: 14px; color: var(--text-sec);
    margin-bottom: 10px;
}
.total-line.main-total {
    color: #fff; font-size: 24px; font-weight: 900;
    margin-top: 16px; padding-top: 16px;
    border-top: 2px dashed rgba(255,255,255,.06);
    margin-bottom: 0;
}
.total-line.main-total span:last-child {
    background: linear-gradient(135deg, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ─── Checkout Button ─── */
.btn-checkout-finalize {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; width: 100%;
    background: linear-gradient(135deg, var(--primary), #cc0000);
    color: #fff;
    border: none; border-radius: 14px;
    padding: 18px; margin-top: 24px;
    font-size: 15px; font-weight: 800;
    cursor: pointer; transition: .3s;
    box-shadow: 0 8px 28px rgba(238,0,0,.3);
    position: relative;
    overflow: hidden;
}
.btn-checkout-finalize::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 200%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left .6s;
}
.btn-checkout-finalize:hover::before {
    left: 100%;
}
.btn-checkout-finalize:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(238,0,0,.45);
}
.btn-checkout-finalize:active {
    transform: translateY(0);
}

.secure-footer {
    display: flex; align-items: center;
    justify-content: center; gap: 7px;
    margin-top: 18px;
    color: var(--text-sec); font-size: 11px;
}
.secure-footer i { width: 14px; color: #22c55e; }

/* ─── Trust Badges ─── */
.trust-badges {
    display: flex; gap: 12px; margin-top: 16px;
    justify-content: center;
}
.trust-badge {
    display: flex; align-items: center; gap: 6px;
    font-size: 10px; font-weight: 700;
    color: var(--text-sec);
    padding: 6px 10px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
}
.trust-badge i { width: 12px; color: #22c55e; }

/* ─── Loader ─── */
.loader-box { padding: 60px; display: flex; justify-content: center; }
.loader {
    width: 38px; height: 38px;
    border: 3px solid rgba(255,255,255,.08);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .checkout-grid { grid-template-columns: 1fr; }
    .checkout-sidebar { position: static; }
}
@media (max-width: 600px) {
    .checkout-form-box { grid-template-columns: 1fr; }
    .checkout-title { font-size: 24px; }
    .cart-item { padding: 16px; gap: 12px; }
    .cart-item img { width: 56px; height: 56px; }
}