/* ===== Cart Page Styles ===== */

/* Main Container */
.cart-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.cart-main {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
}

@media (max-width: 1024px) {
    .cart-main {
        grid-template-columns: 1fr;
    }
}

/* Cart Items Section */
.cart-items-section {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.cart-header-bar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #fff;
}

.cart-header-bar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.cart-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-header-left h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    margin: 0;
}

.item-count {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
}

/* Deliver To Section */
.deliver-to-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.deliver-label {
    font-size: 13px;
    color: #6B7280;
    font-weight: 500;
}

.deliver-address {
    font-size: 13px;
    color: #1F2937;
    font-weight: 600;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deliver-change-link {
    font-size: 12px;
    color: #0066cc;
    font-weight: 500;
    text-decoration: none;
}

.deliver-change-link:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .cart-header-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .deliver-to-section {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
    }
    
    .deliver-address {
        max-width: 200px;
    }
}

.clear-text {
    font-size: 14px;
    color: #EF4444;
    font-weight: 600;
    cursor: pointer;
}

.cart-actions-bar {
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 16px;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #111;
    cursor: pointer;
}

.select-all-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.cart-action-buttons {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.cart-action-btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
}

.cart-action-btn:hover {
    background: #f3f4f6;
}

.save-btn:hover {
    border-color: #f59e0b;
    color: #f59e0b;
}

.delete-btn:hover {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

/* Cart Item Card */
.cart-item-card {
    background: #FFFFFF;
    margin: 0 16px 12px 16px;
    border-radius: 12px;
    padding: 16px;
    flex-direction: row;
    align-items: center;
    display: flex;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.cart-item-card.selected {
    background: #f0f7ff;
}

@media (max-width: 640px) {
    .cart-item-card {
        flex-direction: column;
        margin: 0 12px 12px 12px;
    }
}

.item-select {
    display: flex;
    align-items: flex-start;
    padding-top: 4px;
}

.item-select input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 12px;
}

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

@media (max-width: 640px) {
    .item-image {
        width: 100%;
        height: 200px;
        margin-right: 0;
        margin-bottom: 12px;
    }
}

/* Product Info */
.product-info {
    flex: 1;
    margin-right: 12px;
}

.item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 4px;
    line-height: 1.4;
}

.item-brand {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 4px;
}

.item-price {
    font-size: 16px;
    font-weight: 700;
    color: #1F2937;
    margin-top: 4px;
}

.item-original-price {
    font-size: 13px;
    color: #94A3B8;
    text-decoration: line-through;
    margin-left: 8px;
}

/* Quantity Controls */
.quantity-controls {
    flex-direction: row;
    align-items: center;
    margin-right: 12px;
    display: flex;
    gap: 8px;
}

.quantity-button {
    width: 28px;
    height: 28px;
    border-radius: 14px;
    background: #F3F4F6;
    justify-content: center;
    align-items: center;
    display: flex;
    cursor: pointer;
    border: none;
    font-size: 16px;
    color: #374151;
    transition: all 0.2s;
}

.quantity-button:hover:not(:disabled) {
    background: #e5e7eb;
}

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

.quantity {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    min-width: 20px;
    text-align: center;
    margin: 0 12px;
}

/* Item Actions Right - Save and Remove buttons */
.item-actions-right {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: flex-start;
}

.action-btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    border: none;
    font-weight: 500;
}

.save-btn-small {
    background: #F3F4F6;
    color: #374151;
}

.save-btn-small:hover {
    background: #E5E7EB;
    color: #F59E0B;
}

.remove-btn-small {
    background: #FEF2F2;
    color: #EF4444;
}

.remove-btn-small:hover {
    background: #FEE2E2;
}

.action-btn i {
    font-size: 12px;
}

/* Order Summary Section */
.order-summary-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    position: sticky;
    top: 20px;
    height: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.summary-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.summary-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1F2937;
    margin: 0;
}

.summary-content {
    padding: 20px;
}

.terms-notice {
    font-size: 12px;
    color: #666;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
    line-height: 1.5;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.summary-row.subtotal {
    color: #6B7280;
}

.summary-row.shipping {
    color: #6B7280;
}

.summary-row.tax {
    color: #6B7280;
    margin-bottom: 16px;
}

.free-shipping-banner {
    background: #ecfdf5;
    border: 1px solid #10b981;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 16px;
}

.free-shipping-banner p {
    font-size: 13px;
    color: #059669;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.free-shipping-banner i {
    color: #10b981;
}

.shipping-options {
    margin-bottom: 16px;
}

.shipping-options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.shipping-options-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    margin: 0;
}

