@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary-navy: #0B2238;
    --primary-navy-hover: #173859;
    --brand-orange: #E05A2B;
    --brand-orange-hover: #C84B1F;
    --text-dark: #0F172A;
    --text-muted: #64748B;
    --border-light: #E2E8F0;
    --bg-light: #F8FAFC;
    --white: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: #F1F5F9;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------------- Top Bar & Header ---------------- */
.top-bar {
    background-color: var(--primary-navy);
    color: var(--white);
    font-size: 0.82rem;
    padding: 8px 0;
}

.top-bar-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left, .top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-item {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-bar-item:hover {
    color: var(--brand-orange);
}

.main-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.header-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: var(--primary-navy);
}

.logo span {
    color: var(--brand-orange);
}

.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #F1F5F9;
    color: var(--primary-navy);
    border: 1.5px solid #CBD5E1;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-back-home:hover {
    background: var(--primary-navy);
    color: var(--white);
    border-color: var(--primary-navy);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(11, 34, 56, 0.2);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-dark);
    position: relative;
    cursor: pointer;
    transition: color 0.2s;
}

.action-item:hover {
    color: var(--brand-orange);
}

.icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary-navy);
}

.badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background-color: var(--brand-orange);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 12px;
    border-left: 1px solid #E2E8F0;
    text-decoration: none;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 1.1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-dark);
}

.user-status {
    font-size: 0.75rem;
    color: #64748B;
}

/* ---------------- Stepper Bar ---------------- */
.cart-stepper-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    padding: 18px 20px;
    margin-bottom: 30px;
}

.stepper-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #94A3B8;
}

.step-item.active {
    color: var(--primary-navy);
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #E2E8F0;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
}

.step-item.active .step-number {
    background: var(--brand-orange);
    color: var(--white);
}

.step-divider {
    flex: 1;
    height: 2px;
    background: #E2E8F0;
    margin: 0 16px;
}

/* ---------------- Main Layout 2 Columns ---------------- */
.cart-main-container {
    max-width: 1240px;
    margin: 0 auto 50px auto;
    padding: 0 20px;
    flex: 1;
    width: 100%;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

/* Left Column - Cart List */
.cart-left-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Free Shipping Progress Bar Card */
.freeship-card {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border: 1px solid #BFDBFE;
    border-radius: 14px;
    padding: 16px 20px;
}

.freeship-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1E40AF;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: #BFDBFE;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--brand-orange);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Cart Items Container Box */
.cart-box {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.cart-box-header {
    padding: 16px 20px;
    background: #F8FAFC;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-navy);
}

.cart-item-row {
    padding: 20px;
    border-bottom: 1px solid #F1F5F9;
    display: grid;
    grid-template-columns: 90px 1fr 120px 110px 40px;
    gap: 16px;
    align-items: center;
}

.cart-item-row:last-child {
    border-bottom: none;
}

.cart-item-img {
    width: 80px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-light);
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-cat-badge {
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(224, 90, 43, 0.1);
    color: var(--brand-orange);
}

.item-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-navy);
    line-height: 1.3;
}

.item-author {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.item-price {
    font-weight: 800;
    color: var(--brand-orange);
    font-size: 0.95rem;
}

/* Quantity Stepper Input */
.quantity-stepper {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    background: #F8FAFC;
}

.btn-qty {
    background: none;
    border: none;
    width: 30px;
    height: 32px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-navy);
    cursor: pointer;
    transition: background 0.15s;
}

.btn-qty:hover {
    background: #E2E8F0;
}

.qty-input {
    width: 38px;
    height: 32px;
    border: none;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-navy);
    outline: none;
    background: transparent;
}

.item-subtotal {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-navy);
}

.btn-delete-item {
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.btn-delete-item:hover {
    color: #EF4444;
    background: #FEE2E2;
}

/* Coupon Box */
.coupon-box {
    background: var(--white);
    border-radius: 14px;
    padding: 16px 20px;
    border: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
    align-items: center;
}

.coupon-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    text-transform: uppercase;
    font-weight: 700;
}

.coupon-input:focus {
    border-color: var(--primary-navy);
}

.btn-apply-coupon {
    background: var(--primary-navy);
    color: var(--white);
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-apply-coupon:hover {
    background: var(--primary-navy-hover);
}

/* Right Column - Summary Card */
.cart-summary-card {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    padding: 24px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 100px;
}

.summary-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-navy);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.summary-row.discount {
    color: #10B981;
    font-weight: 700;
}

.summary-row.total-row {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1.5px dashed var(--border-light);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-navy);
}

.total-price-big {
    font-size: 1.4rem;
    color: var(--brand-orange);
    font-weight: 800;
}

.btn-checkout {
    width: 100%;
    background: var(--brand-orange);
    color: var(--white);
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 4px 14px rgba(224, 90, 43, 0.3);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-checkout:hover {
    background: var(--brand-orange-hover);
    transform: translateY(-2px);
}

.payment-trust-badge {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.trust-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.trust-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary-navy);
}

/* Empty Cart State */
.empty-cart-box {
    background: var(--white);
    border-radius: 20px;
    padding: 60px 20px;
    text-align: center;
    border: 1px solid var(--border-light);
    display: none;
}

.empty-cart-box.active {
    display: block;
}

.empty-cart-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(224, 90, 43, 0.1);
    color: var(--brand-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
}

.btn-continue-shop {
    background: var(--primary-navy);
    color: var(--white);
    padding: 12px 28px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    margin-top: 16px;
}

.btn-continue-shop:hover {
    background: var(--primary-navy-hover);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.toast {
    background-color: var(--primary-navy);
    color: var(--white);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    animation: slideIn 0.3s ease, fadeOut 0.5s 2.5s forwards;
}

@keyframes slideIn {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(20px); }
}

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

@media (max-width: 640px) {
    .cart-item-row {
        grid-template-columns: 70px 1fr;
        gap: 12px;
    }
}

/* ---------------- User Profile Dropdown ---------------- */
.user-profile-container {
    position: relative;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 12px;
    z-index: 1000;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 10px;
}

.dropdown-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #E2E8F0;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dropdown-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dropdown-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-role {
    font-size: 0.75rem;
    color: #f97316;
    font-weight: 600;
}

.dropdown-divider {
    height: 1px;
    background: #E2E8F0;
    margin: 8px 0;
}

.dropdown-item {
    width: 100%;
    background: none;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    text-decoration: none;
    color: #0f172a;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
}

.logout-btn {
    color: #EF4444;
}

.logout-btn:hover {
    background-color: #FEF2F2;
    color: #DC2626;
}
