/* cart.css — Cart page styles */
section.cart-page,
#main-content>.cart-page {
    padding: 40px 0 80px;
    min-height: 60vh;
}

.cart-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 16px;
    flex-wrap: wrap;
}

.cart-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e1e2e;
    margin: 0;
}

.cart-title i {
    color: #7c3aed;
    margin-right: 10px;
}

.cart-continue-link {
    color: #7c3aed;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.cart-continue-link:hover {
    text-decoration: underline;
}

/* Loading */
.cart-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 0;
    gap: 16px;
    color: #64748b;
}

.cart-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    gap: 16px;
    text-align: center;
}

.cart-empty-icon {
    font-size: 64px;
    color: #e2e8f0;
}

.cart-empty h2 {
    font-size: 1.5rem;
    color: #1e1e2e;
}

.cart-empty p {
    color: #64748b;
}

/* Layout */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 32px;
    align-items: start;
}

/* Line items */
.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    align-items: start;
    transition: box-shadow 0.2s, opacity 0.25s, transform 0.25s;
}

.cart-item:hover {
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.08);
}

.cart-item-img img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.cart-item-name {
    font-weight: 600;
    color: #1e1e2e;
    text-decoration: none;
    font-size: 15px;
}

.cart-item-name:hover {
    color: #7c3aed;
}

.cart-item-opts {
    font-size: 13px;
    color: #64748b;
    margin: 4px 0 0;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* Qty */
.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.qty-btn {
    background: #f8fafc;
    border: none;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 18px;
    color: #1e1e2e;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #f1f5f9;
}

.qty-val {
    padding: 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: #1e1e2e;
    min-width: 32px;
    text-align: center;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.15s;
}

.cart-item-remove:hover {
    opacity: 0.7;
}

/* Willow: Wave 102 — Gang sheet preview button */
.cart-item-preview-btn {
    background: none;
    border: 1px solid #7c3aed;
    color: #7c3aed;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s, color 0.15s;
}

.cart-item-preview-btn:hover {
    background: #7c3aed;
    color: #fff;
}

.cart-item-price {
    text-align: right;
    white-space: nowrap;
}

.cart-item-unit-price {
    display: block;
    font-size: 13px;
    color: #64748b;
}

.cart-item-line-total {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #1e1e2e;
    margin-top: 4px;
}

/* Summary sidebar */
.cart-summary-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px;
    position: sticky;
    top: 90px;
}

.cart-summary-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e1e2e;
    margin: 0 0 20px;
}

.cart-summary-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #475569;
}

.cart-summary-shipping {
    color: #94a3b8;
}

.discount-label {
    color: #10b981;
}

.discount-value {
    color: #10b981;
    font-weight: 600;
}

.cart-summary-divider {
    border-top: 1px solid #e2e8f0;
    margin: 4px 0;
}

.cart-summary-total {
    font-size: 18px;
    font-weight: 700;
    color: #1e1e2e;
}

/* Promo code */
.cart-promo-wrap {
    margin-top: 20px;
}

.cart-promo-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.cart-promo-row {
    display: flex;
    gap: 8px;
}

.cart-promo-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

.cart-promo-input:focus {
    border-color: #7c3aed;
}

.cart-promo-btn {
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.cart-promo-btn:hover {
    background: #6d28d9;
}

.cart-promo-message {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
}

.cart-promo-message.success {
    background: #d1fae5;
    color: #065f46;
}

.cart-promo-message.error {
    background: #fee2e2;
    color: #991b1b;
}

/* Checkout CTA */
.cart-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    border-radius: 12px;
    padding: 15px 24px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    margin-top: 24px;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}

.cart-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45);
    color: #fff;
}

.cart-secure-note {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cart-signin-btn {
    background: linear-gradient(135deg, #1e293b, #334155) !important;
    box-shadow: 0 4px 16px rgba(30, 41, 59, 0.35) !important;
}

.cart-signin-btn:hover {
    box-shadow: 0 8px 24px rgba(30, 41, 59, 0.45) !important;
}

.cart-auth-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    margin-top: 16px;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.5;
}

.cart-auth-note i {
    flex-shrink: 0;
    margin-top: 2px;
}

.cart-auth-note a {
    color: #1e40af;
    font-weight: 600;
    text-decoration: underline;
}

.cart-auth-note a:hover {
    color: #1e3a8a;
}

/* Responsive */
@media (max-width: 768px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
    }

    .cart-item-price {
        grid-column: 1/-1;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .cart-summary-box {
        position: static;
    }
}

/* ── Dashboard page ──────────────────────────────────────── */
.dashboard-page {
    padding: 40px 0 80px;
    min-height: 70vh;
}

.dashboard-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.dashboard-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
}

