/* ==========================================================================
   SIMPLE AI CHECKOUT - APPLE INSPIRED DESIGN v3.0
   Apple Design Language: Clean whites, soft blues, smooth animations
   Primary: #007AFF (Apple Blue), Secondary: #F5F5F7 (Apple Gray)
   ========================================================================== */

/* --- 1. GLOBAL LAYOUT OVERRIDES --- */
#columns {
    background: #F5F5F7; /* Apple's signature light gray background */
    padding-top: 40px;
    padding-bottom: 80px;
}

.simpleaicheckout-wrapper {
    max-width: 980px; /* Apple-style wider layout */
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    color: #1D1D1F; /* Apple's near-black text */
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.simpleaicheckout-wrapper * {
    box-sizing: border-box;
}

/* --- 2. PROGRESS BAR --- */
.checkout-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 50px;
    position: relative;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.checkout-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #E5E5EA; /* Apple's subtle border color */
    z-index: 1;
    transform: translateY(-50%);
}

.progress-step {
    position: relative;
    z-index: 2;
    background: #F5F5F7;
    padding: 0 20px;
    color: #8E8E93; /* Apple's muted gray */
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-step.active {
    color: #007AFF; /* Apple Blue */
}

.progress-step.completed {
    color: #1D1D1F;
}

/* --- 3. MAIN CARD CONTAINER --- */
.checkout-card {
    background: #FFFFFF;
    border-radius: 16px; /* Apple's modern border-radius */
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06); /* Soft, diffused shadow */
    padding: 56px; /* Generous Apple-style padding */
    backdrop-filter: blur(20px); /* Glass effect support */
}

/* Mobile Padding Adjustment */
@media (max-width: 767px) {
    .checkout-card {
        padding: 28px;
        border-radius: 12px;
    }
}

h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1D1D1F;
    text-align: center;
    margin-top: 0;
    margin-bottom: 8px;
    border: none;
    text-transform: none;
    letter-spacing: -0.5px; /* Apple's tight heading spacing */
}

.subtitle {
    text-align: center;
    color: #86868B; /* Apple's secondary text color */
    margin-bottom: 48px;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.2px;
}

/* --- 4. FORM SYSTEM (Fixed Alignment) --- */

/* Wrapper for a row of inputs */
.form-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 8px;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Half width column (First Name / Last Name) */
.form-col-half {
    width: 48%;
    max-width: 48%;
    padding: 0 !important;
    flex: none;
}

/* Full width column (Email / Phone) */
.form-col-full {
    width: 100%;
    max-width: 100%;
    padding: 0 !important;
    flex: none;
}

/* Mobile: Stack fields vertically */
@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
    }
    .form-col-half {
        width: 100%;
        max-width: 100%;
        margin-bottom: 0;
    }
}

.form-group {
    margin-bottom: 20px;
    width: 100%;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1D1D1F;
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: -0.1px;
    text-align: left;
}

/* Modern Input Styles - Apple Design */
.form-control,
input[type="text"],
input[type="email"],
input[type="tel"],
select {
    display: block;
    width: 100% !important;
    height: 48px; /* Apple's comfortable input height */
    font-size: 17px; /* Apple's readable font size */
    color: #1D1D1F;
    background-color: #FAFAFA; /* Subtle input background */
    border: 1px solid #E5E5EA; /* Apple's border color */
    border-radius: 10px; /* Modern, not too round */
    box-shadow: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box !important;
    padding: 0 16px;
    font-weight: 400;
    letter-spacing: -0.2px;
}

.form-control:focus,
input:focus,
select:focus {
    border-color: #007AFF; /* Apple Blue focus */
    background-color: #FFFFFF;
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1); /* Soft blue glow */
}

.form-control::placeholder,
input::placeholder,
select::placeholder {
    color: #8E8E93;
}

/* Static form control (plain text display) */
.form-control-static {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 14px 16px;
    font-size: 17px;
    color: #1D1D1F;
    background-color: #F5F5F7;
    border: 1px solid #E5E5EA;
    border-radius: 10px;
    line-height: 20px;
    margin: 0;
}

/* Address row padding adjustments */
.address-row {
    margin-left: -16px;
    margin-right: -16px;
}

.no-padding {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Add padding to form-group inside to match other inputs */
.address-row .form-group {
    padding-left: 16px;
    padding-right: 16px;
}

/* Checkbox Label Styles - Apple Design */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 12px 0;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #007AFF; /* Apple Blue */
    border-radius: 4px;
}

.checkbox-label span {
    font-size: 15px;
    color: #1D1D1F;
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: -0.2px;
}

.checkbox-label:hover span {
    color: #007AFF;
}

/* Country Separator */
.country-separator {
    font-weight: 600;
    color: #8E8E93;
    background-color: #F5F5F7 !important;
    font-size: 11px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 12px 16px;
}

/* Error State - Apple Style */
.alert-danger {
    background-color: #FFF5F5;
    border: 1px solid #FFD3D3;
    color: #C41E3A; /* Apple's red */
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: -0.2px;
}

/* --- 5. DELIVERY GRID SYSTEM --- */

/* Wrapper for each group to ensure visual break */
.carrier-group-section {
    width: 100%;
    margin-bottom: 36px;
    display: block;
}

.group-title {
    display: none; /* Hidden as requested */
}

/* The Grid Container */
.carrier-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: flex-start;
}

/* Individual Item Wrapper (3 Columns) */
.carrier-item {
    flex: 0 0 calc(33.333% - 11px);
    max-width: calc(33.333% - 11px);
}

