

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    background: #f5f5f5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #111;
    line-height: 1.5;
    padding-bottom: 75px;
    -webkit-font-smoothing: antialiased;
}

/* ============================================ */
/* MAIN CONTAINER                               */
/* ============================================ */
    /* =========================================================
   CART HEADER / BACK TO HOME
   ========================================================= */

.cart-header {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 20px;
}

.cart-header a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    color: #f58220;
    background: #fff;

    text-decoration: none;

    font-size: 20px;

  
    border-radius: 50%;

    transition: all 0.25s ease;
}

.cart-header a:hover {
    color: #fff;
    background: #f58220;
    transform: translateX(-3px);
}

.cart-header a:active {
    transform: translateX(-1px);
}
.cart-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 12px 12px;
}

/* ============================================ */
/* CART LAYOUT - Single Column on Mobile        */
/* ============================================ */

.cart-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================ */
/* CART ITEMS SECTION                           */
/* ============================================ */

.cart-items-section {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
}

.cart-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e5e5;
    background: #f8f9fa;
}

.cart-items-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-items-header h2 i {
    color: #f97316;
}

.item-count {
    font-size: 12px;
    color: #999;
    background: #e5e5e5;
    padding: 1px 10px;
    border-radius: 20px;
    margin-left: 4px;
}

.cart-actions {
    display: flex;
    gap: 6px;
}

.action-btn-sm {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #e5e5e5;
    background: white;
    color: #555;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn-sm:active {
    background: #f5f5f5;
}

