/* Checkout Page Styles */

body {
    background-color: #f8f9fa;
}

/* Override header styles for checkout page */
.checkout-container .header {
    background: #1a365d;
    color: white;
}

.checkout-container .nav-link {
    color: white;
}

.checkout-container .nav-link:hover {
    color: white;
    background-color: rgba(255,255,255,0.1);
}

.checkout-container .nav-link.active {
    color: white;
    background-color: rgba(255,255,255,0.2);
}

.checkout-container .search-btn,
.checkout-container .cart-btn,
.checkout-container .menu-toggle {
    color: white;
}

.checkout-container .cart-count {
    color: white;
}

.checkout-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
}

.checkout-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    margin-top: 20px;
}

/* Left Column */
.checkout-left {
    max-width: 600px;
}

.checkout-section {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.checkout-section h2 {
    font-size: 24px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e1e5e9;
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 16px;
    color: #495057;
    background: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Checkbox Styles */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
    margin-top: 2px;
}

.checkbox-group label {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
    cursor: pointer;
}

/* Contact Section */
.login-link {
    margin-top: 12px;
}

.login-link a {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
}

.login-link a:hover {
    text-decoration: underline;
}

/* Delivery Options */
.delivery-options {
    display: flex;
    gap: 16px;
}

.delivery-option {
    flex: 1;
}

.delivery-option input[type="radio"] {
    display: none;
}

.delivery-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    color: #212529;
    font-weight: 500;
}

.delivery-label:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.delivery-option input[type="radio"]:checked + .delivery-label {
    border-color: #007bff;
    background: #e3f2fd;
    color: #212529;
    font-weight: 600;
}

.delivery-label i {
    font-size: 18px;
    color: #495057;
}

