/* ========================================
   RESET & BASE STYLES
   ======================================== */
:root{
    --container-pad: 10px;      /* main horizontal padding for desktop */
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body, html {
    height: 100vh;  /* Fixed: was 10vh */
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #334155;
    line-height: 1.6;
    position: relative;
    overflow: visible;
}

/* ========================================
   LAYOUT CONTAINERS
   ======================================== */

.container {
    width: 100%;
    height: 100vh;
    margin: 0 auto;
    padding: 0 var(--container-pad);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */
       /* Header Styles - Full Width, No Margins */
        header {
            background: rgba(255, 255, 255, 0);
            margin: 0;
            padding: 10px;
            position: relative;
            width: 100%;
        }

        .header-content {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
        }

        .logo {
            display: flex;
            align-items: center;
        }

        .logo img {
            max-height: 60px;
            width: auto;
            display: block;
            transition: transform 0.3s ease;
        }

        .logo img:hover {
            transform: scale(1.05);
        }

        .breadcrumb-alt {
            color: #64748b;
            font-size: 14px;
            font-weight: 500;
            white-space: nowrap;
            margin-left: auto;

        }

        .breadcrumb-alt a {
            color: black;
            text-decoration: none;
            transition: color 0.3s ease;
        }

        .breadcrumb-alt a:hover {
            color: black;
            text-decoration: underline;
        }

/* ========================================
    Stock Alert/Checking
   ======================================== */
/* Match Stock Button Styling */
.match-stock-btn {
    background: #d3d92e;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: fit-content;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.2);
}

.match-stock-btn:hover {
    background: #74cc01;
    color: black;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}

.match-stock-btn:active {
    transform: translateY(0);
}

.match-stock-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.match-stock-btn i {
    font-size: 12px;
}

/* Adjust quantity controls layout */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 40px;
}

.quantity-controls .quantity-btn {
    flex-shrink: 0;
}

.quantity-controls .quantity-input {
    flex-shrink: 0;
}

/* When only showing match stock button, center it */
.cart-item.exceeds-stock .quantity-controls {
    justify-content: flex-start;
}

/* Modal Styling */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-alert-overlay.show {
    opacity: 1;
}

.custom-alert {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 420px;
    margin: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.custom-alert-overlay.show .custom-alert {
    transform: scale(1);
}

.custom-alert-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 20px;
}

.custom-alert-icon.error {
    background-color: #fee2e2;
    color: #dc2626;
}

.custom-alert-icon.warning {
    background-color: #fef3c7;
    color: #d97706;
}

.custom-alert-icon.success {
    background-color: #dcfce7;
    color: #16a34a;
}

.custom-alert-icon.info {
    background-color: #dbeafe;
    color: #2563eb;
}

.custom-alert h3 {
    text-align: center;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.custom-alert p {
    text-align: center;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 20px;
}

.custom-alert-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.alert-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.alert-btn-primary {
    background-color: #2563eb;
    color: white;
}

.alert-btn-primary:hover {
    background-color: #1d4ed8;
}

.alert-btn-cancel {
    background-color: #f3f4f6;
    color: #374151;
}

.alert-btn-cancel:hover {
    background-color: #e5e7eb;
}

.alert-btn-confirm {
    background-color: #dc2626;
    color: white;
}

.alert-btn-confirm:hover {
    background-color: #b91c1c;
}

/* Loading state for quantity controls */
.quantity-controls.updating {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.quantity-controls.updating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Enhanced disabled state for buttons */
.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background-color: #e9ecef;
    color: #6c757d;
    border-color: #dee2e6;
}

/* Smooth transitions for quantity updates */
.quantity-input {
    transition: all 0.2s ease-in-out;
}

.cart-item {
    transition: opacity 0.2s ease-in-out;
}

/* Visual feedback for updating items */
.cart-item.updating {
    opacity: 0.8;
}

/* Additional CSS for out-of-stock styling */
.cart-item.out-of-stock {
    opacity: 0.6;
    background-color: #f8f9fa;
    border-left: 4px solid #dc3545;
}

.cart-item.out-of-stock .item-image {
    position: relative;
}

.cart-item.out-of-stock .item-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
}

.out-of-stock-notice {
    font-size: 12px;
    color: #dc3545;
    text-align: center;
    margin-top: 5px;
    font-weight: bold;
}

.quantity-controls .quantity-input[value="0"] {
    background-color: #ffebee;
    border-color: #f44336;
    color: #d32f2f;
    font-weight: bold;
}

.stock-status.out-of-stock {
    background-color: #ffebee;
    color: #d32f2f;
    border: 1px solid #f44336;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.cart-item.out-of-stock .quantity-btn:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #dee2e6;
}

/* Improved stock status styling */
.stock-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 5px;
    display: inline-block;
}

