/* ==========================================================================
   CART & SIDE CART STYLES
   Description: Specific styles for the Shopping Cart page and the Side Cart Drawer.
   ========================================================================== */

/* ===== SIDE CART DRAWER (Global) ===== */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    backdrop-filter: blur(5px);
}

body.side-cart-open .cart-overlay {
    display: block;
}

.side-cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background-color: var(--side-cart-bg, #f3f3f3) !important;
    z-index: 10001;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

body.side-cart-open .side-cart-drawer {
    right: 0 !important;
}

body.side-cart-open {
    overflow: hidden;
}

.side-cart-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-cart-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--side-cart-title) !important;
    margin: 0;
}

.close-side-cart {
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--side-cart-title);
    line-height: 1;
}

.side-cart-content-inner {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding-bottom: 20px;
    display: flex !important;
    flex-direction: column;
}

/* Custom Scrollbar for Side Cart */
.side-cart-content-inner::-webkit-scrollbar {
    width: 6px;
}

.side-cart-content-inner::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.side-cart-content-inner::-webkit-scrollbar-thumb {
    background: #ff9900;
    border-radius: 10px;
}

.side-cart-content-inner::-webkit-scrollbar-thumb:hover {
    background: #e68a00;
}

/* Free Shipping Bar Refinement */
.side-cart-content-inner .free-shipping-bar-container {
    order: -1;
    background: rgba(255, 255, 255, 0.6);
    margin: 15px;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.shipping-message {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
    color: var(--side-cart-free-shipping) !important;
}

.highlight-orange {
    background: transparent !important;
    color: #ff9900 !important;
    font-weight: 700;
}

.shipping-progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.shipping-progress-fill {
    height: 100%;
    background: linear-gradient(to right, #f08e33, #ff9900);
    border-radius: 4px;
}

/* Side Cart Items Layout */
.side-cart-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-cart-item {
    display: flex;
    align-items: center;
    background: transparent;
    padding: 10px 20px;
    gap: 15px;
    position: relative;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.side-cart-item-thumb {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    background: #fff;
    border-radius: 12px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.side-cart-item-thumb img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

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

.side-cart-item-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.side-cart-item-title a {
    color: var(--side-cart-title) !important;
    text-decoration: none;
}

.side-cart-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-cart-item-price {
    color: var(--side-cart-price) !important;
    font-weight: 700;
    font-size: 16px;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    background: #FFD814;
    border-radius: 4px;
    padding: 2px;
}

.qty-btn {
    background: transparent !important;
    border: none !important;
    width: 24px;
    height: 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111 !important;
}

.qty-val {
    background: #fff;
    min-width: 24px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    margin: 0 2px;
    padding: 2px 6px;
    color: #111 !important;
}

/* Remove Item Handle */
.remove-side-cart-item {
    font-size: 20px;
    color: #999 !important;
    position: absolute;
    top: 5px;
    right: 20px;
    text-decoration: none;
}

/* Side Cart Summary Block */
.side-cart-summary {
    background: transparent;
    padding: 20px;
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.side-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.side-cart-total span:first-child {
    font-size: 18px;
    font-weight: 700;
    color: var(--side-cart-price);
}

.total-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--side-cart-price);
}

/* Action Buttons */
.side-cart-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.side-cart-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    height: 50px;
    border-radius: 25px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.btn-view-cart {
    background: linear-gradient(to bottom, #FFB74D, #FF9800) !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.3);
}

.btn-checkout {
    background: linear-gradient(to bottom, #FF9800, #F4511E) !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(244, 81, 30, 0.3);
}

.side-cart-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

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

.side-cart-empty i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

/* Trust Seal & Payments */
.side-cart-trust-seal {
    margin-top: 30px;
    text-align: center;
}

.trust-seal-text {
    font-size: 11px;
    color: #666;
    font-style: italic;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.payment-methods-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 24px;
    color: #999;
}

/* ========================================
   MAIN CART PAGE - UNIFIED LAYOUT
   ======================================== */
.amazon-cart-wrapper-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
    margin-top: 30px;
}

.cart-main-column {
    min-width: 0;
}

.amazon-cart-items-card {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.cart-card-title {
    font-size: 28px;
    font-weight: 500;
    margin: 0;
}

.cart-card-price-label {
    font-size: 14px;
    color: #565959;
}

.cart-item-row {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid #e7e7e7;
    gap: 20px;
}

.item-image-col {
    flex: 0 0 180px;
}

.item-image-col img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

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

.item-details-col .item-name {
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 5px 0;
}

.item-details-col .item-name a {
    color: #007185;
    text-decoration: none;
}

.item-details-col .item-name a:hover {
    color: #c45500;
    text-decoration: underline;
}

.item-stock-status {
    margin-bottom: 10px;
}

.item-stock-status .in-stock {
    color: #007600;
    font-size: 12px;
}

.item-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.delete-link {
    color: #007185;
    font-size: 12px;
    text-decoration: none;
}

.delete-link:hover {
    text-decoration: underline;
}

.item-price-col {
    flex: 0 0 100px;
    text-align: right;
    font-size: 18px;
    font-weight: 700;
    color: var(--side-cart-price) !important;
}

/* Totals Sidebar */
.amazon-totals-box {
    background: var(--side-cart-bg) !important;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.totals-subtotal {
    font-size: 18px;
    margin-bottom: 20px;
}

.subtotal-amount {
    font-weight: 700;
}

.totals-order-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    color: var(--side-cart-price) !important;
    border-top: 1px solid #ddd;
    padding-top: 15px;
    margin-top: 15px;
    margin-bottom: 20px;
}

/* Proceed to Checkout Button on Cart Page */
.cart-sidebar-column .checkout-button {
    width: 100% !important;
    margin-top: 30px !important;
    font-size: 1.2rem !important;
    padding: 20px !important;
    background: #ff9900 !important;
    color: #000000 !important;
    font-weight: 800 !important;
    border-radius: 50px !important;
    text-align: center;
    display: block;
    transition: all 0.3s ease !important;
    box-shadow: 0 5px 20px rgba(255, 153, 0, 0.4);
}

.cart-sidebar-column .checkout-button:hover {
    background: #ffaa33 !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 153, 0, 0.5);
}

/* Responsive Cart Cards */
@media (max-width: 768px) {
    .amazon-cart-wrapper-grid {
        display: flex;
        flex-direction: column;
    }

    .cart-sidebar-column {
        order: -1;
        margin-bottom: 10px;
    }

    .cart-item-row {
        flex-direction: column;
        background: #fff;
        padding: 15px;
        margin-bottom: 10px;
        border: 1px solid #ddd;
        border-radius: 8px;
    }

    .item-image-col {
        flex: 0 0 auto;
        text-align: center;
    }

    .item-image-col img {
        max-height: 150px;
    }

    .item-price-col {
        text-align: left;
    }
}

/* Night Mode Support for Cart/SideCart */
body.dark-mode .side-cart-drawer,
body.dark-mode .amazon-cart-items-card,
body.dark-mode .amazon-totals-box {
    background-color: #232f3e !important;
    color: #ffffff;
}

body.dark-mode .side-cart-header,
body.dark-mode .side-cart-summary,
body.dark-mode .cart-card-header,
body.dark-mode .cart-item-row {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .side-cart-header h3,
body.dark-mode .side-cart-item-title a,
body.dark-mode .cart-card-title,
body.dark-mode .item-details-col .item-name a {
    color: #ffffff !important;
}

/* ==========================================================================
   CHECKOUT PROGRESS BAR
   ========================================================================== */
.checkout-progress-bar {
    max-width: 800px;
    margin: 20px auto 30px;
    padding: 0 20px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    width: 100%;
}

.progress-steps::before {
    content: "";
    position: absolute;
    top: 15px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 32px;
    height: 32px;
    background: #232f3e;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.step-label {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

/* Active & Completed States */
.step.active .step-circle {
    background: #ff9900 !important;
    border-color: #ff9900 !important;
    color: #000 !important;
    box-shadow: 0 0 0 4px rgba(255, 153, 0, 0.2) !important;
}

.step.active .step-label {
    color: #ff9900 !important;
    font-weight: 700 !important;
}

.step.completed .step-circle {
    background: #007600 !important;
    border-color: #007600 !important;
    color: #fff !important;
}

.step.completed .step-label {
    color: #007600 !important;
}

/* Response for mobile */
@media (max-width: 480px) {
    .checkout-progress-bar {
        margin: 10px auto;
    }
    .step-label {
        font-size: 11px;
    }
}
