/* ===========================================
   Cart & Checkout Page — EzyCommerce
   Page-specific styles only; base from index.css
   =========================================== */

/* Breadcrumb */
.breadcrumb {
    padding: 16px 0;
    background: #fff;
    border-bottom: 1px solid #E8ECF1;
}

.breadcrumb .container,
.breadcrumb-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px;
}

.breadcrumb ul {
    display: flex;
    list-style: none;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.breadcrumb li {
    color: #636E72;
    font-size: 14px;
    font-weight: 500;
}

.breadcrumb li:not(:last-child)::after {
    content: '\203A';
    margin-left: 8px;
    color: #B2BEC3;
}

.breadcrumb li:last-child { color: #2D3436; font-weight: 600; }
.breadcrumb a { color: #636E72; text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: #6C5CE7; }

/* Main Layout */
.main-content {
    max-width: 1300px;
    margin: 32px auto;
    padding: 0 24px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

/* Cart Container */
.cart-container {
    flex: 1;
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #E8ECF1;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E8ECF1;
}

.cart-title {
    font-size: 22px;
    font-weight: 700;
    color: #2D3436;
    letter-spacing: -0.3px;
}

#cart-item-count {
    font-size: 14px;
    color: #636E72;
    font-weight: 500;
    background: #F7F8FC;
    padding: 6px 14px;
    border-radius: 20px;
}

/* Cart Items */
.cart-items { margin-bottom: 8px; }

.empty-cart {
    text-align: center;
    padding: 60px 20px;
}

.empty-cart i {
    font-size: 56px;
    color: #DFE6E9;
    margin-bottom: 16px;
    display: block;
}

.empty-cart h3 {
    font-size: 20px;
    font-weight: 700;
    color: #2D3436;
    margin-bottom: 8px;
}

.empty-cart p {
    color: #636E72;
    margin-bottom: 24px;
    font-size: 15px;
}

.cart-item {
    display: flex;
    padding: 20px 0;
    border-bottom: 1px solid #F0F3F6;
    gap: 20px;
    align-items: flex-start;
}

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

.cart-item-image {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
    background: #F7F8FC;
}

.cart-item-details { flex: 1; }

.cart-item-name {
    font-size: 16px;
    font-weight: 700;
    color: #2D3436;
    margin-bottom: 4px;
}

.cart-item-category {
    color: #636E72;
    font-size: 13px;
    margin-bottom: 8px;
}

.cart-item-price {
    font-size: 18px;
    font-weight: 800;
    color: #6C5CE7;
    margin-bottom: 12px;
}

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

.quantity-control {
    display: flex;
    align-items: center;
    border: 1.5px solid #E8ECF1;
    border-radius: 10px;
    overflow: hidden;
    background: #F7F8FC;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #2D3436;
    font-weight: 600;
    transition: all 0.2s;
}

.quantity-btn:hover { background: #E8ECF1; color: #6C5CE7; }

.quantity-input {
    width: 44px;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    background: transparent;
    color: #2D3436;
    font-family: 'Inter', sans-serif;
}

.remove-btn {
    background: none;
    border: none;
    color: #FF6B6B;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

.remove-btn:hover { background: #FFF0F0; }

/* Order Summary */
.order-summary {
    width: 360px;
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #E8ECF1;
    align-self: flex-start;
    position: sticky;
    top: 100px;
}

.summary-title {
    font-size: 18px;
    font-weight: 700;
    color: #2D3436;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #E8ECF1;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: #636E72;
}

.summary-row span:last-child { font-weight: 600; color: #2D3436; }

#discount { color: #00B894; }

.summary-total {
    font-weight: 700;
    font-size: 17px;
    color: #2D3436;
    border-top: 2px solid #E8ECF1;
    padding-top: 16px;
    margin-top: 16px;
}

.summary-total span:last-child { color: #6C5CE7; font-size: 20px; }

.discount-form { margin: 20px 0; }

.discount-input {
    display: flex;
    gap: 8px;
}

.discount-input input {
    flex: 1;
    padding: 11px 14px;
    border: 1.5px solid #E8ECF1;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    background: #F7F8FC;
    transition: all 0.2s;
}

.discount-input input:focus {
    border-color: #6C5CE7;
    background: #fff;
}

.apply-btn {
    padding: 11px 18px;
    background: #F7F8FC;
    color: #6C5CE7;
    border: 1.5px solid #6C5CE7;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.apply-btn:hover { background: #6C5CE7; color: #fff; }

.checkout-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #6C5CE7, #5A4BD1);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    font-family: 'Inter', sans-serif;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 4px 15px rgba(108,92,231,0.3);
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108,92,231,0.4);
}

.continue-shopping {
    display: block;
    text-align: center;
    margin-top: 14px;
    color: #6C5CE7;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s;
}

.continue-shopping:hover { color: #5A4BD1; }

/* Recently Viewed */
.recently-viewed {
    max-width: 1300px;
    margin: 48px auto 0;
    padding: 0 24px 48px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: #2D3436;
    margin-bottom: 24px;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.product-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #E8ECF1;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
    border-color: transparent;
}

.product-image {
    height: 200px;
    width: 100%;
    object-fit: cover;
}

.product-info { padding: 18px; }

.product-title {
    font-size: 15px;
    font-weight: 700;
    color: #2D3436;
    margin-bottom: 8px;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.current-price { font-size: 18px; font-weight: 800; color: #2D3436; }
.original-price { text-decoration: line-through; color: #B2BEC3; font-size: 14px; }

.product-actions { display: flex; gap: 8px; }

.btn-cart {
    flex: 1;
    padding: 10px;
    background: linear-gradient(135deg, #6C5CE7, #5A4BD1);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.btn-cart:hover { opacity: 0.9; transform: translateY(-1px); }

/* Checkout Modal */
.checkout-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26,26,46,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
    justify-content: center;
    align-items: flex-start;
}

.checkout-modal-content {
    background: #fff;
    padding: 28px;
    width: 100%;
    max-width: 720px;
    margin: 40px auto;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

.close-btn {
    cursor: pointer;
    border: none;
    background: transparent;
    font-size: 24px;
    color: #636E72;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover { background: #F7F8FC; color: #2D3436; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #E8ECF1;
    padding-bottom: 14px;
    margin-bottom: 24px;
}

.modal-title { font-size: 20px; font-weight: 700; color: #2D3436; }
.modal-section { margin-bottom: 24px; }
.section-heading { font-size: 15px; font-weight: 700; color: #2D3436; margin-bottom: 14px; }

.address-toolbar {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary { background: linear-gradient(135deg, #6C5CE7, #5A4BD1); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(108,92,231,0.3); }
.btn-secondary { background: #F7F8FC; color: #2D3436; border-color: #E8ECF1; }
.btn-secondary:hover { background: #E8ECF1; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #E8ECF1;
    padding-top: 16px;
}

.payment-options { display: grid; gap: 10px; }

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1.5px solid #E8ECF1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.radio-option:hover { border-color: #6C5CE7; background: #F8F7FF; }
.radio-option input[type="radio"] { accent-color: #6C5CE7; }

.form-error { color: #FF6B6B; font-size: 13px; margin-top: 8px; }

.address-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.address-card {
    border: 1.5px solid #E8ECF1;
    border-radius: 14px;
    padding: 16px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    background: #fff;
}

.address-card:hover { border-color: #A29BFE; box-shadow: 0 4px 16px rgba(108,92,231,0.08); }
.address-card.selected { border-color: #6C5CE7; background: #F8F7FF; box-shadow: 0 0 0 3px rgba(108,92,231,0.1); }

.address-type {
    font-size: 11px;
    color: #6C5CE7;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    margin-bottom: 6px;
}

.address-name { font-weight: 700; margin-bottom: 4px; color: #2D3436; }
.address-lines { color: #636E72; font-size: 14px; line-height: 1.5; }
.address-phone { color: #636E72; font-size: 13px; margin-top: 6px; }

.badge-default {
    position: absolute;
    top: 12px; right: 12px;
    background: linear-gradient(135deg, #F8F7FF, #EDE9FF);
    color: #6C5CE7;
    border-radius: 20px;
    font-size: 11px;
    padding: 4px 10px;
    font-weight: 700;
}

/* Footer overrides for cart page */
footer {
    background: #1A1A2E;
    color: #fff;
    padding: 64px 0 24px;
}

.footer-content {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 48px;
}

.footer-column h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-column ul { list-style: none; padding: 0; margin: 0; }
.footer-column ul li { margin-bottom: 10px; }
.footer-column ul li a { color: #B2BEC3; text-decoration: none; font-size: 14px; transition: all 0.2s; }
.footer-column ul li a:hover { color: #6C5CE7; padding-left: 4px; }
.footer-column p { color: #B2BEC3; font-size: 14px; line-height: 1.6; }

.social-icons { display: flex; gap: 10px; margin-top: 16px; }
.social-icons a {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s;
    font-size: 14px;
}
.social-icons a:hover { background: #6C5CE7; transform: translateY(-2px); }

.footer-bottom {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px 24px 0;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: #636E72;
    font-size: 14px;
}

/* Loading States */
.loading { opacity: 0.6; pointer-events: none; position: relative; }

/* Spinner */
.spinner {
    width: 36px; height: 36px;
    border: 3px solid #E8ECF1;
    border-left-color: #6C5CE7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 992px) {
    .main-content { flex-direction: column; }
    .order-summary { width: 100%; position: static; }
}

@media (max-width: 768px) {
    .main-content { padding: 0 16px; margin: 24px auto; gap: 24px; }
    .cart-container, .order-summary { padding: 20px; }
    .cart-item { flex-direction: column; }
    .cart-item-image { width: 100%; height: 180px; }
    .products { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
    .checkout-modal-content { margin: 20px auto; padding: 20px; border-radius: 16px; }
    .address-list { grid-template-columns: 1fr; }
}