.change-link {
    font-size: 13px;
    color: #0066cc;
    cursor: pointer;
}

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

.shipping-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.shipping-option:hover {
    border-color: #0066cc;
}

.shipping-option.selected {
    border-color: #0066cc;
    background: #f0f7ff;
}

.shipping-option input[type="radio"] {
    margin-top: 3px;
    cursor: pointer;
}

.shipping-option-content {
    flex: 1;
}

.shipping-option-name {
    font-size: 14px;
    font-weight: 500;
    color: #111;
    display: flex;
    align-items: center;
    gap: 8px;
}

.shipping-option-name i {
    color: #10b981;
}

.shipping-option-price {
    font-size: 14px;
    font-weight: 600;
    color: #111;
}

.shipping-option-days {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

.delivery-estimate {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 16px;
}

.delivery-estimate p {
    font-size: 13px;
    color: #92400e;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delivery-estimate i {
    color: #f59e0b;
}

.price-breakdown {
    border-top: 1px solid #f3f4f6;
    padding-top: 16px;
    margin-top: 16px;
}

.summary-row.total {
    border-top: 1px solid #f3f4f6;
    padding-top: 8px;
    margin-top: 8px;
}

.summary-row.total .label {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
}

.summary-row.total .value {
    font-size: 18px;
    font-weight: 700;
    color: #1F2937;
}

.checkout-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.checkout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.checkout-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Empty Cart */
.empty-cart-page {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 40px 20px;
}

.empty-cart-page.show {
    display: flex;
}

.empty-cart-icon {
    width: 80px;
    height: 80px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.empty-cart-icon i {
    font-size: 36px;
    color: #9ca3af;
}

.empty-cart-page h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 8px;
}

.empty-cart-page p {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 24px;
    text-align: center;
}

.continue-shopping-btn {
    background-color: #6366F1;
    border-radius: 12px;
    paddingHorizontal: 24px;
    paddingVertical: 12px;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.continue-shopping-btn:hover {
    background: #4f46e5;
}

/* Hide container when cart has items */
#cartContainer.hide {
    display: none;
}

/* App Download Buttons */
.app-download-buttons {
    display: flex;
    gap: 8px;
    margin-left: 12px;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #111;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.2s;
}

.download-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

.download-btn i {
    font-size: 16px;
}

.download-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.download-text small {
    font-size: 9px;
}

.download-text strong {
    font-size: 11px;
    font-weight: 600;
}

/* Back Arrow Button */
.back-arrow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-tertiary, #f3f4f6);
    color: var(--text-secondary, #666);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    text-decoration: none;
    margin-right: 12px;
}

.back-arrow-btn:hover {
    background: #667eea;
    color: white;
}

.back-arrow-btn i {
    font-size: 20px;
}

@media (max-width: 768px) {
    .back-arrow-btn {
        width: 38px;
        height: 38px;
        margin-right: 8px;
    }
    
    .back-arrow-btn i {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .back-arrow-btn {
        width: 36px;
        height: 36px;
        margin-right: 6px;
    }
    
    .back-arrow-btn i {
        font-size: 16px;
    }
}

/* Saved Items Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-container {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    background: #f9fafb;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1F2937;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6B7280;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #1F2937;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    max-height: 60vh;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #f3f4f6;
    background: #f9fafb;
}

.modal-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.modal-btn.secondary {
    background: #f3f4f6;
    color: #374151;
}

.modal-btn.secondary:hover {
    background: #e5e7eb;
}

.modal-btn.primary {
    background: #6366F1;
    color: white;
}

.modal-btn.primary:hover {
    background: #4f46e5;
}

/* Saved Modal Items */
.saved-modal-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 12px;
}

.saved-modal-item:last-child {
    margin-bottom: 0;
}

.saved-modal-item-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.saved-modal-item-info {
    flex: 1;
}

.saved-modal-item-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1F2937;
    margin: 0 0 4px 0;
}

.saved-modal-item-info p {
    font-size: 12px;
    color: #6B7280;
    margin: 0 0 4px 0;
}

.saved-modal-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #1F2937;
}

.saved-modal-item-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.saved-modal-item-btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-weight: 500;
}

.saved-modal-move-btn {
    background: #6366F1;
    color: white;
}

.saved-modal-move-btn:hover {
    background: #4f46e5;
}

.saved-modal-remove-btn {
    background: #FEF2F2;
    color: #EF4444;
}

.saved-modal-remove-btn:hover {
    background: #FEE2E2;
}

.saved-modal-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6B7280;
}

