/**
 * Checkout Modal Styles
 * Sistema de checkout integrado con el carrito flotante
 */

/* Checkout Modal Styles */
.checkout-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 10000;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.checkout-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.checkout-modal-content {
    background: white;
    border-radius: 24px;
    max-width: 600px;
    width: 100%;
    margin: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.checkout-header {
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
    color: white;
    padding: 1.75rem;
    position: relative;
}

.btn-back-checkout {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    display: inline-block;
    backdrop-filter: blur(10px);
}

.btn-back-checkout:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-3px);
}

.checkout-header h2 {
    margin: 0 0 1.5rem 0;
    font-size: 1.75rem;
    font-weight: 800;
}

.checkout-steps {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 0.8;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.125rem;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: white;
    color: #f97316;
    border-color: white;
    transform: scale(1.1);
}

.step.completed .step-number {
    background: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.5);
}

.step-label {
    font-size: 0.875rem;
    font-weight: 700;
}

.checkout-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Accordion Styles */
.accordion-step {
    margin-bottom: 1.25rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.accordion-step.active {
    border-color: #fbbf24;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
    opacity: 1;
}

.accordion-step.completed {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(251, 191, 36, 0.05) 100%);
    opacity: 1;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.75rem;
    cursor: default;
    background: linear-gradient(135deg, #fffbeb 0%, #fef9e7 100%);
    transition: all 0.3s ease;
    user-select: none;
}

.accordion-step.active .accordion-header {
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
}

.accordion-step.completed .accordion-header {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(251, 191, 36, 0.1) 100%);
}

.accordion-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.accordion-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.125rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.accordion-step.completed .accordion-number {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    font-size: 0;
}

.accordion-step.completed .accordion-number::before {
    content: '✓';
    font-size: 1.5rem;
}

.accordion-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
}

.accordion-icon {
    font-size: 1.125rem;
    color: #f97316;
    transition: transform 0.3s ease;
    font-weight: 800;
}

.accordion-step.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 0 2rem 2rem 2rem;
    display: none !important;
    animation: slideDown 0.3s ease;
}

.accordion-step.active .accordion-content {
    display: block !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 2000px;
    }
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.625rem;
    color: #334155;
    font-weight: 700;
    font-size: 0.9375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #f8fafc;
}

.form-group input[type="file"] {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.9375rem;
}

.form-group input[type="file"]::file-selector-button {
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    margin-right: 0.75rem;
    transition: all 0.3s ease;
}

.form-group input[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    transform: translateY(-1px);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #fbbf24;
    background: white;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    padding-right: 3rem;
}

.btn-next-step,
.btn-confirm-order {
    width: 100%;
    padding: 1.125rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.0625rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.35);
}

.btn-confirm-order {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    font-size: 1.125rem;
    padding: 1.25rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-next-step:hover,
.btn-confirm-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(251, 191, 36, 0.45);
}

.btn-confirm-order:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.6);
    transform: translateY(-3px) scale(1.02);
}

.btn-next-step:active,
.btn-confirm-order:active {
    transform: translateY(0);
}

.checkout-step-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-prev-step {
    flex: 1;
    padding: 1rem;
    background: white;
    color: #f97316;
    border: 2px solid #fed7aa;
    border-radius: 14px;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-prev-step:hover {
    border-color: #fbbf24;
    background: #fffbeb;
}

.btn-next-step {
    flex: 2;
    margin-top: 0;
}

.payment-methods {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.payment-option {
    cursor: pointer;
}

.payment-option input[type="radio"] {
    display: none;
}

.payment-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    transition: all 0.3s ease;
}

.payment-option input:checked + .payment-card {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.25);
}

.payment-card:hover {
    border-color: #fbbf24;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.15);
}

.payment-icon {
    font-size: 2.5rem;
    min-width: 60px;
    text-align: center;
}

.payment-info strong {
    display: block;
    font-size: 1.125rem;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.payment-info p {
    color: #64748b;
    font-size: 0.9375rem;
    margin: 0;
}

.order-summary-checkout {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 2rem;
    border: 2px solid #fde68a;
}

.order-summary-checkout h4 {
    margin: 0 0 1.25rem 0;
    font-size: 1.125rem;
    font-weight: 800;
    color: #0f172a;
}

.summary-row-checkout {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.875rem;
    font-size: 1rem;
    color: #64748b;
}

.summary-row-checkout span:last-child {
    font-weight: 700;
    color: #0f172a;
}

.summary-total-checkout {
    display: flex;
    justify-content: space-between;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 2px solid #fde68a;
    font-size: 1.125rem;
    font-weight: 800;
}

.summary-total-checkout span:last-child {
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.625rem;
}

/* Order Confirmation Modal */
.order-confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    padding: 1rem;
    overflow-y: auto;
}

