/**
 * TSTI Delivery Checker - Styles
 * 
 * Brand Colors: #580c31 (Primary), #ff544e (Accent)
 * 
 * @package TSTI_Delivery_Checker
 */

/* ============================================
   DELIVERY CHECKER SECTION
   ============================================ */

.tsti-delivery-checker-wrapper {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffe5e4 0%, #fff 100%);
    border: 2px solid #ff544e;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(88, 12, 49, 0.08);
    clear: both;
    width: 100%;
    display: block;
}

.tsti-delivery-checker-wrapper .variations_form .tsti-delivery-checker-wrapper {
    margin-top: 1.5rem;
    clear: both;
    float: none;
    display: block;
}

.tsti-delivery-checker-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #580c31;
}

.tsti-delivery-checker-header svg {
    color: #580c31;
    flex-shrink: 0;
}

.tsti-delivery-checker-input-group {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.tsti-pincode-input {
    flex: 1;
    height: 48px;
    padding: 0 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 1rem;
    color: #111827;
    transition: all 0.3s ease;
    max-width: 100%;
}

.tsti-pincode-input:hover {
    border-color: #cbd5e1;
}

.tsti-pincode-input:focus {
    outline: none;
    border-color: #580c31;
    box-shadow: 0 0 0 3px rgba(88, 12, 49, 0.1);
}

.tsti-pincode-input::placeholder {
    color: #9ca3af;
}

.tsti-check-delivery-btn {
    flex: 0 0 auto;
    height: 48px;
    padding: 0 1.5rem;
    background: linear-gradient(135deg, #580c31 0%, #3a0820 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.tsti-check-delivery-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(88, 12, 49, 0.3);
    background: linear-gradient(135deg, #6b0f3d 0%, #580c31 100%);
}

.tsti-check-delivery-btn:active {
    transform: translateY(0);
}

.tsti-check-delivery-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.tsti-btn-loader svg {
    animation: tsti-spin 1s linear infinite;
}

@keyframes tsti-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.tsti-delivery-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 0.875rem;
}

.tsti-delivery-error svg {
    flex-shrink: 0;
}

/* Desktop specific */
@media (min-width: 769px) {
    .tsti-delivery-checker-wrapper {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .tsti-delivery-checker-wrapper .variations_form + .tsti-delivery-checker-wrapper,
    .tsti-delivery-checker-wrapper .variations_form .tsti-delivery-checker-wrapper {
        clear: both;
        float: none;
        width: 100%;
        display: block;
    }
    
    .tsti-delivery-checker-input-group {
        max-width: 500px;
    }
    
    .tsti-pincode-input {
        flex: 1;
        min-width: 0;
    }
    
    .tsti-check-delivery-btn {
        min-width: 140px;
    }
}

/* ============================================
   DELIVERY MODAL
   ============================================ */

.tsti-delivery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.tsti-delivery-modal.active {
    display: flex;
}

.tsti-delivery-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: tsti-fade-in 0.3s ease;
}

.tsti-delivery-modal-content {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: tsti-slide-up 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tsti-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes tsti-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tsti-delivery-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.tsti-delivery-modal-close:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
}

.tsti-delivery-modal-close svg {
    color: #6b7280;
}

/* Modal Header */
.tsti-delivery-modal-header {
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    border-bottom: 2px solid #f3f4f6;
}

.tsti-delivery-modal-header svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: #10b981;
    stroke-width: 2.5;
}

.tsti-delivery-modal-header h3 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.tsti-delivery-pincode {
    margin: 0;
    font-size: 0.9375rem;
    color: #6b7280;
}

.tsti-delivery-pincode strong {
    color: #580c31;
    font-weight: 600;
}

/* Delivery Options */
.tsti-delivery-options {
    padding: 1.5rem 2rem;
}

.tsti-delivery-options h4 {
    margin: 0 0 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #580c31;
}

.tsti-delivery-option {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.tsti-delivery-option:hover {
    border-color: #ff544e;
    background: #fff;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(88, 12, 49, 0.1);
}

.tsti-delivery-option:last-child {
    margin-bottom: 0;
}

.tsti-option-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 10px;
    font-size: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tsti-option-details h5 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.tsti-option-time {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: #580c31;
}

.tsti-option-method {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Discreet Packaging */
.tsti-delivery-discreet {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #ffe5e4 0%, #fff 100%);
    border-top: 2px solid #f3f4f6;
}

.tsti-delivery-discreet svg {
    flex-shrink: 0;
    color: #580c31;
}

.tsti-discreet-text strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #580c31;
}

.tsti-discreet-text p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .tsti-delivery-checker-wrapper {
        padding: 1.25rem;
    }
    
    .tsti-delivery-checker-input-group {
        flex-direction: column;
    }
    
    .tsti-check-delivery-btn {
        width: 100%;
        justify-content: center;
    }
    
    .tsti-delivery-modal-content {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }
    
    .tsti-delivery-modal-header,
    .tsti-delivery-options,
    .tsti-delivery-discreet {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (max-width: 480px) {
    .tsti-delivery-checker-wrapper {
        padding: 1rem;
    }
    
    .tsti-delivery-checker-header {
        font-size: 0.9375rem;
    }
    
    .tsti-pincode-input,
    .tsti-check-delivery-btn {
        height: 44px;
        font-size: 0.875rem;
    }
    
    .tsti-delivery-modal-header,
    .tsti-delivery-options,
    .tsti-delivery-discreet {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    
    .tsti-delivery-modal-header h3 {
        font-size: 1.25rem;
    }
    
    .tsti-delivery-option {
        padding: 1rem;
    }
    
    .tsti-option-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}
