/* ============================
   Delivery Panel Styles
   Separate panel for delivery info in food store
   ============================ */

/* Delivery Panel Overlay */
.delivery-panel-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1055;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 0 6px;
    pointer-events: none;
}

.delivery-panel-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Delivery Panel (Bottom Sheet) */
.delivery-full-panel {
    max-width: 660px;
    width: 100%;
    max-height: 95dvh;
    min-height: 400px;
    background: var(--card-bg);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.3s ease;
    transform: translateY(100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.delivery-panel-overlay.active .delivery-full-panel {
    transform: translateY(0);
}

.delivery-full-panel.dragging {
    transition: none !important;
}

/* Panel Content Container */
.delivery-panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Panel Header */
.delivery-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.25rem 0.6rem;
    background: var(--card-bg);
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
    position: relative;
    border-bottom: 3px solid;
    border-image: linear-gradient(45deg, #25D366 0%, #128C7E 50%, #25D366 100%);
    border-image-slice: 1;
    cursor: grab;
    user-select: none;
}

.delivery-panel-header:active {
    cursor: grabbing;
}

/* Handle bar indicator */
.delivery-panel-header::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
}

/* Panel Title */
.delivery-panel-title {
    color: var(--text-color);
    font-weight: 600;
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.delivery-panel-title i {
    color: #25D366;
}

/* Back button */
.delivery-panel-back {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.delivery-panel-back:hover {
    background-color: var(--border-color);
}

/* Close button */
.delivery-panel-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.delivery-panel-close:hover {
    background-color: var(--border-color);
}

/* Step Indicators */
.delivery-steps-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    gap: 0.5rem;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step-item.active {
    opacity: 1;
}

.step-item.completed {
    opacity: 1;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.step-item.active .step-number {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.step-item.completed .step-number {
    background: #25D366;
    color: #fff;
}

.step-item.completed .step-number::after {
    content: '✓';
    font-size: 0.75rem;
}

.step-item.completed .step-number span {
    display: none;
}

.step-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.step-item.active .step-label {
    color: var(--text-color);
    font-weight: 600;
}

.step-item.completed .step-label {
    color: #25D366;
}

.step-divider {
    width: 40px;
    height: 2px;
    background: var(--border-color);
    border-radius: 1px;
    transition: background 0.3s ease;
}

.step-divider.active {
    background: linear-gradient(90deg, #25D366, #128C7E);
}

/* Delivery Steps Content */
.delivery-step {
    animation: stepFadeIn 0.3s ease;
}

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

/* Next Step Button */
.btn-next-step {
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-next-step:hover {
    background: linear-gradient(135deg, #20c05c, #0f7a6e);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.btn-next-step:active {
    transform: translateY(0);
}

/* Panel Body */
.delivery-panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-color);
}

/* Order Summary Section in Delivery Panel */
.delivery-order-summary {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.delivery-order-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.08) 0%, rgba(247, 147, 30, 0.04) 100%);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

.delivery-order-summary-header:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.12) 0%, rgba(247, 147, 30, 0.08) 100%);
}

.delivery-order-summary-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}

.delivery-order-summary-title i {
    color: #FF6B35;
}

.delivery-order-summary-badge {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 10px;
}

.delivery-order-summary-toggle {
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.delivery-order-summary-toggle.expanded {
    transform: rotate(180deg);
}

.delivery-order-summary-body {
    padding: 0.75rem 1rem;
    display: none;
}

.delivery-order-summary-body.show {
    display: block;
}

/* Mini cart items in summary */
.delivery-summary-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.delivery-summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.35rem 0.65rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.delivery-summary-item-qty {
    background: #FF6B35;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

.delivery-summary-item-name {
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* Delivery Form Container */
.delivery-form-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Login invitation for faster checkout */
.delivery-login-invitation {
    margin-bottom: 1rem;
}

.delivery-login-invitation .invitation-card {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(37, 211, 102, 0.3);
    background: rgba(37, 211, 102, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.delivery-login-invitation .invitation-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.delivery-login-invitation .invitation-icon {
    color: #25D366;
    font-size: 1rem;
    flex-shrink: 0;
}

.delivery-login-invitation .invitation-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.delivery-login-invitation .invitation-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.2;
}

.delivery-login-invitation .invitation-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.2;
    display: none;
}

.delivery-login-invitation .invitation-btn {
    flex-shrink: 0;
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    white-space: nowrap;
}

/* Desktop: show subtitle */
@media (min-width: 576px) {
    .delivery-login-invitation .invitation-subtitle {
        display: block;
    }
    
    .delivery-login-invitation .invitation-title {
        font-size: 0.85rem;
    }
    
    .delivery-login-invitation .invitation-subtitle {
        font-size: 0.75rem;
    }
}

/* Panel Footer */
.delivery-panel-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
    flex-shrink: 0;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
}

.delivery-footer-content {
    width: 100%;
    max-width: 500px;
}

/* Total display in footer */
.delivery-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    padding: 0.625rem 0.875rem;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.1) 0%, rgba(18, 140, 126, 0.05) 100%);
    border-radius: 10px;
    margin-bottom: 0.625rem;
}