.action-btn-sm.danger:active {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* ============================================ */
/* CART ITEMS LIST                              */
/* ============================================ */

.cart-items-list {
    padding: 12px 16px;
}

.cart-item {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

/* ============================================ */
/* ITEM IMAGE                                   */
/* ============================================ */

.item-image {
    width: 70px;
    height: 70px;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-image i {
    font-size: 28px;
    color: #ccc;
}

/* ============================================ */
/* ITEM DETAILS                                 */
/* ============================================ */

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

.item-name {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    text-decoration: none;
    display: -webkit-box;
  
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.item-supplier {
    font-size: 12px;
    color: #999;
}

.item-supplier i {
    color: #f97316;
    width: 14px;
}

.item-price {
    font-size: 15px;
    font-weight: 700;
    color: #f97316;
}

/* ============================================ */
/* QUANTITY CONTROLS                            */
/* ============================================ */

.item-quantity {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: white;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.quantity-btn:active {
    background: #f5f5f5;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-input {
    width: 40px;
    height: 28px;
    border: none;
    border-left: 1px solid #e5e5e5;
    border-right: 1px solid #e5e5e5;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.quantity-input:focus {
    outline: none;
}

.stock-info {
    font-size: 11px;
    color: #999;
}

/* ============================================ */
/* ITEM TOTAL & REMOVE                          */
/* ============================================ */

.item-total {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.item-total-price {
    font-size: 15px;
    font-weight: 700;
    color: #111;
}

.remove-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
}

.remove-btn:active {
    color: #dc3545;
}

/* ============================================ */
/* COUPON SECTION                               */
/* ============================================ */

.coupon-section {
    padding: 12px 16px;
    border-top: 1px solid #e5e5e5;
    background: #f8f9fa;
}

.coupon-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.coupon-section h3 i {
    color: #f97316;
}

.coupon-form {
    display: flex;
    gap: 8px;
}

.coupon-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
}

.coupon-input:focus {
    outline: none;
    border-color: #f97316;
}

.coupon-btn {
    padding: 8px 16px;
    background: #f97316;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.coupon-btn:active {
    opacity: 0.8;
    transform: scale(0.97);
}

.applied-coupon {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.coupon-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #166534;
}

.coupon-info i {
    color: #28a745;
}

.remove-coupon-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 8px;
}

.remove-coupon-btn:active {
    background: #fee2e2;
    border-radius: 4px;
}

/* ============================================ */
/* CART SUMMARY - Native App Style              */
/* ============================================ */

.cart-summary {
    background: white;
    border-radius: 14px;
    border: 1px solid #e5e5e5;
    overflow: hidden;
    position: sticky;
    bottom: 0;
}

.summary-header {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e5e5;
    background: #f8f9fa;
}

.summary-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-header h2 i {
    color: #f97316;
}

.summary-body {
    padding: 14px 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.summary-label {
    color: #999;
}

.summary-value {
    color: #111;
    font-weight: 500;
}

.summary-divider {
    height: 1px;
    background: #e5e5e5;
    margin: 10px 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

.discount-value {
    color: #28a745;
}

.free-shipping {
    color: #28a745;
}

/* ============================================ */
/* CHECKOUT BUTTON                              */
/* ============================================ */

.checkout-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: #f97316;
    color: white;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    margin-top: 12px;
}

.checkout-btn:active {
    opacity: 0.8;
    transform: scale(0.97);
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.continue-link {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    color: #999;
    text-decoration: none;
}

.continue-link:active {
    color: #f97316;
}

/* ============================================ */
/* SHIPPING SELECT                              */
/* ============================================ */

.shipping-select-wrapper {
    width: 100%;
    margin: 8px 0;
}

.shipping-select-wrapper select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    font-family: inherit;
}

.shipping-select-wrapper select:focus {
    border-color: #f97316;
    outline: none;
}

.shipping-select-wrapper .shipping-note {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* ============================================ */
/* MESSAGES                                     */
/* ============================================ */

.message {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.message-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.message-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.message-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

/* ============================================ */
/* LOGIN PROMPT                                 */
/* ============================================ */

.login-prompt {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-prompt i {
    color: #f97316;
    font-size: 24px;
}

.prompt-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    margin-bottom: 2px;
}

.prompt-content p {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

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

.btn-xs {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-primary-xs {
    background: #f97316;
    color: white;
}

.btn-primary-xs:active {
    opacity: 0.8;
}

.btn-outline-xs {
    background: white;
    border: 1px solid #e5e5e5;
    color: #555;
}

.btn-outline-xs:active {
    background: #f5f5f5;
}

/* ============================================ */
/* EMPTY CART                                   */
/* ============================================ */

.empty-cart {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    padding: 50px 20px;
    text-align: center;
    max-width: 400px;
    margin: 30px auto;
}

.empty-icon {
    font-size: 56px;
    color: #ccc;
    margin-bottom: 16px;
}

.empty-cart h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    margin-bottom: 6px;
}

.empty-cart p {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
}

.empty-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-browse {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #f97316;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
}

.btn-browse:active {
    opacity: 0.8;
    transform: scale(0.97);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: white;
    border: 1px solid #e5e5e5;
    color: #555;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

.btn-outline:active {
    background: #f5f5f5;
}

/* ============================================ */
/* PAYMENT METHODS                              */
/* ============================================ */

.payment-methods {
    padding: 12px 16px;
    border-top: 1px solid #e5e5e5;
}

.payment-methods h4 {
    font-size: 13px;
    font-weight: 600;
    color: #111;
    margin-bottom: 8px;
}

.payment-icons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.payment-icon {
    padding: 4px 12px;
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 12px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 4px;
}

.payment-icon i {
    font-size: 14px;
}

.payment-icon.mpesa i {
    color: #00b300;
}

.payment-icon.visa i {
    color: #1434cb;
}

.payment-icon.mastercard i {
    color: #eb001b;
}

/* ============================================ */
/* RESPONSIVE - LARGER SCREENS                  */
/* ============================================ */

@media (min-width: 576px) {
    .cart-container {
        padding: 0 16px 16px;
        max-width: 1200px;
        margin: 0 auto;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
    }

    .item-image {
        width: 80px;
        height: 80px;
    }
}

@media (min-width: 768px) {
    .cart-layout {
        flex-direction: row;
        gap: 20px;
    }

    .cart-items-section {
        flex: 2;
    }

    .cart-summary {
        flex: 1;
        position: sticky;
        top: 80px;
    }

    .item-total {
        grid-column: auto;
        border-top: none;
        padding-top: 0;
        margin-top: 0;
        text-align: right;
        flex-direction: column;
        align-items: flex-end;
        justify-content: flex-start;
    }

    .cart-item {
        grid-template-columns: 80px 1fr auto;
    }
}

/* ============================================ */
/* RESPONSIVE - SMALL MOBILE (below 400px)      */
/* ============================================ */

@media (max-width: 400px) {
    .cart-container {
        padding: 0 8px 8px;
    }

    .cart-items-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .cart-actions {
        width: 100%;
    }

    .action-btn-sm {
        flex: 1;
        justify-content: center;
        font-size: 11px;
    }

    .coupon-form {
        flex-direction: column;
    }

    .item-image {
        width: 60px;
        height: 60px;
    }

    .cart-item {
        grid-template-columns: 60px 1fr;
        gap: 10px;
    }

    .item-name {
        font-size: 13px;
    }
}

/* ============================================ */
/* TOUCH DEVICE OPTIMIZATIONS                   */
/* ============================================ */

@media (hover: none) and (pointer: coarse) {
    .quantity-btn:hover {
        background: none !important;
    }

    .action-btn-sm:hover {
        background: none !important;
    }

    .checkout-btn:hover {
        background: #f97316 !important;
    }

    .btn-browse:hover {
        background: #f97316 !important;
    }

    .coupon-btn:hover {
        background: #f97316 !important;
    }
}

/* ============================================ */
/* UTILITY                                      */
/* ============================================ */

.text-center {
    text-align: center;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Hide scrollbars globally */
::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;
    display: none;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

::selection {
    background: #f97316;
    color: white;
}

/* ============================================ */
/* SAFE AREA (Notch phones)                    */
/* ============================================ */

@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: calc(75px + env(safe-area-inset-bottom));
    }
}