.dashboard-welcome h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e1e2e;
    margin: 0 0 4px;
}

.dashboard-welcome p {
    color: #64748b;
    margin: 0;
}

.dashboard-quick-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.dash-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.dash-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
    color: #fff;
}

.dash-action-btn.secondary {
    background: #f1f5f9;
    color: #475569;
}

.dash-action-btn.secondary:hover {
    background: #e2e8f0;
    box-shadow: none;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.dash-stat {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.dash-stat i {
    font-size: 28px;
    color: #7c3aed;
}

.dash-stat-val {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e1e2e;
}

.dash-stat-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}

.dash-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
}

.dash-card:last-child {
    margin-bottom: 0;
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.dash-card-header h2,
.dash-card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e1e2e;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-card-header h2 i,
.dash-card-header h3 i {
    color: #7c3aed;
}

.dash-card-link {
    font-size: 13px;
    color: #7c3aed;
    text-decoration: none;
    white-space: nowrap;
}

.dash-card-link:hover {
    text-decoration: underline;
}

.dash-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-name {
    font-weight: 600;
    color: #1e1e2e;
    margin-bottom: 3px;
}

.profile-email,
.profile-phone {
    font-size: 13px;
    color: #64748b;
}

.dash-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dash-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}

.dash-link:hover {
    background: #f8fafc;
    color: #7c3aed;
}

.dash-link i {
    width: 16px;
    text-align: center;
    color: #7c3aed;
}

/* Order rows */
.order-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
}

.order-row:last-child {
    border-bottom: none;
}

.order-row-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-row-id {
    font-weight: 600;
    color: #1e1e2e;
    font-size: 14px;
}

.order-row-date {
    font-size: 12px;
    color: #94a3b8;
}

.order-row-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-row-total {
    font-weight: 700;
    color: #1e1e2e;
    font-size: 14px;
}

.order-status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.orders-loading,
.orders-empty {
    color: #94a3b8;
    padding: 24px;
    text-align: center;
}

.auth-guard {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    gap: 20px;
    text-align: center;
}

.auth-guard-icon {
    font-size: 64px;
    color: #e2e8f0;
}

.auth-guard h2 {
    font-size: 1.4rem;
    color: #1e1e2e;
    margin: 0;
}

/* ── Orders page ─────────────────────────────────────────── */
.orders-page {
    padding: 40px 0 80px;
    min-height: 70vh;
}

.orders-page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.orders-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.orders-page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e1e2e;
    margin: 0;
}

.orders-back-link {
    font-size: 14px;
    color: #7c3aed;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.orders-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    background: #f8fafc;
    font-weight: 600;
}

.orders-table td {
    padding: 14px 16px;
    border-top: 1px solid #f1f5f9;
    font-size: 14px;
    color: #1e1e2e;
}

.orders-empty-row {
    text-align: center;
    color: #94a3b8;
    padding: 40px !
}

.order-view-btn {
    background: none;
    border: 1px solid #7c3aed;
    color: #7c3aed;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.order-view-btn:hover {
    background: #7c3aed;
    color: #fff;
}

.orders-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pg-btn {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}

.pg-btn.active,
.pg-btn:hover {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}

.order-detail-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 28px;
}

.order-detail-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.order-detail-back {
    background: none;
    border: none;
    color: #7c3aed;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
}

.order-detail-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

.order-meta-item label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 4px;
}

.order-meta-item span {
    font-weight: 600;
    color: #1e1e2e;
}

.order-detail-items {
    width: 100%;
    border-collapse: collapse;
}

.order-detail-items th {
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    color: #94a3b8;
    border-bottom: 1px solid #e2e8f0;
}

.order-detail-items td {
    padding: 12px 12px;
    border-top: 1px solid #f1f5f9;
    font-size: 14px;
}

.order-detail-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

/* Responsive dashboard/orders */
@media (max-width:768px) {
    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .orders-table {
        display: block;
        overflow-x: auto;
    }

    .order-detail-meta {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width:480px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .order-detail-meta {
        grid-template-columns: 1fr;
    }
}

/* ── Shared ── */
.btn-primary-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}

.btn-primary-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45);
    color: #fff;
}

.btn-primary-cta.small {
    padding: 9px 18px;
    font-size: 13px;
}