.stock-status.in-stock {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.stock-status.low-stock {
    background-color: #f8f8f8;
    color: #f51000;
}

.stock-status.exceeds-stock {
    background-color: #ff0000;
    color: #fdfdfd;
    border: 1px solid #ff0000;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}
/* ========================================
   CART HEADER
   ======================================== */

.cart-header {
    margin-bottom: 20px;
    text-align: center;
    flex-shrink: 0;
    z-index: 5;  /* Added z-index */
    position: relative;
}

.cart-title {
    font-size: 25px;
    color: transparent;
    -webkit-text-stroke: 2px #333;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cart-title i {
    font-size: 25px;
    color: transparent;
    -webkit-text-stroke: 2px #333;
}

.cart-subtitle {
    color: #64748b;
    font-size: 16px;
    font-weight: 500;
}

/* ========================================
   CART MAIN CONTENT
   ======================================== */

.cart-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0;
    background: rgba(255, 255, 255, 1);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 3;  /* Reduced z-index */
    height: calc(100vh - 200px);
    min-height: auto;
}

/* ========================================
   CART ITEMS SECTION
   ======================================== */

.cart-items {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow-y: auto;
    box-shadow: none;
    border-right: 1px solid rgba(226, 232, 240, 0.5);
    height: 100%;
    max-height: calc(5 * 130px);
    padding-right: 4px;
    z-index: 4;  /* Added z-index */
    position: relative;
}

.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto auto;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid rgba(241, 245, 249, 0.8);
    align-items: center;
    transition: all 0.3s ease;
    background: transparent;
    position: relative;
    z-index: 5;  /* Added z-index */
    pointer-events: auto;  /* Fixed: ensure pointer events */
}

.cart-item:hover {
    background: rgba(248, 250, 252, 0.4);
    transform: translateX(4px);
}

.cart-item:last-child {
    border-bottom: none;
}

.item-image {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    pointer-events: auto;  /* Fixed: ensure pointer events */
}

.item-details h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1e293b;
}

.item-details p {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 500;
}

.item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 18px;
    font-weight: 700;
    color: #2275a5;
    pointer-events: auto;  /* Fixed: ensure pointer events */
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85em;
}

.discounted-price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.1em;
}

.discount-badge {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: bold;
    margin-left: 8px;
}

/* ========================================
   QUANTITY CONTROLS
   ======================================== */

.quantity-controls {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
    z-index: 10;  /* Fixed: increased z-index */
    pointer-events: auto;  /* Fixed: ensure pointer events */
}

.quantity-btn {
    background: none;
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s ease;
    min-width: 40px;
    position: relative;
    z-index: 11;  /* Fixed: increased z-index */
    pointer-events: auto;  /* Fixed: ensure pointer events */
}

.quantity-btn:hover {
    background: #3b82f6;
    color: white;
}

.quantity-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.quantity-input {
    border: none;
    text-align: center;
    width: 50px;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
    pointer-events: auto;  /* Fixed: ensure pointer events */
}

.remove-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 20px;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;  /* Fixed: increased z-index */
    pointer-events: auto;  /* Fixed: ensure pointer events */
}

.remove-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.remove-btn:focus {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

/* Mobile controls - hidden by default */
.mobile-controls {
    display: none;
}

/* ========================================
   CART SUMMARY SECTION
   ======================================== */

.cart-summary {
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    overflow-y: auto;
    position: relative;
    z-index: 4;  /* Added z-index */
}

.cart-summary::-webkit-scrollbar {
    width: 4px;
}

.cart-summary::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 2px;
}

.cart-summary::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.summary-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1e293b;
    text-align: center;
    flex-shrink: 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    color: #64748b;
    font-weight: 500;
    font-size: 14px;
    flex-shrink: 0;
}

.summary-row span:last-child {
    font-weight: 600;
    color: #334155;
}