.saved-modal-empty i {
    font-size: 48px;
    color: #D1D5DB;
    margin-bottom: 16px;
}

.saved-modal-empty p {
    font-size: 14px;
    margin: 0;
}

/* App Download Section - Store Badges */
.app-download-section {
    display: flex;
    gap: 12px;
    align-items: center;
}

.store-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #111;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}

.store-badge:hover {
    background: #333;
    transform: translateY(-1px);
}

.store-badge i {
    font-size: 24px;
}

.store-badge-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.store-badge-small {
    font-size: 10px;
    opacity: 0.8;
}

.store-badge-large {
    font-size: 14px;
    font-weight: 600;
}

.apple-badge {
    background: #000;
}

.apple-badge:hover {
    background: #333;
}

.google-badge {
    background: #000;
}

.google-badge:hover {
    background: #333;
}

/* Saved Icon Badge - Always visible on all devices */
.saved-icon {
    position: relative;
}

.saved-icon .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #EF4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.saved-icon i {
    font-size: 18px;
    color: #374151;
}

.saved-icon:hover i {
    color: #F59E0B;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .cart-container {
        padding: 12px;
        padding-bottom: 0;
    }
    
    .cart-main {
        gap: 16px;
    }
    
    .cart-header-bar {
        padding: 12px 16px;
    }
    
    .cart-header-bar h2 {
        font-size: 16px;
    }
    
    .cart-actions-bar {
        padding: 10px 16px;
        flex-wrap: wrap;
    }
    
    .cart-action-buttons {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
    
    .cart-item-card {
        padding: 16px;
    }
    
    .summary-content {
        padding: 16px;
    }
    
    .summary-row {
        font-size: 13px;
    }
    
    .summary-row.total .label,
    .summary-row.total .value {
        font-size: 16px;
    }
    
    .checkout-btn {
        font-size: 15px;
        padding: 12px 16px;
    }
}

/* ===== Bottom Navigation Styles - ALL DEVICES ===== */
/* Base styles for bottom nav - applies to ALL devices */
.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    background: #FFFFFF !important;
    border-top: 1px solid #E2E8F0 !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    padding: 8px 4px !important;
    z-index: 9999 !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08) !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Nav items styling */
.nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    color: #64748B !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    min-width: 64px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.nav-item i {
    font-size: 20px !important;
    transition: all 0.3s ease !important;
}

.nav-item span {
    visibility: visible !important;
    opacity: 1 !important;
}

.nav-item.active {
    color: #423241 !important;
}

.nav-item:hover {
    color: #423241 !important;
}

/* DopGO nav item special styling */
.nav-item.dopgo {
    background: transparent !important;
    color: #64748B !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.nav-item.dopgo i,
.nav-item.dopgo .dopgo-icons i {
    font-size: 22px !important;
}

.nav-item.dopgo .dopgo-icons {
    display: flex !important;
}

.nav-item.dopgo.active,
.nav-item.dopgo:hover {
    color: #423241 !important;
}

/* ===== Desktop-specific bottom nav ===== */
@media (min-width: 769px) {
    .bottom-nav {
        padding: 10px 20px !important;
    }
    
    .nav-item {
        padding: 10px 16px !important;
        min-width: 80px !important;
        font-size: 12px !important;
    }
    
    .nav-item i {
        font-size: 24px !important;
    }
    
    .main-content {
        padding-bottom: 75px !important;
    }
    
    .cart-container {
        padding-bottom: 20px !important;
    }
}

/* ===== Tablet-specific bottom nav ===== */
@media (max-width: 768px) {
    .bottom-nav {
        padding: 8px 4px !important;
    }
    
    .nav-item {
        padding: 8px 10px !important;
        min-width: 64px !important;
        font-size: 10px !important;
    }
    
    .nav-item i {
        font-size: 20px !important;
    }
    
    .main-content {
        padding-bottom: 85px !important;
    }
    
    .cart-container {
        padding-bottom: 85px !important;
    }
}

/* ===== Mobile-specific bottom nav ===== */
@media (max-width: 480px) {
    .bottom-nav {
        padding: 6px 2px !important;
    }
    
    .nav-item {
        padding: 6px 6px !important;
        min-width: 56px !important;
        font-size: 9px !important;
    }
    
    .nav-item i {
        font-size: 18px !important;
    }
    
    .main-content {
        padding-bottom: 80px !important;
    }
    
    .cart-container {
        padding-bottom: 80px !important;
    }
    
    .nav-item.dopgo i,
    .nav-item.dopgo .dopgo-icons i {
        font-size: 18px !important;
    }
}