.delivery-total span:last-child {
    color: #25D366;
    font-size: 1.1rem;
}

/* Send Order Button - Color discreto pero que motiva */
.btn-send-order {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    width: 100%;
    color: white;
}

.btn-send-order:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #7b8eef 0%, #8a5db5 100%);
    color: white;
}

.btn-send-order:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Back to Cart Button */
.btn-back-to-cart {
    border-radius: 8px;
    font-size: 0.8rem;
    padding: 0.4rem 0.875rem;
    width: 100%;
    margin-top: 0.5rem;
    color: var(--text-muted);
    border-color: var(--border-color);
}

.btn-back-to-cart:hover {
    color: var(--text-color);
    background: var(--bg-secondary);
}

/* Transition animation between cart and delivery */
.delivery-panel-overlay.transitioning .delivery-full-panel {
    animation: slideUpFromCart 0.3s ease forwards;
}

@keyframes slideUpFromCart {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(0);
    }
}

/* Desktop Responsive */
@media (min-width: 768px) {
    .delivery-full-panel {
        max-width: 700px;
        border-radius: 24px 24px 0 0;
    }
    
    .delivery-form-wrapper {
        max-width: 650px;
    }
    
    .delivery-footer-content {
        max-width: 650px;
    }
    
    .delivery-summary-item-name {
        max-width: 150px;
    }
}

@media (min-width: 1200px) {
    .delivery-full-panel {
        max-width: 800px;
    }
    
    .delivery-form-wrapper {
        max-width: 700px;
    }
    
    .delivery-footer-content {
        max-width: 700px;
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .delivery-summary-items {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .delivery-summary-item {
        flex-shrink: 0;
    }
}

/* Dark Mode Support */
[data-theme="dark"] .delivery-order-summary-header:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15) 0%, rgba(247, 147, 30, 0.1) 100%);
}

[data-theme="dark"] .delivery-summary-item {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .delivery-login-invitation .invitation-card {
    background: rgba(37, 211, 102, 0.1);
    border-color: rgba(37, 211, 102, 0.2);
}

/* ============================
   Centered Pin Mode for Mobile
   Pin stays fixed, map moves
   ============================ */

.delivery-map-wrapper.centered-pin-mode {
    position: relative;
}

.centered-map-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 1000;
    pointer-events: none;
    transition: transform 0.15s ease-out;
}

.centered-map-pin i {
    font-size: 42px;
    color: #dc3545;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}

.centered-map-pin .pin-shadow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 6px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 50%;
    transition: all 0.15s ease-out;
}

/* Visual feedback when dragging map */
.delivery-map-wrapper.map-dragging .centered-map-pin {
    transform: translate(-50%, -115%);
}

.delivery-map-wrapper.map-dragging .centered-map-pin i {
    color: #FF6B35;
}

.delivery-map-wrapper.map-dragging .pin-shadow {
    width: 20px;
    height: 8px;
    opacity: 0.5;
}

/* Helper text for mobile centered pin */
.delivery-map-wrapper.centered-pin-mode::after {
    content: 'Arrastrá el mapa para ubicar tu dirección';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 0.7rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
}

/* Validation Toast Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ============================
   Step 3: Order Confirmation
   ============================ */

/* Order Summary in Confirmation */
.confirmation-order-summary {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.confirmation-summary-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.1) 0%, rgba(18, 140, 126, 0.05) 100%);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-color);
}

.confirmation-summary-header i {
    color: #25D366;
}