.order-confirmation-content {
    background: white;
    border-radius: 24px;
    padding: 2rem 1.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    animation: slideUp 0.4s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.confirmation-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    margin: 0 auto 1.5rem;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.order-confirmation-content h2 {
    font-size: 1.5rem;
    color: #0f172a;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.order-number {
    font-size: 1rem;
    color: #06b6d4;
    font-weight: 800;
    margin-bottom: 0.75rem;
    word-break: break-all;
}

.delivery-time {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    padding: 0.875rem;
    border-radius: 12px;
    margin: 1rem 0;
    font-size: 1rem;
    line-height: 1.4;
}

.confirmation-details {
    text-align: left;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 12px;
    margin: 1rem 0;
}

.confirmation-details h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: #0f172a;
    font-size: 1rem;
}

.confirmation-details p {
    margin: 0.375rem 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.4;
}

.btn-close-confirmation {
    width: 100%;
    padding: 1.25rem;
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.125rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
}

.btn-close-confirmation:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(6, 182, 212, 0.4);
}

/* Botón GPS en checkout */
.btn-detect-gps-checkout {
    min-width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-detect-gps-checkout:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-detect-gps-checkout:active {
    transform: scale(0.95);
}

.btn-detect-gps-checkout:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Google Maps Autocomplete Dropdown */
.pac-container {
    background: white;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
    margin-top: 4px !important;
    border: 2px solid #fbbf24 !important;
    font-family: inherit !important;
    z-index: 10002 !important;
}

.pac-item {
    padding: 1rem 1.25rem !important;
    border-top: 1px solid #f1f5f9 !important;
    cursor: pointer !important;
    font-size: 0.9375rem !important;
}

.pac-item:hover {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
}

.pac-item:first-child {
    border-top: none !important;
}

.pac-icon {
    margin-top: 0 !important;
}

.pac-item-query {
    font-weight: 700 !important;
    color: #0f172a !important;
}

.pac-matched {
    font-weight: 800 !important;
    color: #f97316 !important;
}

/* Responsive */
@media (max-width: 640px) {
    .checkout-modal.active {
        padding: 0;
        align-items: stretch;
    }
    
    .checkout-modal-content {
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
    
    .checkout-header {
        padding: 1.5rem;
    }
    
    .checkout-header h2 {
        font-size: 1.375rem;
    }
    
    .checkout-body {
        padding: 1rem;
    }
    
    .checkout-steps {
        gap: 0.5rem;
    }
    
    .step-number {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .step-label {
        font-size: 0.75rem;
    }
    
    .payment-icon {
        font-size: 2rem;
        min-width: 50px;
    }
    
    .accordion-header {
        padding: 1.25rem 1.5rem;
    }
    
    .accordion-left {
        gap: 1rem;
    }
    
    .accordion-number {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }
    
    .accordion-header h3 {
        font-size: 1.0625rem;
    }
    
    .accordion-content {
        padding: 0 1.5rem 1.5rem 1.5rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }
    
    .payment-card {
        padding: 1rem 1.25rem;
    }
    
    .payment-info strong {
        font-size: 1rem;
    }
    
    .btn-next-step,
    .btn-confirm-order,
    .btn-prev-step {
        padding: 1rem;
        font-size: 1rem;
    }
    
    /* Order Confirmation Modal Responsive */
    .order-confirmation-content {
        width: 95%;
        max-height: 85vh;
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }
    
    .confirmation-icon {
        width: 60px;
        height: 60px;
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .order-confirmation-content h2 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .order-number {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
    
    .delivery-time {
        padding: 0.75rem;
        margin: 0.75rem 0;
        font-size: 0.9rem;
    }
    
    .confirmation-details {
        padding: 0.875rem;
        margin: 0.75rem 0;
    }
    
    .confirmation-details h4 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .confirmation-details p {
        font-size: 0.85rem;
        margin: 0.25rem 0;
    }
    
    .btn-close-confirmation {
        padding: 1rem;
        font-size: 1rem;
        margin-top: 1rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .order-confirmation-overlay {
        padding: 0.5rem;
    }
    
    .order-confirmation-content {
        width: 98%;
        max-height: 92vh;
        padding: 1.25rem 0.875rem;
        border-radius: 12px;
    }
    
    .confirmation-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .order-confirmation-content h2 {
        font-size: 1.125rem;
    }
    
    .order-number {
        font-size: 0.8rem;
    }
    
    .delivery-time {
        font-size: 0.875rem;
        padding: 0.625rem;
    }
    
    .confirmation-details {
        padding: 0.75rem;
    }
    
    .confirmation-details h4 {
        font-size: 0.875rem;
    }
    
    .confirmation-details p {
        font-size: 0.8rem;
    }
    
    .btn-close-confirmation {
        padding: 0.875rem;
        font-size: 0.9rem;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