/* Shipping Methods */
.shipping-methods {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.shipping-method {
    border-bottom: 1px solid #e1e5e9;
}

.shipping-method:last-child {
    border-bottom: none;
}

.shipping-method input[type="radio"] {
    display: none;
}

.shipping-label {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background: white;
}

.shipping-label:hover {
    background: #f8f9fa;
}

.shipping-method input[type="radio"]:checked + .shipping-label {
    background: #e3f2fd;
}

.shipping-info {
    flex: 1;
}

.shipping-name {
    display: block;
    font-weight: 500;
    color: #212529;
    margin-bottom: 4px;
}

.shipping-note {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 2px;
}

.shipping-price {
    font-weight: 600;
    color: #212529;
    font-size: 16px;
}

/* Payment Section */
.payment-security {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 20px;
}

.payment-methods {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.payment-method {
    border-bottom: 1px solid #e1e5e9;
}

.payment-method:last-child {
    border-bottom: none;
}

.payment-method input[type="radio"] {
    display: none;
}

.payment-label {
    display: block;
    padding: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background: white;
}

.payment-label:hover {
    background: #f8f9fa;
}

.payment-method input[type="radio"]:checked + .payment-label {
    background: #e3f2fd;
}

.payment-name {
    display: block;
    font-weight: 500;
    color: #212529;
    margin-bottom: 12px;
}

.payment-details {
    margin-left: 20px;
}

.payment-details p {
    font-size: 14px;
    color: #495057;
    margin-bottom: 12px;
    line-height: 1.4;
}

.bank-info {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin: 12px 0;
}

.bank-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 8px 0;
}

.bank-info p {
    font-size: 13px;
    color: #495057;
    margin: 4px 0;
}

.payment-note {
    font-size: 12px !important;
    color: #6c757d !important;
    font-style: italic;
}

/* Billing Options */
.billing-options {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.billing-option {
    border-bottom: 1px solid #e1e5e9;
}

.billing-option:last-child {
    border-bottom: none;
}

.billing-option input[type="radio"] {
    display: none;
}

.billing-option label {
    display: block;
    padding: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background: white;
    margin: 0;
    color: #333;
    font-weight: 500;
}

.billing-option label:hover {
    background: #f8f9fa;
    color: #333;
}

.billing-option input[type="radio"]:checked + label {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 600;
}

/* Complete Order Button */
.complete-order-section {
    margin: 24px 0;
}

.btn-complete-order {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    background: #212529;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-complete-order:hover {
    background: #343a40;
}

/* Footer Links */
.checkout-footer-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e1e5e9;
}

.checkout-footer-links a {
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
}

.checkout-footer-links a:hover {
    color: #007bff;
    text-decoration: underline;
}

/* Right Column - Order Summary */
.checkout-right {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.order-summary {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 24px;
}

.order-summary h3 {
    font-size: 20px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e1e5e9;
}

.order-items {
    margin-bottom: 20px;
}

.order-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e1e5e9;
}

.order-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.item-image {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.item-quantity {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.item-details {
    flex: 1;
}

.item-details h4 {
    font-size: 14px;
    font-weight: 500;
    color: #212529;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.item-details p {
    font-size: 12px;
    color: #6c757d;
    margin: 0 0 8px 0;
}

.item-price {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
}

/* Discount Section */
.discount-section {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.discount-section input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.discount-section button {
    padding: 12px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.discount-section button:hover {
    background: #0056b3;
}

/* Order Totals */
.order-totals {
    border-top: 1px solid #e1e5e9;
    padding-top: 16px;
}

.total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: #212529;
    font-weight: 500;
}

.total-line.total {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e1e5e9;
}

.help-icon {
    color: #495057;
    margin-left: 4px;
    cursor: help;
    font-size: 12px;
}

/* Phone Input with Help Icon */
.phone-input {
    position: relative;
}

.phone-input .help-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    cursor: help;
}

/* Pickup Locations Section */
.pickup-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.pickup-subtitle {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
}

.change-location-link {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
}

.change-location-link:hover {
    text-decoration: underline;
}

.pickup-locations {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pickup-location {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.pickup-location.selected {
    border-color: #212529;
    box-shadow: 0 0 0 1px #212529;
}

.pickup-location input[type="radio"] {
    display: none;
}

.pickup-location-label {
    display: block;
    padding: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background: white;
}

.pickup-location-label:hover {
    background: #f8f9fa;
}

.pickup-location.selected .pickup-location-label {
    background: #f8f9fa;
}

.pickup-location-label .pickup-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 0;
}

.pickup-details {
    flex: 1;
}

.pickup-details h3 {
    font-size: 16px;
    font-weight: 500;
    color: #212529;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pickup-distance {
    font-size: 14px;
    color: #6c757d;
    font-weight: normal;
}

.pickup-address {
    font-size: 14px;
    color: #495057;
    margin: 4px 0 0 0;
    line-height: 1.4;
}

.pickup-availability {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.pickup-price {
    font-size: 16px;
    font-weight: 600;
    color: #28a745;
    margin-bottom: 4px;
}

.pickup-time {
    font-size: 12px;
    color: #6c757d;
    margin: 0;
    text-align: right;
}

/* Radio button styling for pickup locations */
.pickup-location::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ced4da;
    border-radius: 50%;
    background: white;
    transition: all 0.2s ease;
}

.pickup-location.selected::before {
    border-color: #212529;
    background: #212529;
}

.pickup-location.selected::after {
    content: '';
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    z-index: 1;
}

.pickup-location {
    position: relative;
    padding-left: 48px;
}

.pickup-location-label {
    padding-left: 0;
}

/* Mobile Form Optimizations */
.form-group input,
.form-group select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 14px 16px;
    border-radius: 8px;
    border: 2px solid #e1e5e9;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

/* Touch-friendly buttons */
.btn-complete-order {
    min-height: 50px;
    font-size: 18px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.btn-complete-order::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-complete-order:hover::before {
    left: 100%;
}

/* Enhanced mobile form layouts */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: #495057;
}

/* Improved checkbox and radio styling */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: #007bff;
}

.delivery-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #007bff;
}

/* Enhanced delivery options */
.delivery-label {
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e1e5e9;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
}

.delivery-label:hover {
    border-color: #007bff;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
}

.delivery-option input[type="radio"]:checked + .delivery-label {
    border-color: #007bff;
    background: #e3f2fd;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .checkout-container {
        padding: 15px;
    }
    
    .checkout-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .checkout-right {
        position: static;
        order: -1;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .delivery-options {
        flex-direction: column;
        gap: 12px;
    }
    
    .delivery-label {
        padding: 16px;
        font-size: 16px;
    }
    
    .checkout-section {
        padding: 20px;
        border-radius: 12px;
    }
    
    .checkout-section h2 {
        font-size: 20px;
        margin-bottom: 16px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group input,
    .form-group select {
        padding: 16px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    .btn-complete-order {
        padding: 18px;
        font-size: 18px;
        border-radius: 12px;
        width: 100%;
    }
    
    .checkout-footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
    
    .order-summary {
        padding: 20px;
        border-radius: 12px;
        position: sticky;
        top: 20px;
    }
    
    .order-item {
        padding: 12px 0;
    }
    
    .item-image {
        width: 50px;
        height: 50px;
    }
    
    .item-details h4 {
        font-size: 14px;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .checkout-container {
        padding: 10px;
    }
    
    .checkout-section {
        padding: 16px;
    }
    
    .order-summary {
        padding: 16px;
    }
}