.summary-row.total {
    border-top: 2px solid #e2e8f0;
    padding-top: 16px;
    margin-top: 16px;
    font-weight: 700;
    font-size: 18px;
    color: #1e293b;
}

.summary-row.total span:last-child {
    color: #1e40af;
}

.discount-row {
    color: #059669 !important;
    font-weight: 600;
}

.discount-row span:last-child {
    color: #059669 !important;
}

/* ========================================
   PROMO CODE SECTION
   ======================================== */

.promo-code {
    margin: 20px 0;
    padding: 16px 0;
    background: transparent;
    border-radius: 0;
    border: none;
    border-top: 1px solid rgba(226, 232, 240, 0.5);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    flex-shrink: 0;
    position: relative;
    z-index: 6;  /* Added z-index */
}

.promo-form {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
}

.promo-form .promo-input {
    flex: 1;
    margin-bottom: 0;
}

.promo-form .promo-btn {
    width: auto;
    min-width: 100px;
}

.promo-input {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(226, 232, 240, 0.6);
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 10px;
    transition: border-color 0.2s ease;
    background: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    position: relative;
    z-index: 7;  /* Added z-index */
    pointer-events: auto;  /* Fixed: ensure pointer events */
}

.promo-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.promo-btn {
    background: #38b5db;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ffffff;
    width: 100%;
    position: relative;
    z-index: 7;  /* Added z-index */
    pointer-events: auto;  /* Fixed: ensure pointer events */
}

.promo-btn:hover {
    background: #7fccf8ec;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.promo-btn:focus {
    outline: 2px solid #38b5db;
    outline-offset: 2px;
}

/* ========================================
   COUPON MESSAGES & APPLIED COUPONS
   ======================================== */

.coupon-message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 6;  /* Added z-index */
}

.coupon-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.coupon-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.applied-coupon {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    position: relative;
    z-index: 6;  /* Added z-index */
}

.coupon-info {
    display: flex;
    flex-direction: column;
}

.coupon-code {
    font-weight: 700;
    color: #059669;
    font-size: 14px;
}

.coupon-description {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.remove-coupon-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    z-index: 7;  /* Added z-index */
    pointer-events: auto;  /* Fixed: ensure pointer events */
}

.remove-coupon-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.remove-coupon-btn:focus {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

/* ========================================
   CHECKOUT BUTTON & ACTIONS
   ======================================== */

.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, #3fcefa, #6fc8fc);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    position: relative;
    z-index: 8;  /* Added z-index */
    pointer-events: auto;  /* Fixed: ensure pointer events */
}

.checkout-btn:hover {
    background: linear-gradient(135deg, #3fcefad3, #6fc8fcce);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.checkout-btn:focus {
    outline: 2px solid #3fcefa;
    outline-offset: 2px;
}

.checkout-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.continue-shopping {
    text-align: center;
    margin-top: 20px;
    flex-shrink: 0;
    position: relative;
    z-index: 7;  /* Added z-index */
}

.continue-shopping a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-block;
    pointer-events: auto;  /* Fixed: ensure pointer events */
}

.continue-shopping a:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
}

.continue-shopping a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.security-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
}

.security-badge {
    width: 16px;
    height: 16px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

/* ========================================
   EMPTY CART STYLES
   ======================================== */

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    margin: 20px 0;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 100;  /* Added z-index */
    pointer-events: auto;
}

.empty-cart-animation {
    margin-bottom: 30px;
    position: relative;
}

.empty-cart-icon {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.empty-cart-icon i {
    font-size: 4rem;
    color: #6c757d;
    animation: cartFloat 3s ease-in-out infinite;
}

.cart-bounce {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 8px;
    background: rgba(108, 117, 125, 0.2);
    border-radius: 50%;
    animation: bounceGrow 3s ease-in-out infinite;
}

@keyframes cartFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes bounceGrow {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.3; }
    50% { transform: translateX(-50%) scale(0.8); opacity: 0.1; }
}

.empty-cart-content {
    max-width: 500px;
    position: relative;
    z-index: 101;
    pointer-events: auto;
}

.empty-cart-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.empty-cart-description {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 40px;
    line-height: 1.6;
}

.empty-cart-suggestions {
    margin-bottom: 40px;
    position: relative;
    z-index: 101;
    pointer-events: auto;
}

