/**
 * Smart Order CSS - Minimalist Atelier Edition (v5.4.0)
 * Path: /assets/css/03-components/smart-order.css
 * 
 * Clean, Sophisticated, Editorial Floral Checkout:
 * - Zero emoji clutter, zero tacky decorative icons
 * - Clean typographic hierarchy & generous white space
 * - Minimalist text pill chips
 * - Crisp form controls with subtle focus states
 * - Elegant receipt cost breakdown
 */

/* ============================================================================
   ROOT VARIABLES
   ============================================================================ */
#smart-order-root {
    --so-brand: var(--st-brand-700, #BE0038);
    --so-brand-hover: var(--st-brand-800, #9F1239);
    --so-brand-subtle: #FFF5F6;

    --so-bg: #FFFFFF;
    --so-canvas: #F9FAFB;
    --so-surface-card: #FFFFFF;
    --so-border: #E5E7EB;
    --so-border-subtle: #F3F4F6;

    --so-text-primary: #111827;
    --so-text-secondary: #4B5563;
    --so-text-muted: #6B7280;
    --so-text-subtle: #9CA3AF;

    --so-whatsapp: #25D366;
    --so-whatsapp-hover: #1FB855;

    --so-radius: 8px;
    --so-drawer-width: 440px;
    --so-z-index: 99999;

    font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

#smart-order-root * {
    box-sizing: border-box;
}

/* ============================================================================
   BACKDROP OVERLAY
   ============================================================================ */
.so-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(17, 24, 39, 0.5);
    z-index: var(--so-z-index);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.so-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ============================================================================
   DRAWER CONTAINER
   ============================================================================ */
.so-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: var(--so-drawer-width);
    height: 100%;
    background: var(--so-canvas);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    z-index: calc(var(--so-z-index) + 1);
    color: var(--so-text-secondary);
}

.so-overlay.open .so-drawer {
    right: 0;
}

/* ============================================================================
   HEADER (Clean Minimalist)
   ============================================================================ */
.so-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--so-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--so-bg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.so-header-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.so-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    color: var(--so-text-primary);
    letter-spacing: -0.2px;
}

.so-subtitle {
    font-size: 12px;
    color: var(--so-text-muted);
    margin: 0;
}

.so-close {
    background: transparent;
    border: 1px solid var(--so-border);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--so-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}

.so-close:hover {
    background: var(--so-border-subtle);
    color: var(--so-text-primary);
    border-color: var(--so-text-subtle);
}

/* ============================================================================
   BODY & SCROLLBAR
   ============================================================================ */
.so-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--so-canvas);
    scrollbar-width: thin;
    scrollbar-color: var(--so-border) transparent;
}

.so-body::-webkit-scrollbar {
    width: 5px;
}

.so-body::-webkit-scrollbar-thumb {
    background-color: var(--so-border);
    border-radius: 3px;
}

/* ============================================================================
   PRODUCT CARD (Minimalist)
   ============================================================================ */
.so-product-card {
    background: var(--so-bg);
    padding: 14px;
    border-radius: var(--so-radius);
    margin-bottom: 20px;
    display: flex;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--so-border);
}

.so-prod-thumb-wrap {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--so-border-subtle);
    border: 1px solid var(--so-border);
}

.so-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.so-product-info {
    flex: 1;
    min-width: 0;
}

.so-prod-cat {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--so-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.so-prod-name {
    margin: 0 0 5px 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--so-text-primary);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.so-prod-price {
    font-size: 15px;
    color: var(--so-brand);
    font-weight: 700;
}

/* ============================================================================
   SECTION CARDS & TYPOGRAPHY
   ============================================================================ */
.so-section-card {
    background: var(--so-bg);
    border: 1px solid var(--so-border);
    border-radius: var(--so-radius);
    padding: 16px;
    margin-bottom: 16px;
}

.so-section-header {
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--so-border-subtle);
}

.so-section-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--so-text-primary);
    margin: 0;
    letter-spacing: -0.1px;
}

.so-section-sub {
    font-size: 11.5px;
    color: var(--so-text-muted);
    margin: 2px 0 0 0;
}

/* ============================================================================
   FORM FIELDS (Clean, No Input Icons)
   ============================================================================ */
.so-form-group {
    margin-bottom: 13px;
    position: relative;
}

.so-form-group:last-child {
    margin-bottom: 0;
}

.so-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--so-text-primary);
    margin-bottom: 6px;
}

.so-required {
    color: var(--so-brand);
    margin-left: 2px;
}

.so-optional {
    font-size: 11px;
    font-weight: normal;
    color: var(--so-text-muted);
}

.so-input,
.so-textarea,
.so-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--so-border);
    border-radius: 6px;
    font-size: 13.5px;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: var(--so-bg);
    color: var(--so-text-primary);
}

.so-input::placeholder,
.so-textarea::placeholder {
    color: #9CA3AF;
    font-size: 13px;
}

.so-input:focus,
.so-textarea:focus,
.so-select:focus {
    outline: none;
    border-color: var(--so-brand);
    box-shadow: 0 0 0 3px rgba(190, 0, 56, 0.08);
}

.so-textarea {
    resize: vertical;
    min-height: 72px;
    line-height: 1.45;
}

.so-field-helper {
    font-size: 11px;
    color: var(--so-text-muted);
    margin-top: 4px;
    line-height: 1.35;
}

/* ============================================================================
   INLINE VALIDATION (Clean Text Only)
   ============================================================================ */
.so-error-msg {
    display: none;
    color: #DC2626;
    font-size: 11.5px;
    font-weight: 500;
    margin-top: 4px;
}

