/* ===== SHOPPING CART STYLES ===== */

/* Cart Button */
.cart-btn {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: #000;
    color: #e8e4dc;
    border: 2px solid #000;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.cart-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

#cartCount {
    background: #e8e4dc;
    color: #000;
    padding: 2px 8px;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: bold;
    margin-left: 5px;
}

/* Cart Panel */
.cart-panel {
    position: fixed;
    right: -450px;
    top: 0;
    width: 450px;
    height: 100%;
    background: #fff;
    border-left: 3px solid #000;
    z-index: 1500;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -5px 0 20px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.cart-panel.active {
    right: 0;
}

.cart-header {
    background: #000;
    color: #e8e4dc;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.cart-header h3 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.close-cart {
    font-size: 30px;
    cursor: pointer;
    transition: transform 0.3s;
}

.close-cart:hover {
    transform: rotate(90deg);
}

.cart-items {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.empty-cart {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border: 2px solid #000;
    margin-bottom: 15px;
    background: #f9f9f9;
    transition: all 0.3s;
    position: relative;
}

.cart-item:hover {
    transform: translateX(-5px);
    box-shadow: 5px 5px 0 #000;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    background: #e8e4dc;
    border: 2px solid #000;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: #000;
}

.cart-item-info p {
    margin: 3px 0;
    font-size: 0.9rem;
    color: #666;
}

.cart-item-price {
    font-weight: bold;
    color: #000;
    font-size: 1.1rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.qty-btn {
    background: #000;
    color: #e8e4dc;
    border: none;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s;
}

.qty-btn:hover {
    background: #333;
    transform: scale(1.1);
}

.cart-item-quantity span {
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.remove-cart {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #ff0000;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    transition: transform 0.3s;
}

.remove-cart:hover {
    transform: scale(1.3);
}

/* Cart Summary */
.cart-summary {
    padding: 20px;
    background: #f9f9f9;
    border-top: 3px solid #000;
    position: sticky;
    bottom: 0;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 1rem;
    color: #666;
}

.cart-total.grand-total {
    font-size: 1.3rem;
    font-weight: bold;
    color: #000;
    border-top: 2px solid #000;
    margin-top: 10px;
    padding-top: 15px;
}

.checkout-btn {
    width: 100%;
    margin-top: 15px;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 2px;
}

/* Checkout Modal */
.checkout-modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.checkout-form {
    padding: 40px;
}

.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #000;
    letter-spacing: 1px;
}

.checkout-form input,
.checkout-form textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: #f9f9f9;
    transition: all 0.3s;
    font-family: inherit;
}

.checkout-form input:focus,
.checkout-form textarea:focus {
    outline: none;
    border-color: #000;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.checkout-summary {
    background: #f9f9f9;
    padding: 25px;
    border: 2px solid #000;
    border-radius: 10px;
    margin-bottom: 25px;
}

.checkout-summary h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #000;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.checkout-totals {
    margin-top: 15px;
}

.checkout-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 1rem;
    color: #666;
}

.checkout-total-row.grand-total {
    font-size: 1.4rem;
    font-weight: bold;
    color: #000;
    border-top: 2px solid #000;
    margin-top: 10px;
    padding-top: 15px;
}

.place-order-btn {
    width: 100%;
    padding: 18px;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 2px;
    background: #000;
    color: #e8e4dc;
    border: 2px solid #000;
}

.place-order-btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.add-to-cart-btn {
    background: #000;
    color: #e8e4dc;
}

.add-to-cart-btn:hover {
    background: #333;
}

