/* ============================================
   CART PAGE - OPTIMIZED CSS
   No Border Radius - No Box Shadow
   Sharp Corners - Clean Design
   ============================================ */

/* ============================================
   CART LAYOUT
   ============================================ */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
}

@media (max-width: 1024px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   SHIPPING SELECT WRAPPER
   ============================================ */
.shipping-select-wrapper {
    width: 100%;
    margin: 10px 0;
}

.shipping-select-wrapper select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
}

.shipping-select-wrapper select:focus {
    border-color: #4CAF50;
    outline: none;
}

.shipping-select-wrapper select:hover {
    border-color: #4CAF50;
}

.shipping-select-wrapper .shipping-note {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.summary-row.shipping-row {
    background-color: #f8f9fa;
    padding: 12px 15px;
    margin: 5px 0;
}

.selected-shipping-label {
    color: #4CAF50;
    font-weight: 600;
    font-size: 13px;
}

/* ============================================
   MESSAGES
   ============================================ */
.message {
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.message-error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.message-warning {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.message.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.btn-updating {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ============================================
   CART ITEMS SECTION
   ============================================ */
.cart-items-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.cart-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.cart-items-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-items-header h2 i {
    color: #FF6B35;
}

.item-count {
    font-size: 13px;
    color: #6c757d;
    background: #e9ecef;
    padding: 2px 8px;
    margin-left: 6px;
}

.cart-actions {
    display: flex;
    gap: 8px;
}

.action-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #495057;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.action-btn-sm:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.action-btn-sm.danger:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

/* ============================================
   CART ITEMS LIST
   ============================================ */
.cart-items-list {
    padding: 18px;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.item-image {
    width: 80px;
    height: 80px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-image i {
    font-size: 32px;
    color: #adb5bd;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    text-decoration: none;
}

.item-name:hover {
    color: #FF6B35;
}

.item-meta {
    font-size: 13px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.item-supplier {
    font-size: 13px;
    color: #6c757d;
}

.item-supplier i {
    color: #FF6B35;
    width: 14px;
}

.item-price {
    font-size: 15px;
    font-weight: 600;
    color: #FF6B35;
}

.supplier-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #f39c12;
}

.supplier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
}

.item-tax {
    font-size: 12px;
    color: #888;
}

/* ============================================
   QUANTITY CONTROLS
   ============================================ */
.item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    overflow: hidden;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #fff;
    color: #495057;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.quantity-btn:hover {
    background: #f5f5f5;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-input {
    width: 44px;
    height: 28px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.quantity-input:focus {
    outline: none;
}

.stock-info {
    font-size: 12px;
    color: #6c757d;
}

/* ============================================
   ITEM TOTAL
   ============================================ */
.item-total {
    text-align: right;
}

.item-total-price {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.remove-btn {
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    font-size: 14px;
}

.remove-btn:hover {
    color: #dc3545;
}

.update-cart-btn {
    margin-top: 16px;
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.update-cart-btn:hover {
    background: #e9ecef;
}

/* ============================================
   COUPON SECTION
   ============================================ */
.coupon-section {
    padding: 18px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.coupon-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.coupon-section h3 i {
    color: #FF6B35;
}

.coupon-form {
    display: flex;
    gap: 8px;
}

.coupon-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.coupon-input:focus {
    outline: none;
    border-color: #FF6B35;
}

.applied-coupon {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    padding: 10px 14px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.coupon-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #166534;
}

.coupon-info i {
    color: #28a745;
}

.remove-coupon-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
}

.remove-coupon-btn:hover {
    background: #fee2e2;
}

/* ============================================
   CART SUMMARY
   ============================================ */
.cart-summary {
    background: #fff;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    position: sticky;
    top: 90px;
    height: fit-content;
}

.summary-header {
    padding: 14px 18px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.summary-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-header h2 i {
    color: #FF6B35;
}

.summary-body {
    padding: 18px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.summary-label {
    color: #6c757d;
}

.summary-value {
    color: #1a1a2e;
    font-weight: 500;
}

.summary-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 12px 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
}

.discount-value {
    color: #28a745;
}

.free-shipping {
    color: #28a745;
}

/* ============================================
   LOCATION INFO
   ============================================ */
.location-info {
    background: #f0f7ff;
    padding: 10px;
    margin: 8px 0;
    font-size: 13px;
}

.shipping-method-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    margin-top: 6px;
    font-size: 13px;
}

.tax-detail {
    font-size: 12px;
    color: #6c757d;
    margin-left: 8px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #FF6B35;
    color: #fff;
}

.btn-primary:hover {
    background: #E85A24;
}

.checkout-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #FF6B35;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    margin-top: 16px;
}

.checkout-btn:hover {
    background: #E85A24;
}

.checkout-btn:disabled {
    background: #ced4da;
    cursor: not-allowed;
}

.continue-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: #6c757d;
    text-decoration: none;
}

.continue-link:hover {
    color: #FF6B35;
}

/* ============================================
   PAYMENT METHODS
   ============================================ */
.payment-methods {
    padding: 18px;
    border-top: 1px solid #e0e0e0;
}

.payment-methods h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.payment-icons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.payment-icon {
    padding: 6px 14px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    font-size: 13px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 6px;
}

.payment-icon i {
    font-size: 14px;
}

.payment-icon.mpesa i {
    color: #00b300;
}

.payment-icon.visa i {
    color: #1434cb;
}

.payment-icon.mastercard i {
    color: #eb001b;
}

/* ============================================
   LOGIN PROMPT
   ============================================ */
.login-prompt {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    padding: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-prompt i {
    color: #FF6B35;
    font-size: 24px;
}

.prompt-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.prompt-content p {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 10px;
}

.prompt-actions {
    display: flex;
    gap: 10px;
}

.btn-xs {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   EMPTY CART
   ============================================ */
.empty-cart {
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 50px 20px;
    text-align: center;
    max-width: 450px;
    margin: 30px auto;
}

.empty-icon {
    font-size: 56px;
    color: #dee2e6;
    margin-bottom: 16px;
}

.empty-cart h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.empty-cart p {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 20px;
}

.empty-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-browse {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #FF6B35;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.btn-browse:hover {
    background: #E85A24;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.btn-outline:hover {
    background: #f8f9fa;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .cart-item {
        grid-template-columns: 60px 1fr;
        grid-template-rows: auto auto;
    }

    .item-total {
        grid-column: 1 / -1;
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 10px;
    }

    .cart-items-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .cart-actions {
        width: 100%;
    }

    .action-btn-sm {
        flex: 1;
        justify-content: center;
    }

    .coupon-form {
        flex-direction: column;
    }

    .prompt-actions {
        flex-direction: column;
    }

    .btn-xs {
        text-align: center;
        justify-content: center;
    }

    .empty-actions {
        flex-direction: column;
        align-items: center;
    }

    .empty-actions a {
        width: 100%;
        justify-content: center;
    }
}