.so-input-error,
.so-input:user-invalid,
.so-textarea:user-invalid {
    border-color: #EF4444 !important;
    background-color: #FEF2F2 !important;
}

.so-input-error ~ .so-error-msg,
.so-input:user-invalid ~ .so-error-msg,
.so-textarea:user-invalid ~ .so-error-msg {
    display: block;
}

@keyframes soShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
}

.so-field-shake {
    animation: soShake 0.3s ease-in-out;
}

/* ============================================================================
   MINIMALIST PILL CHIPS (Text-Only, No Emojis)
   ============================================================================ */
.so-chips-wrap {
    margin-bottom: 12px;
}

.so-chips-title {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--so-text-muted);
    margin-bottom: 6px;
}

.so-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.so-chip {
    background: var(--so-bg);
    border: 1px solid var(--so-border);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--so-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.so-chip:hover {
    background: var(--so-border-subtle);
    border-color: #CBD5E1;
    color: var(--so-text-primary);
}

.so-chip.active {
    background: #111827;
    border-color: #111827;
    color: #FFFFFF;
    font-weight: 600;
}

/* ============================================================================
   DELIVERY METHODS (Minimalist Selection Cards)
   ============================================================================ */
.so-delivery-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.so-delivery-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid var(--so-border);
    border-radius: 6px;
    background: var(--so-bg);
    cursor: pointer;
    transition: all 0.15s ease;
}

.so-delivery-card:hover {
    border-color: #CBD5E1;
    background: #FAFAFA;
}

.so-delivery-card.active,
.so-delivery-card:has(input:checked) {
    border-color: var(--so-brand);
    background: var(--so-brand-subtle);
}

.so-del-card-left {
    flex: 1;
}

.so-del-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--so-text-primary);
}

.so-del-desc {
    font-size: 11.5px;
    color: var(--so-text-muted);
    margin-top: 2px;
}

.so-del-radio-wrap {
    margin-left: 12px;
    display: flex;
    align-items: center;
}

.so-delivery-radio {
    accent-color: var(--so-brand);
    width: 17px;
    height: 17px;
    cursor: pointer;
}

/* ============================================================================
   COST BREAKDOWN (Clean Receipt Style)
   ============================================================================ */
.so-cost-box {
    background: var(--so-bg);
    border: 1px solid var(--so-border);
    border-radius: var(--so-radius);
    padding: 14px 16px;
    margin: 16px 0;
}

.so-cost-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: var(--so-text-primary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--so-border-subtle);
}

.so-cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    color: var(--so-text-secondary);
    margin-bottom: 6px;
}

.so-cost-row strong {
    font-weight: 600;
    color: var(--so-text-primary);
}

.so-badge-ongkir {
    color: #0369A1;
    font-size: 11.5px;
    font-weight: 600;
}

.so-cost-row.so-cost-total {
    border-top: 1px dashed var(--so-border);
    padding-top: 8px;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--so-brand);
}

.so-cost-row.so-cost-dp {
    background: var(--so-brand-subtle);
    border-radius: 4px;
    padding: 6px 10px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--so-brand);
    font-weight: 600;
}

.so-cost-note {
    color: var(--so-text-muted);
    font-size: 11px;
    margin-top: 8px;
    display: block;
    line-height: 1.4;
}

/* ============================================================================
   PAYMENT BOX
   ============================================================================ */
.so-payment-box {
    background: #FFF9FA;
    border: 1px solid #FED7DC;
    border-radius: var(--so-radius);
    padding: 14px 16px;
    margin: 16px 0;
}

.so-payment-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--so-brand);
    margin-bottom: 4px;
}

.so-payment-policy {
    font-size: 11.5px;
    color: #881337;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.so-bank-card {
    background: #FFFFFF;
    border: 1px solid var(--so-border);
    border-radius: 6px;
    padding: 9px 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.so-btn-copy {
    background: var(--so-border-subtle);
    border: 1px solid var(--so-border);
    border-radius: 4px;
    padding: 5px 9px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--so-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.so-btn-copy:hover {
    background: #E5E7EB;
    color: var(--so-text-primary);
}

.so-btn-copy.copied {
    background: #ECFDF5;
    border-color: #A7F3D0;
    color: #065F46;
}

/* ============================================================================
   STICKY FOOTER (Minimalist Clean)
   ============================================================================ */
.so-footer {
    padding: 14px 20px 16px;
    border-top: 1px solid var(--so-border);
    background: var(--so-bg);
    position: sticky;
    bottom: 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
    z-index: 10;
}

.so-submit-btn {
    width: 100%;
    padding: 13px 20px;
    background: var(--so-whatsapp);
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.25);
    text-decoration: none;
}

.so-submit-btn:hover {
    background: var(--so-whatsapp-hover);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.so-footer-note {
    font-size: 11px;
    color: var(--so-text-muted);
    text-align: center;
    margin: 8px 0 0 0;
    line-height: 1.35;
}

/* ============================================================================
   RESPONSIVE (MOBILE)
   ============================================================================ */
@media (max-width: 480px) {
    .so-drawer {
        max-width: 100%;
    }

    .so-header {
        padding: 14px 16px;
    }

    .so-body {
        padding: 14px 16px;
    }

    .so-footer {
        padding: 12px 16px 14px;
    }

    .so-title {
        font-size: 16px;
    }

    .so-chip {
        padding: 4px 10px;
        font-size: 11.5px;
    }
}

/* Prevent auto zoom on iOS Safari */
@media (max-width: 768px) {
    .so-input,
    .so-textarea,
    .so-select {
        font-size: 16px !important;
    }
}