.empty-cart-suggestions h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: 500;
}

.category-tags {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    position: relative;
     z-index: 101;  /* Added z-index */
    pointer-events: auto;  /* Fixed: ensure pointer events */
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    color: #495057;
    text-decoration: none;
    border-radius: 25px;
    border: 2px solid #e9ecef;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    z-index: 102;  /* Added z-index */
    pointer-events: auto;  /* Fixed: ensure pointer events */
}

.category-tag:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.category-tag:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.empty-cart-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.start-shopping-btn, .browse-deals-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    min-width: 160px;
    justify-content: center;
    position: relative;
    z-index: 5;  /* Added z-index */
    pointer-events: auto;  /* Fixed: ensure pointer events */
}

.start-shopping-btn.primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.start-shopping-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #0056b3, #004085);
}

.start-shopping-btn.primary:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.browse-deals-btn.secondary {
    background: white;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.browse-deals-btn.secondary:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-1px);
}

.browse-deals-btn.secondary:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.empty-cart-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 0.85rem;
}

.feature-item i {
    color: #28a745;
    font-size: 1rem;
}

/* ========================================
   CUSTOM ALERT MODAL
   ======================================== */

.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;  /* Very high z-index for modal */
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;  /* Initially no pointer events */
}

.custom-alert-overlay.show {
    opacity: 1;
    pointer-events: auto;  /* Enable pointer events when shown */
}

.custom-alert {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 450px;
    width: 90%;
    text-align: center;
    transform: scale(0.7) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 10001;  /* Higher than overlay */
    pointer-events: auto;  /* Always clickable */
}

.custom-alert-overlay.show .custom-alert {
    transform: scale(1) translateY(0);
}

.custom-alert-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: pulse 2s infinite;
}

.custom-alert-icon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    opacity: 0.3;
    animation: ping 2s infinite;
}