/* Responsive Cart Styles */
@media (max-width: 768px) {
    /* Cart Panel - Full Screen on Mobile */
    .cart-panel {
        width: 100%;
        right: -100%;
    }
    
    .cart-panel.active {
        right: 0;
    }
    
    /* Cart Button - Better Mobile Position */
    .cart-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 1rem;
        z-index: 998;
    }
    
    /* Cart Items - Better Touch Targets */
    .cart-item {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .cart-item-image {
        width: 70px;
        height: 70px;
    }
    
    .cart-item-info h4 {
        font-size: 1rem;
    }
    
    .cart-item-info p {
        font-size: 0.85rem;
    }
    
    /* Quantity Controls - Larger Touch Targets */
    .qty-btn {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }
    
    .cart-item-quantity span {
        font-size: 1.1rem;
        min-width: 35px;
    }
    
    /* Remove Button - Larger Touch Target */
    .remove-cart {
        font-size: 1.8rem;
        padding: 5px;
        top: 5px;
        right: 5px;
    }
    
    /* Cart Summary - Better Spacing */
    .cart-summary {
        padding: 15px;
    }
    
    .cart-total {
        padding: 8px 0;
        font-size: 0.95rem;
    }
    
    .cart-total.grand-total {
        font-size: 1.2rem;
    }
    
    .checkout-btn {
        padding: 15px;
        font-size: 1rem;
    }
    
    /* Checkout Modal - Full Screen on Mobile */
    .checkout-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        border: none;
    }
    
    .checkout-form {
        padding: 20px 15px;
    }
    
    .form-section {
        margin-bottom: 25px;
    }
    
    .form-section h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    /* Form Inputs - Better Touch Targets */
    .checkout-form input,
    .checkout-form textarea {
        padding: 14px 12px;
        margin-bottom: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Checkout Summary - Compact on Mobile */
    .checkout-summary {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .checkout-summary h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .checkout-item {
        padding: 8px 0;
        font-size: 0.9rem;
    }
    
    .checkout-total-row {
        padding: 6px 0;
        font-size: 0.95rem;
    }
    
    .checkout-total-row.grand-total {
        font-size: 1.3rem;
    }
    
    /* Place Order Button - Full Width */
    .place-order-btn {
        padding: 16px;
        font-size: 1.1rem;
    }
    
    /* Close Button - Larger Touch Target */
    .close-modal {
        width: 50px;
        height: 50px;
        font-size: 35px;
        right: 15px;
        top: 15px;
    }
    
    .close-cart {
        font-size: 35px;
    }
    
    /* Add to Cart Button in Modal */
    .add-to-cart-btn {
        font-size: 0.95rem;
        padding: 12px 20px;
    }
}

/* Extra Small Devices (phones in portrait) */
@media (max-width: 480px) {
    /* Cart Button - Smaller on Very Small Screens */
    .cart-btn {
        padding: 10px 18px;
        font-size: 0.95rem;
        bottom: 15px;
        right: 15px;
    }
    
    #cartCount {
        padding: 2px 6px;
        font-size: 0.85rem;
    }
    
    /* Cart Panel Header */
    .cart-header {
        padding: 15px;
    }
    
    .cart-header h3 {
        font-size: 1.3rem;
    }
    
    /* Cart Items - More Compact */
    .cart-item {
        padding: 10px;
        gap: 10px;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
    }
    
    .cart-item-info h4 {
        font-size: 0.95rem;
    }
    
    .cart-item-info p {
        font-size: 0.8rem;
    }
    
    .cart-item-price {
        font-size: 1rem;
    }
    
    /* Quantity Controls */
    .qty-btn {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
    
    .cart-item-quantity {
        gap: 8px;
    }
    
    .cart-item-quantity span {
        font-size: 1rem;
        min-width: 30px;
    }
    
    /* Cart Summary */
    .cart-summary {
        padding: 12px;
    }
    
    .cart-total {
        font-size: 0.9rem;
    }
    
    .cart-total.grand-total {
        font-size: 1.1rem;
    }
    
    /* Checkout Form */
    .checkout-form {
        padding: 15px 12px;
    }
    
    .form-section h3 {
        font-size: 1rem;
    }
    
    .checkout-form input,
    .checkout-form textarea {
        padding: 12px 10px;
        font-size: 16px;
    }
    
    .checkout-summary {
        padding: 12px;
    }
    
    .checkout-item {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
    
    .checkout-total-row {
        font-size: 0.9rem;
    }
    
    .checkout-total-row.grand-total {
        font-size: 1.2rem;
    }
    
    .place-order-btn {
        padding: 14px;
        font-size: 1rem;
    }
}

/* Landscape Mode on Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .checkout-modal-content {
        overflow-y: auto;
    }
    
    .checkout-form {
        padding: 15px;
    }
    
    .form-section {
        margin-bottom: 20px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for all interactive elements */
    .cart-btn,
    .qty-btn,
    .remove-cart,
    .checkout-btn,
    .place-order-btn,
    .close-modal,
    .close-cart {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    /* Prevent text selection on buttons */
    .cart-btn,
    .qty-btn,
    .checkout-btn,
    .place-order-btn {
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Smooth scrolling on touch devices */
    .cart-panel,
    .checkout-modal-content {
        -webkit-overflow-scrolling: touch;
    }
}

/* iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix for iOS Safari bottom bar */
    .cart-btn {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    /* Prevent zoom on input focus */
    .checkout-form input,
    .checkout-form textarea {
        font-size: 16px !important;
    }
    
    /* Fix for iOS modal height */
    .checkout-modal-content {
        max-height: -webkit-fill-available;
    }
}

/* Android Specific Fixes */
@media (max-width: 768px) {
    /* Fix for Android keyboard overlap */
    .checkout-form input:focus,
    .checkout-form textarea:focus {
        scroll-margin-bottom: 100px;
    }
}


/* Navbar Cart Icon */
.nav-cart-link {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 5px;
    padding: 8px 16px !important;
}

.cart-icon {
    font-size: 1.3rem;
}

.nav-cart-count {
    background: #e8e4dc;
    color: #000;
    padding: 2px 8px;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.nav-cart-link:hover .nav-cart-count {
    background: #fff;
}

/* Mobile navbar cart */
@media (max-width: 768px) {
    .nav-cart-link {
        justify-content: center;
    }
}


/* Notice Styles */
.cart-notice {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cart-notice .notice-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.cart-notice p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #856404;
}

.cart-notice strong {
    color: #000;
}

/* Checkout Notice */
.checkout-notice {
    background: #e7f3ff;
    border: 2px solid #2196F3;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.checkout-notice .notice-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.checkout-notice .notice-header .notice-icon {
    font-size: 1.5rem;
}

.checkout-notice .notice-header strong {
    font-size: 1.1rem;
    color: #000;
}

.checkout-notice p {
    margin: 10px 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

.checkout-notice ul {
    margin: 10px 0;
    padding-left: 20px;
}

.checkout-notice li {
    margin: 8px 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #333;
}

.checkout-notice .notice-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #2196F3;
    font-size: 0.95rem;
    color: #0d47a1;
}

.checkout-notice .notice-footer strong {
    color: #d32f2f;
}

/* Product Availability Notice */
.product-availability-notice {
    background: #fff9e6;
    border: 2px solid #ff9800;
    border-radius: 10px;
    padding: 15px 20px;
    margin: 0 auto 30px;
    max-width: 1200px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-availability-notice .notice-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.product-availability-notice p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #663c00;
}

.product-availability-notice strong {
    color: #000;
}

/* Responsive notices */
@media (max-width: 768px) {
    .cart-notice {
        padding: 10px 12px;
    }
    
    .cart-notice p {
        font-size: 0.85rem;
    }
    
    .checkout-notice {
        padding: 15px;
    }
    
    .checkout-notice .notice-header strong {
        font-size: 1rem;
    }
    
    .checkout-notice p,
    .checkout-notice li {
        font-size: 0.9rem;
    }
    
    .product-availability-notice {
        flex-direction: column;
        text-align: center;
        padding: 12px 15px;
    }
    
    .product-availability-notice p {
        font-size: 0.9rem;
    }
}