/* Mobile: 1 Column */
@media (max-width: 767px) {
    .carrier-item {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Radio Logic - Hidden Input */
.carrier-item input[type="radio"],
.radio-card-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* The Carrier Card Visual - STRICT HEIGHT - Apple Design */
.carrier-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;

    height: 300px;

    border: 1px solid #E5E5EA; /* Apple's border */
    border-radius: 14px; /* Modern Apple radius */
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    background: #FFFFFF;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.carrier-card-top {
    display: flex;
}

.carrier-logo-top-title {
    display: block;
}

/* Hover State - Apple Style */
.carrier-item:hover .carrier-card-content,
.radio-card-label:hover .radio-card-content {
    border-color: #C7C7CC;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Selected State - Apple Blue */
.carrier-item input[type="radio"]:checked + .carrier-card-content,
.radio-card-label input[type="radio"]:checked + .radio-card-content {
    border-color: #007AFF;
    background: #F0F8FF; /* Subtle blue tint */
    box-shadow: 0 8px 32px rgba(0, 122, 255, 0.16);
}

/* Carrier Card Details */
.carrier-logo {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.carrier-logo img {
    max-height: 100%;
    max-width: 80%;
    object-fit: contain;
}

.carrier-logo i {
    font-size: 32px;
    color: #C7C7CC;
}

.carrier-name {
    font-size: 16px;
    font-weight: 600;
    color: #1D1D1F;
    margin-bottom: 6px;
    line-height: 1.3;
    flex-shrink: 0;
    letter-spacing: -0.2px;
}

.carrier-delay {
    font-size: 13px;
    color: #86868B;
    margin-bottom: auto;
    overflow: hidden;
    max-height: 80px;
    line-height: 1.4;
}

.carrier-price {
    font-size: 19px;
    font-weight: 700;
    color: #007AFF; /* Apple Blue */
    width: 100%;
    padding-top: 12px;
    flex-shrink: 0;
    letter-spacing: -0.3px;
}

/* --- 6. PAYMENT STEP STYLES --- */
.option-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 28px;
}

.radio-card-label {
    display: block;
    cursor: pointer;
    margin: 0;
    font-weight: 400;
}

.radio-card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border: 1px solid #E5E5EA;
    border-radius: 12px;
    background: #FFFFFF;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.radio-card-label:hover .radio-card-content {
    border-color: #C7C7CC;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.option-title {
    font-size: 17px;
    font-weight: 600;
    color: #1D1D1F;
    display: block;
    letter-spacing: -0.3px;
}

.option-desc {
    font-size: 14px;
    color: #86868B;
    margin-top: 4px;
    display: block;
    line-height: 1.4;
}

/* Summary Table - Apple Design */
.summary-table {
    width: 100%;
    margin-bottom: 40px;
    border-collapse: collapse;
}

.summary-table th {
    text-align: left;
    color: #86868B;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid #E5E5EA;
    padding: 12px 0;
}

.summary-table td {
    padding: 16px 0;
    border-bottom: 1px solid #F5F5F7;
    font-size: 15px;
    color: #1D1D1F;
    font-weight: 400;
    letter-spacing: -0.2px;
}

.summary-table .total-row td {
    border-top: 2px solid #1D1D1F;
    border-bottom: none;
    font-size: 22px;
    font-weight: 700;
    color: #007AFF; /* Apple Blue */
    padding-top: 24px;
    letter-spacing: -0.5px;
}

/* --- 7. BUTTONS & LINKS --- */
.btn-primary {
    background-color: #007AFF !important; /* Apple Blue */
    border: none !important;
    color: #FFFFFF !important;
    padding: 18px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.2px;
    border-radius: 12px; /* Modern Apple radius */
    text-transform: none;
    width: 100%;
    margin-top: 36px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.25);
    text-shadow: none !important;
    height: auto !important;
}

.btn-primary:hover {
    background-color: #0062CC !important;
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 28px;
    color: #8E8E93;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: -0.1px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #007AFF;
}

/* --- Terminal Selection (Venipak, Omniva, DPD) - Apple Style --- */
.terminal-selection {
    width: 100%;
    padding: 0 12px;
}

.terminal-selection .form-group {
    margin-bottom: 4px;
}

.terminal-selection .form-group:last-child {
    margin-bottom: 0;
}

.terminal-selection label {
    font-size: 11px;
    font-weight: 600;
    color: #86868B;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.terminal-selection select {
    width: 100%;
    height: 40px;
    border: 1px solid #E5E5EA;
    border-radius: 8px;
    font-size: 15px;
    background: #FFFFFF;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    padding: 0 12px;
    font-weight: 400;
    letter-spacing: -0.2px;
    color: #1D1D1F;
}

.terminal-selection select:focus {
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    outline: none;
}

.terminal-selection select:hover {
    border-color: #C7C7CC;
}

/* Prevent the carrier card from being clickable when interacting with selects */
.carrier-item .terminal-selection {
    pointer-events: auto;
}

.carrier-item .terminal-selection select {
    pointer-events: auto;
}

/* Carrier-specific styles if needed */
.venipak-terminal-selection,
.omniva-terminal-selection,
.dpd-terminal-selection {
    /* All inherit from .terminal-selection */
}

/* --- FINAL ACTION AREA & SECURE TEXT --- */
.final-action-area {
    width: 100%;
    margin-top: 36px;
}

.secure-text {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: #8E8E93;
    font-weight: 500;
    letter-spacing: -0.1px;
}

.secure-text i {
    margin-right: 6px;
    font-size: 12px;
}