.custom-alert-icon i {
    color: white;
    font-size: 32px;
    z-index: 1;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes ping {
    0% { transform: scale(1); opacity: 0.3; }
    75%, 100% { transform: scale(1.2); opacity: 0; }
}

.custom-alert h3 {
    color: #2d3748;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
}

.custom-alert p {
    color: #64748b;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.custom-alert-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.alert-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    position: relative;
    z-index: 10002;  /* Higher than modal */
    pointer-events: auto;  /* Fixed: ensure pointer events */
}

.alert-btn-cancel {
    background: #f1f5f9;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.alert-btn-cancel:hover {
    background: #e2e8f0;
    color: #475569;
    transform: translateY(-1px);
}

.alert-btn-cancel:focus {
    outline: 2px solid #64748b;
    outline-offset: 2px;
}

.alert-btn-confirm {
    background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}

.alert-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

.alert-btn-confirm:focus {
    outline: 2px solid #ff4757;
    outline-offset: 2px;
}

.alert-btn-confirm:active {
    transform: translateY(0);
}

/* ========================================
   RESPONSIVE DESIGN - TABLET
   ======================================== */

@media (max-width: 1024px) {
    body, html {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .cart-content {
        grid-template-columns: 1fr;
        gap: 0;
        height: calc(100vh - 170px);
        width: 98%;
        margin: 0 auto;
    }

    .cart-items {
        border-right: none;
        border-bottom: 1px solid rgba(226, 232, 240, 0.5);
        max-height: 60vh;
        height: auto;
    }

    .cart-summary {
        height: 47vh;
    }

    .cart-item {
        grid-template-columns: 60px 1fr auto;
        gap: 12px;
        padding: 16px;
    }

    .item-image {
        width: 60px;
        height: 60px;
        font-size: 20px;
    }

    .item-details h3 {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .item-details p {
        font-size: 12px;
    }

    .item-price {
        font-size: 16px;
    }

    .quantity-controls {
        border-radius: 6px;
        min-width: 80px;
    }

    .quantity-btn {
        padding: 6px 10px;
        min-width: auto;
        font-size: 14px;
    }

    .quantity-input {
        width: 40%;
        padding: 6px 0;
        font-size: 14px;
    }

    .remove-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .logo {
        margin-left: calc(-1 * var(--container-pad));
    }

    .breadcrumb {
        padding-right: 10px;
    }

    header {
        margin-left: calc(-1 * var(--container-pad));
        margin-right: calc(-1 * var(--container-pad));
        width: calc(100% + calc(var(--container-pad) * 2));
    }

    /* Empty cart responsive for tablet */
    .empty-cart {
        padding: 40px 15px;
        margin: 15px 0;
    }

    .empty-cart-title {
        font-size: 1.5rem;
    }

    .empty-cart-description {
        font-size: 1rem;
    }

    .empty-cart-actions {
        flex-direction: column;
        align-items: center;
    }

    .start-shopping-btn, .browse-deals-btn {
        width: 100%;
        max-width: 250px;
    }

    .category-tags {
        justify-content: center;
    }

    .empty-cart-features {
        flex-direction: column;
        gap: 15px;
    }
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE
   ======================================== */

@media (max-width: 768px) {
    body, html {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .container {
        height: auto;
        min-height: 100vh;
        overflow: visible;
        padding-bottom: 20px;
    }

    .header-content {
        margin: 0;
        padding: 0 var(--container-pad);
    }

    .logo img {
        max-height: 70px;
        margin: auto;
    }

    .cart-header {
        margin-bottom: 16px;
        padding: 0 4px;
    }

    .cart-title {
        font-size: 22px;
        gap: 8px;
    }

    .cart-title i {
        font-size: 22px;
    }

    .cart-subtitle {
        font-size: 14px;
        margin-top: 4px;
    }

    .cart-content {
        border-radius: 16px;
        width: 98%;
        height: auto;
        min-height: 60vh;
        grid-template-columns: 1fr;
        flex: 1;
        margin: 0 auto;
    }

    .cart-items {
        max-height: none;
        height: auto;
        padding-right: 0;
        overflow-y: visible;
    }

    .cart-summary {
        max-height: none;
        height: auto;
        padding: 20px;
        overflow-y: visible;
    }

   .cart-item {
        grid-template-columns: 55px 1fr;
        grid-template-rows: auto auto;
        padding: 16px 12px;
        gap: 12px;
        position: relative;
        align-items: start;
    }

    .cart-item:hover {
        transform: none;
        background: rgba(248, 250, 252, 0.6);
    }

    .item-image {
        width: 55px;
        height: 55px;
        font-size: 20px;
        grid-row: 1 / 3;
        align-self: center;
    }

    .item-details {
        grid-column: 2;
        grid-row: 1;
        padding-right: 35px;
        margin-bottom: 8px;
    }

    .item-details h3 {
        font-size: 15px;
        line-height: 1.3;
        margin-bottom: 3px;
        font-weight: 600;
    }

    .item-details p {
        font-size: 12px;
        color: #94a3b8;
        line-height: 1.2;
    }

    .mobile-controls {
        display: flex;
        grid-column: 2;
        grid-row: 2;
        justify-content: space-between;
        align-items: center;
        gap: 8px; /* Reduced gap */
        margin-top: 4px;
        width: 100%;
        position: relative;
        z-index: 8;
        flex-wrap: nowrap; /* Prevent wrapping */
    }


    /* FIX 1: Price display - keep Rs and number on same line */
    .item-price {
        font-size: 0.7rem;
        font-weight: 700;
        order: 2;
        flex-shrink: 0;
        text-align: right;
        min-width: fit-content;
        display: flex;
        flex-direction: column; /* Stack original and discounted prices vertically */
        align-items: flex-end;
        gap: 2px;
        white-space: nowrap; /* Prevent line breaks within price amounts */
    }

    /* Ensure original and discounted prices stay on one line each */
    .item-price .original-price,
    .item-price .discounted-price {
        white-space: nowrap;
        display: inline;
    }
    .quantity-controls {
        scale: 1;
        max-width: 30%;
        order: 1;
        position: relative;
        z-index: 9;  /* Higher z-index for mobile quantity controls */
    }

    .quantity-btn {
        padding: 5px 8px;
        font-size: 12px;
    }

    .quantity-input {
        width: 40%;
        padding: 5px 0;
        font-size: 12px;
    }

    .remove-btn {
        position: absolute;
        top: 12px;
        right: 8px;
        width: 28px;
        height: 28px;
        font-size: 16px;
        padding: 0;
        border-radius: 6px;
        z-index: 15;  /* Very high z-index for remove button */
    }

    .summary-title {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .summary-row {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .summary-row.total {
        font-size: 16px;
        margin-top: 12px;
        padding-top: 12px;
    }

    .promo-code {
        margin: 16px 0;
        padding: 12px 0;
    }

    .promo-input {
        padding: 10px;
        font-size: 13px;
        margin-bottom: 8px;
    }

    .promo-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .checkout-btn {
        padding: 14px;
        font-size: 14px;
        margin-top: 16px;
    }

    .continue-shopping {
        margin-top: 16px;
    }

    .continue-shopping a {
        font-size: 14px;
        padding: 8px 16px;
    }

    .security-info {
        margin-top: 12px;
        font-size: 11px;
    }

    .breadcrumb {
        display: none;
    }

    .logo {
        margin-left: calc(-1 * var(--container-pad));
    }

    header {
        margin-left: calc(-1 * var(--container-pad));
        margin-right: calc(-1 * var(--container-pad));
        width: calc(100% + calc(var(--container-pad) * 2));
    }

    /* Empty cart mobile responsive */
    .empty-cart {
        padding: 40px 15px;
        margin: 15px 0;
    }

    .empty-cart-title {
        font-size: 1.5rem;
    }

    .empty-cart-description {
        font-size: 1rem;
    }

    .empty-cart-actions {
        flex-direction: column;
        align-items: center;
    }

    .start-shopping-btn, .browse-deals-btn {
        width: 100%;
        max-width: 250px;
    }

    .category-tags {
        justify-content: center;
    }

    .empty-cart-features {
        flex-direction: column;
        gap: 15px;
    }
        /* FIX 2: Match Stock button - ensure full visibility */
    .match-stock-btn {
        font-size: 11px;
        padding: 6px 18px;
        border-radius: 4px;
        flex-shrink: 1;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .match-stock-btn i {
        font-size: 10px;
        margin-right: 2px;
    }
        /* FIX 3: Out of stock quantity controls layout */
    .cart-item.out-of-stock .quantity-controls {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 60%;
        min-height: 32px;
        padding: 4px 8px;
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 6px;
    }

    .cart-item.out-of-stock .quantity-controls .quantity-btn {
        padding: 3px 6px;
        font-size: 10px;
        opacity: 0.5;
    }

    .cart-item.out-of-stock .quantity-controls .quantity-input {
        width: 30px;
        font-size: 12px;
        font-weight: bold;
        color: #dc3545;
        background: #ffebee;
        text-align: center;
    }

    .out-of-stock-notice {
        font-size: 10px;
        color: #dc3545;
        text-align: center;
        margin-top: 3px;
        font-weight: bold;
        white-space: nowrap;
        position: absolute;
        bottom: -18px;
        left: 0;
        right: 0;
    }

    /* Adjust cart item height for out of stock items to accommodate notice */
    .cart-item.out-of-stock {
        padding-bottom: 24px;
    }

    /* Ensure exceeds-stock items have proper layout */
    .cart-item.exceeds-stock .quantity-controls {
        width: 65%; /* Slightly larger for match stock button */
        flex-shrink: 1;
    }

    /* Normal quantity controls */
    .quantity-controls {
        scale: 1;
        width: 30%; /* Adjusted width */
        order: 1;
        position: relative;
        z-index: 9;
       
    }

    /* Ensure better spacing in mobile controls */
    .mobile-controls .item-price {
        margin-left: auto;
        text-align: right;
    }

    /* Improve remove button positioning for mobile */
    .remove-btn {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 26px;
        height: 26px;
        font-size: 14px;
        padding: 0;
        border-radius: 6px;
        z-index: 15;
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid #e2e8f0;
    }

    .remove-btn:hover {
        background: rgba(239, 68, 68, 0.1);
        border-color: #ef4444;
    }
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE SMALL
   ======================================== */

@media (max-width: 480px) {
    .match-stock-btn {
        font-size: 10px;
        padding: 5px 6px;
        gap: 3px;
    }

    .quantity-controls {
        min-width: 80px;
        width: 50%;
    }
        .quantity-input {
        width: 20%;
        padding: 5px 0;
        font-size: 12px;
    }

    .mobile-controls {
        gap: 6px;
    }

    .item-price {
        font-size: 0.65rem;
        min-width: 70px;
    }

    /* Ensure out of stock notice is readable on small screens */
    .out-of-stock-notice {
        font-size: 9px;
    }
}