.confirmation-items-count {
    margin-left: auto;
    background: #25D366;
    color: white;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

.confirmation-summary-body {
    padding: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
}

/* Confirmation Items List */
.confirmation-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.confirmation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.confirmation-item-image {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.confirmation-item-image-placeholder {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.confirmation-item-image-placeholder i {
    color: var(--text-muted);
    font-size: 1rem;
}

.confirmation-item-details {
    flex: 1;
    min-width: 0;
}

.confirmation-item-name {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.confirmation-item-instructions {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.confirmation-item-qty {
    background: var(--border-color);
    color: var(--text-color);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    flex-shrink: 0;
}

.confirmation-item-price {
    font-weight: 600;
    font-size: 0.85rem;
    color: #25D366;
    flex-shrink: 0;
    min-width: 80px;
    text-align: right;
}

/* Confirmation Details Cards */
.confirmation-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.confirmation-detail-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.confirmation-detail-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.confirmation-detail-header i {
    color: #25D366;
    width: 18px;
    text-align: center;
}

.btn-edit-step {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit-step:hover {
    color: #25D366;
    background: rgba(37, 211, 102, 0.1);
}

.confirmation-detail-body {
    padding: 0.75rem 1rem;
}

.confirmation-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.confirmation-detail-row:last-child {
    margin-bottom: 0;
}

.confirmation-detail-row i {
    color: var(--text-muted);
    width: 16px;
    text-align: center;
    margin-top: 2px;
    flex-shrink: 0;
}

.confirmation-detail-row span {
    color: var(--text-color);
}

/* Mobile responsive for steps */
@media (max-width: 576px) {
    .delivery-steps-indicator {
        padding: 0.6rem 0.75rem;
    }
    
    .step-label {
        font-size: 0.7rem;
    }
    
    .step-number {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
    }
    
    .step-divider {
        width: 20px;
    }
    
    .btn-next-step {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    .confirmation-item-price {
        min-width: 65px;
        font-size: 0.8rem;
    }
    
    .confirmation-item-image,
    .confirmation-item-image-placeholder {
        width: 40px;
        height: 40px;
    }
}

/* ============================
   Order Confirmation Panel
   Panel style for order processing
   ============================ */

/* Order Panel Overlay */
.order-panel-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 0 12px;
    pointer-events: none;
}

.order-panel-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Order Panel */
.order-full-panel {
    max-width: 440px;
    width: 100%;
    max-height: 90dvh;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    transform: scale(0.9) translateY(30px);
    opacity: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.order-panel-overlay.active .order-full-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Panel Content Container */
.order-panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Panel Header */
.order-panel-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem 1.5rem 1rem;
    background: var(--card-bg);
    flex-shrink: 0;
    position: relative;
    border-bottom: 3px solid;
    border-image: linear-gradient(45deg, #25D366 0%, #128C7E 50%, #25D366 100%);
    border-image-slice: 1;
}

/* Panel Title */
.order-panel-title {
    color: var(--text-color);
    font-weight: 600;
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.order-panel-title i {
    color: #25D366;
    font-size: 1.2rem;
}

/* Close button */
.order-panel-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.order-panel-close:hover {
    background-color: var(--border-color);
    color: var(--text-color);
}

/* Panel Body */
.order-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.5rem;
}

/* Order Steps */
.order-step {
    animation: fadeInUp 0.4s ease;
}

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

/* Loading State */
.order-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0;
}

.order-loading-animation {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 1.5rem;
}

.loading-circle {
    position: absolute;
    inset: 0;
    border: 4px solid var(--border-color);
    border-top-color: #25D366;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #25D366;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.95); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

.order-loading-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.order-loading-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.order-loading-progress {
    width: 100%;
    max-width: 200px;
    height: 4px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-animated {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, #25D366, #128C7E);
    border-radius: 4px;
    animation: progressMove 1.5s ease-in-out infinite;
}

@keyframes progressMove {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* Success State */
.order-success-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.order-success-icon {
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.15), rgba(18, 140, 126, 0.1));
    border-radius: 50%;
    margin-bottom: 1.25rem;
    animation: successPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.order-success-icon i {
    font-size: 3rem;
    color: #25D366;
}

.order-success-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #25D366;
    margin-bottom: 0.75rem;
}

.order-hash-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-secondary), var(--card-bg));
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.order-hash-badge i {
    color: #25D366;
}

.order-success-message {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.order-success-message strong {
    color: var(--text-color);
}

.order-warning-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    text-align: left;
    width: 100%;
}

.order-warning-card i {
    color: #ffc107;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.order-warning-card strong {
    display: block;
    color: var(--text-color);
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.order-warning-card span {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Panel Footer */
.order-panel-footer {
    padding: 1rem 1.5rem 1.25rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.order-footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-whatsapp-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp-send:hover {
    background: linear-gradient(135deg, #20c15e, #0f7a6b);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.btn-order-sent {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: #25D366;
    border: 2px solid #25D366;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-order-sent:hover {
    background: rgba(37, 211, 102, 0.1);
}

.order-help-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    margin: 0.5rem 0 0;
}

.order-help-text i {
    color: var(--text-muted);
}

/* Mobile responsive */
@media (max-width: 576px) {
    .order-panel-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .order-full-panel {
        max-width: 100%;
        max-height: 95dvh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
    }
    
    .order-panel-overlay.active .order-full-panel {
        transform: translateY(0);
    }
    
    .order-panel-body {
        padding: 1.5rem 1.25rem;
    }
    
    .order-loading-animation {
        width: 80px;
        height: 80px;
    }
    
    .loading-icon {
        font-size: 1.5rem;
    }
    
    .order-success-icon {
        width: 70px;
        height: 70px;
    }
    
    .order-success-icon i {
        font-size: 2.25rem;
    }
    
    .order-success-title {
        font-size: 1.25rem;
    }
}

/* ============================
   Success Panel (Order Sent)
   ============================ */

/* Success Panel Overlay */
.success-panel-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1065;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 0 12px;
    pointer-events: none;
}

.success-panel-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Success Panel */
.success-full-panel {
    max-width: 420px;
    width: 100%;
    max-height: 90dvh;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    transform: scale(0.9) translateY(30px);
    opacity: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.success-panel-overlay.active .success-full-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Panel Content */
.success-panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Panel Header */
.success-panel-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem 1.5rem 1rem;
    background: var(--card-bg);
    flex-shrink: 0;
    position: relative;
    border-bottom: 3px solid;
    border-image: linear-gradient(45deg, #25D366 0%, #20c997 50%, #25D366 100%);
    border-image-slice: 1;
}

.success-panel-title {
    color: var(--text-color);
    font-weight: 600;
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.success-panel-title i {
    color: #25D366;
    font-size: 1.2rem;
}

.success-panel-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.success-panel-close:hover {
    background-color: var(--border-color);
    color: var(--text-color);
}

/* Panel Body */
.success-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.5rem;
}

/* Success Container */
.success-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Success Icon with Ring Animation */
.success-icon-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 1.5rem;
}

.success-icon-ring {
    position: absolute;
    inset: 0;
    border: 4px solid rgba(37, 211, 102, 0.2);
    border-radius: 50%;
    animation: ringPulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.5; }
}

.success-icon-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: #25D366;
    animation: checkBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s both;
}

@keyframes checkBounce {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    60% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.success-icon-container::before {
    content: '';
    position: absolute;
    inset: 5px;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.15), rgba(32, 201, 151, 0.1));
    border-radius: 50%;
}

.success-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #25D366;
    margin-bottom: 0.75rem;
}

.success-message {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.success-message i {
    color: #25D366;
}

.success-info-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    text-align: left;
    width: 100%;
    margin-bottom: 1rem;
}

.success-info-card i {
    color: var(--text-muted);
    font-size: 1rem;
    flex-shrink: 0;
}

.success-info-card span {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Login Invitation */
.success-login-invitation {
    width: 100%;
    margin-top: 0.5rem;
}

.login-invitation-card {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.08), rgba(32, 201, 151, 0.05));
    border: 1px solid rgba(37, 211, 102, 0.2);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.login-invitation-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #25D366, #20c997);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.login-invitation-content {
    text-align: center;
}

.login-invitation-content strong {
    display: block;
    color: var(--text-color);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.login-invitation-content span {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.btn-login-invitation {
    background: transparent;
    color: #25D366;
    border: 2px solid #25D366;
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-login-invitation:hover {
    background: #25D366;
    color: white;
}

/* Panel Footer */
.success-panel-footer {
    padding: 1rem 1.5rem 1.25rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.btn-success-done {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #25D366, #20c997);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-success-done:hover {
    background: linear-gradient(135deg, #20c15e, #1db989);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* Order ID Card in Success Panel */
.success-order-info {
    margin: 1.5rem 0;
}

.order-id-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    border-radius: 16px;
    padding: 1.25rem;
    text-align: center;
}

.order-id-header {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #6c757d);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.order-id-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: var(--primary, #0d6efd);
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.order-id-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.order-id-actions .btn {
    border-radius: 50px;
    font-size: 0.8125rem;
    padding: 0.375rem 1rem;
}

.order-link-hint {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
    margin-bottom: 0;
}

.success-orders-link {
    margin-top: 1rem;
}

.success-orders-link .btn {
    border-radius: 50px;
}

/* Dark mode */
[data-theme="dark"] .order-id-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border-color: var(--border-color, rgba(255,255,255,0.15));
}

[data-theme="dark"] .order-id-value {
    color: #6ea8fe;
}

/* Success Panel Dark Mode */
[data-theme="dark"] .success-full-panel {
    background: var(--card-bg, #2d2d2d);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .success-panel-header {
    background: var(--card-bg, #2d2d2d);
}

[data-theme="dark"] .success-panel-title {
    color: var(--text-color, #e9ecef);
}

[data-theme="dark"] .success-panel-close {
    color: var(--text-muted, #adb5bd);
}

[data-theme="dark"] .success-panel-close:hover {
    background-color: var(--bg-tertiary, #3d3d3d);
    color: var(--text-color, #e9ecef);
}

[data-theme="dark"] .success-title {
    color: #5dd790;
}

[data-theme="dark"] .success-message {
    color: var(--text-muted, #adb5bd);
}

[data-theme="dark"] .success-info-card {
    background: var(--bg-secondary, #2d2d2d);
    border-color: var(--border-color, #495057);
}

[data-theme="dark"] .success-info-card i,
[data-theme="dark"] .success-info-card span {
    color: var(--text-muted, #adb5bd);
}

[data-theme="dark"] .login-invitation-card {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.1), rgba(32, 201, 151, 0.05));
    border-color: rgba(37, 211, 102, 0.25);
}

[data-theme="dark"] .login-invitation-content strong {
    color: var(--text-color, #e9ecef);
}

[data-theme="dark"] .login-invitation-content span {
    color: var(--text-muted, #adb5bd);
}

[data-theme="dark"] .btn-login-invitation {
    color: #5dd790;
    border-color: #5dd790;
}

[data-theme="dark"] .btn-login-invitation:hover {
    background: #5dd790;
    color: #1a1a1a;
}

[data-theme="dark"] .success-panel-footer {
    background: var(--card-bg, #2d2d2d);
    border-top-color: var(--border-color, #495057);
}

[data-theme="dark"] .order-id-header {
    color: var(--text-muted, #adb5bd);
}

[data-theme="dark"] .order-link-hint {
    color: var(--text-muted, #adb5bd);
}

[data-theme="dark"] .success-icon-ring {
    border-color: rgba(93, 215, 144, 0.3);
}

[data-theme="dark"] .success-icon-container::before {
    background: linear-gradient(135deg, rgba(93, 215, 144, 0.15), rgba(32, 201, 151, 0.1));
}

[data-theme="dark"] .success-icon-check {
    color: #5dd790;
}

[data-theme="dark"] .success-orders-link .btn-outline-primary {
    color: #6ea8fe;
    border-color: #6ea8fe;
}

[data-theme="dark"] .success-orders-link .btn-outline-primary:hover {
    background: #6ea8fe;
    color: #000;
}

[data-theme="dark"] .order-id-actions .btn-outline-primary {
    color: #6ea8fe;
    border-color: #6ea8fe;
}

[data-theme="dark"] .order-id-actions .btn-outline-primary:hover {
    background: #6ea8fe;
    color: #000;
}

[data-theme="dark"] .order-id-actions .btn-outline-secondary {
    color: var(--text-muted, #adb5bd);
    border-color: var(--border-color, #495057);
}

[data-theme="dark"] .order-id-actions .btn-outline-secondary:hover {
    background: var(--bg-tertiary, #3d3d3d);
    color: var(--text-color, #e9ecef);
}

/* Mobile responsive */
@media (max-width: 576px) {
    .success-panel-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .success-full-panel {
        max-width: 100%;
        max-height: 95dvh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
    }
    
    .success-panel-overlay.active .success-full-panel {
        transform: translateY(0);
    }
    
    .success-panel-body {
        padding: 1.5rem 1.25rem;
    }
    
    .success-icon-container {
        width: 80px;
        height: 80px;
    }
    
    .success-icon-check {
        font-size: 2.5rem;
    }
    
    .success-title {
        font-size: 1.25rem;
    }
    
    .login-invitation-card {
        padding: 1rem;
    }
    
    .order-id-value {
        font-size: 1.5rem;
    }
    
    .order-id-actions {
        flex-direction: column;
    }
    
    .order-id-actions .btn {
        width: 100%;
    }
}
