/* Modal Styles - Modern */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-lg {
    max-width: 800px;
}

.modal-xl {
    max-width: 1200px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--gray-100);
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

.modal-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    background: var(--gray-50);
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--gray-500);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-full);
    transition: all var(--transition);
}

.modal-close:hover {
    background-color: var(--gray-100);
    color: var(--gray-700);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.75rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--gray-100);
    position: sticky;
    bottom: 0;
    background: white;
    border-radius: 0 0 var(--border-radius-xl) var(--border-radius-xl);
}

/* Location Modal Items */
.locations-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    max-height: 225px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.location-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem;
    background: var(--gray-50);
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
}

.location-item:hover {
    background: white;
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateX(2px);
}

.location-item.selected {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-color: var(--primary-color);
}

.location-item-icon {
    width: 24px;
    height: 24px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.625rem;
    flex-shrink: 0;
}

.location-item-image {
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--gray-100);
}

.location-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.location-item:hover .location-item-image img {
    transform: scale(1.05);
}

.location-item-details {
    flex: 1;
}

.location-item-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.125rem;
}

.location-item-address {
    font-size: 0.5625rem;
    color: var(--gray-500);
    line-height: 1.3;
}

.location-item-arrow {
    color: var(--gray-300);
    transition: all var(--transition);
}

.location-item:hover .location-item-arrow {
    color: var(--primary-color);
    transform: translateX(2px);
}

/* =============================================
   CHECKOUT MODAL STYLES
   ============================================= */

.checkout-body {
    padding: 0;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 0;
}

@media (max-width: 968px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
}

.checkout-form {
    padding: 1.5rem 2rem;
    max-height: 80vh;
    overflow-y: auto;
}

.checkout-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.checkout-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.checkout-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

/* Order Type Selection */
.order-type-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.order-type-option {
    display: flex;
    cursor: pointer;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    transition: all var(--transition);
    background: white;
}

.order-type-option:hover {
    border-color: var(--primary-light);
    background: var(--gray-50);
}

.order-type-option.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.03) 0%, rgba(59, 130, 246, 0.06) 100%);
}

.order-type-option input {
    display: none;
}

.order-type-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    text-align: center;
}

.order-type-icon {
    font-size: 1.5rem;
}

.order-type-label {
    font-weight: 600;
    color: var(--gray-900);
}

.order-type-desc {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Pickup Location Card */
.pickup-location-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius-lg);
}

.pickup-location-info h5 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: var(--gray-900);
}

.pickup-location-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.4;
}

/* Saved Addresses */
.saved-addresses-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.saved-address-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all var(--transition);
}

.saved-address-option:hover {
    background: white;
    border-color: var(--gray-200);
}

.saved-address-option.selected {
    background: white;
    border-color: var(--primary-color);
}

.saved-address-option input {
    margin-top: 0.25rem;
}

.saved-address-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.saved-address-line {
    font-weight: 500;
    color: var(--gray-900);
}

.saved-address-city {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.saved-address-default {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 0.25rem;
}

/* New Address Form */
.new-address-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

/* Tip Options */
.tip-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tip-option {
    flex: 1;
    min-width: 60px;
    padding: 0.625rem 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    background: white;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-700);
    transition: all var(--transition);
    text-align: center;
}

.tip-option:hover {
    border-color: var(--primary-light);
    background: var(--gray-50);
}

.tip-option.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.custom-tip-input {
    margin-top: 0.75rem;
}

.custom-tip-input input {
    max-width: 150px;
}

/* Payment Options */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all var(--transition);
}

.payment-option:hover {
    border-color: var(--primary-light);
    background: var(--gray-50);
}

.payment-option.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.03) 0%, rgba(59, 130, 246, 0.06) 100%);
}

.payment-option input {
    display: none;
}

.payment-option-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.payment-icon {
    font-size: 1.25rem;
}

.payment-label {
    font-weight: 500;
    color: var(--gray-900);
}

/* Stripe Card Element */
.card-payment-form {
    margin-top: 1rem;
}

.stripe-card-element {
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    background: white;
    min-height: 44px;
}

.card-errors {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    min-height: 1.25rem;
}

/* Checkout Summary (Right Column) */
.checkout-summary {
    background: var(--gray-50);
    border-left: 1px solid var(--gray-100);
    padding: 1.5rem;
    position: sticky;
    top: 0;
    max-height: 80vh;
    overflow-y: auto;
}

@media (max-width: 968px) {
    .checkout-summary {
        border-left: none;
        border-top: 1px solid var(--gray-100);
        position: relative;
        max-height: none;
    }
}

.checkout-summary-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.checkout-summary-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

/* Checkout Items List */
.checkout-items {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding-right: 0.5rem;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.checkout-item-info {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.checkout-item-qty {
    font-weight: 600;
    color: var(--primary-color);
}

.checkout-item-name {
    font-weight: 500;
    color: var(--gray-900);
}

.checkout-item-size {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.checkout-item-price {
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
}

.checkout-item-modifiers {
    font-size: 0.75rem;
    color: var(--gray-500);
    padding-left: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Checkout Totals */
.checkout-totals {
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.checkout-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    font-size: 0.9375rem;
    color: var(--gray-700);
}

.checkout-grand-total {
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--gray-200);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
}

.checkout-grand-total span:last-child {
    color: var(--primary-color);
}

/* Place Order Button */
#placeOrderBtn {
    margin-top: 1.25rem;
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
}

.checkout-secure-note {
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.75rem;
}

/* =============================================
   SIZE CUSTOMIZATION MODAL STYLES
   ============================================= */

.size-modal-product {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--gray-100);
}

.size-modal-image {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-lg);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    overflow: hidden;
    flex-shrink: 0;
}

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

.size-modal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.size-modal-info h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.375rem 0;
}

.size-modal-info p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0;
    line-height: 1.4;
}

.size-selection-container {
    margin-bottom: 1.25rem;
}

.size-selection-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.75rem 0;
}

.size-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.size-option {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    background: white;
}

.size-option:hover {
    border-color: var(--primary-light);
    background: var(--gray-50);
}

.size-option.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.03) 0%, rgba(59, 130, 246, 0.06) 100%);
}

.size-option input {
    display: none;
}

.size-option-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.size-name {
    font-weight: 500;
    color: var(--gray-900);
    font-size: 0.9375rem;
}

.size-price {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9375rem;
}

/* Quantity Selection */
.quantity-selection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius-lg);
}

.quantity-label {
    font-weight: 500;
    color: var(--gray-700);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    background: white;
    cursor: pointer;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.qty-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--gray-50);
}

.qty-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    min-width: 2rem;
    text-align: center;
}

/* Size Modal Footer */
.size-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.size-modal-price {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.size-modal-price .price-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.size-modal-price .price-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

#sizeModalAddBtn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}