/* ===== ORDER PAGE ===== */

.order-hero {
    background: linear-gradient(135deg, var(--dark) 0%, #3B1A00 100%);
    color: var(--white);
    padding: 4rem 1.5rem 3rem;
    text-align: center;
}

.order-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 0.5rem; }
.order-hero h1 span { color: var(--gold); }
.order-hero p { color: #D1D5DB; margin-bottom: 1rem; }

.order-hero__badges {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.order-hero__badges span {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #D1D5DB;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
}

/* Mobile sticky summary bar */
.mobile-summary-bar {
    display: none;
    position: sticky;
    top: 64px;
    z-index: 90;
    background: var(--dark);
    color: var(--white);
    padding: 0.7rem 1.25rem;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    border-bottom: 2px solid var(--orange);
}

.mobile-summary-bar.show { display: flex; }
.mobile-summary-bar__total { font-weight: 800; color: var(--gold); font-size: 1.1rem; }

/* Layout */
.order-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2.5rem;
    padding: 3.5rem 0 4rem;
    align-items: start;
}

/* Inline summary only shown on mobile */
.order-summary--inline {
    display: none;
    position: static !important;
    top: auto !important;
}

@media (max-width: 860px) {
    .order-layout {
        grid-template-columns: 1fr;
    }
    /* Hide sidebar summary, show inline one */
    .order-layout > .order-summary:not(.order-summary--inline) { display: none; }
    .order-summary--inline { display: block; position: static !important; top: auto !important; }
    .mobile-summary-bar { display: flex; }
    .mobile-summary-bar:not(.show) { display: none; }
}

/* Egg selector */
.egg-selector { margin-bottom: 1.5rem; }

.egg-selector__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.egg-card {
    background: var(--white);
    border: 2px solid #E5E7EB;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.egg-card:hover { border-color: #D1D5DB; }

.egg-card.has-qty {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
    transform: scale(1.005);
}

.egg-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    position: relative;
    overflow: hidden;
}

.egg-card__accent { display: none; }

.egg-card__info { flex: 1; padding-left: 0.5rem; }
.egg-card__name { font-weight: 700; font-size: 1rem; }
.egg-card__desc { font-size: 0.8rem; color: var(--grey); margin-top: 0.15rem; }
.egg-card__price { font-weight: 800; color: var(--orange); font-size: 1.15rem; margin-left: 0.5rem; }

.egg-card__controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
    border-radius: 10px;
    padding: 0.3rem 0.5rem;
}

.qty-control button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: var(--orange);
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.qty-control button:hover { background: var(--orange-dark); }
.qty-control button:active { transform: scale(0.93); }
.qty-control button:disabled { background: #D1D5DB; cursor: not-allowed; }

.qty-control__value {
    min-width: 40px;
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
}

.wrap-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    color: var(--grey);
    cursor: pointer;
    user-select: none;
    padding: 0.4rem 0.75rem;
    background: var(--gold-light);
    border-radius: 6px;
}

.wrap-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--orange);
    cursor: pointer;
}

.stock-label {
    font-size: 0.78rem;
    color: var(--grey);
    margin-left: auto;
}

.stock-label.low { color: #DC2626; font-weight: 600; }

/* Order summary sidebar */
.order-summary {
    position: sticky;
    top: 80px;
}

.order-summary__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gold-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 0.45rem 0;
    font-size: 0.95rem;
    border-bottom: 1px solid #F3F4F6;
}

.summary-line:last-of-type { border-bottom: none; }
.summary-line--total {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--orange);
    padding-top: 0.75rem;
    border-top: 2px solid var(--orange);
    margin-top: 0.5rem;
}

.summary-empty {
    text-align: center;
    color: var(--grey);
    font-size: 0.88rem;
    padding: 1.5rem 0;
    line-height: 1.6;
}

.summary-note {
    font-size: 0.75rem;
    color: var(--grey);
    margin-top: 0.75rem;
    line-height: 1.4;
}

.summary-actions { margin-top: 1rem; }

/* Customer form */
.customer-form-section { margin-top: 1.5rem; }

.customer-form-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-hint {
    color: var(--grey);
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
}

.form-hint-sm {
    font-size: 0.76rem;
    color: var(--grey);
    margin-top: 0.35rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Address field */
.address-wrap {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.address-num {
    width: 72px !important;
    flex-shrink: 0;
}

.address-search-wrap {
    position: relative;
    flex: 1;
}

/* Order actions */
.order-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.order-actions .btn { flex: 1; min-width: 140px; justify-content: center; }

/* Success */
.order-success {
    background: #D1FAE5;
    border: 2px solid #10B981;
    border-radius: var(--radius);
    padding: 1.75rem;
    text-align: center;
    display: none;
    margin-top: 1.5rem;
}

.order-success.show { display: block; }
.order-success__icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.order-success h3 { color: #065F46; margin-bottom: 0.5rem; font-size: 1.2rem; }
.order-success p  { color: #047857; font-size: 0.95rem; line-height: 1.5; }

.order-success__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

/* Address autocomplete */
.address-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 2px solid var(--orange);
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 50;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.address-suggestion-item {
    padding: 0.65rem 0.9rem;
    font-size: 0.88rem;
    color: var(--dark);
    cursor: pointer;
    border-bottom: 1px solid #F3F4F6;
    line-height: 1.4;
    transition: background 0.15s;
}

.address-suggestion-item:last-child { border-bottom: none; }
.address-suggestion-item:hover { background: var(--gold-light); }

/* ===== REFERRAL CODE ===== */
.label-optional {
    font-weight: 400;
    color: var(--grey);
    font-size: 0.85rem;
}

.referral-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.referral-input-wrap input {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 0.95rem;
}

#referral-status {
    font-size: 0.85rem;
    white-space: nowrap;
    min-width: 80px;
    font-weight: 600;
}

.referral-hint {
    font-size: 0.82rem;
    color: #059669;
    margin-top: 0.35rem;
    padding: 0.4rem 0.6rem;
    background: #D1FAE5;
    border-radius: 6px;
}

/* Referral reveal on success */
.referral-reveal {
    background: linear-gradient(135deg, #FEF3C7, #FFF8EE);
    border: 2px solid var(--gold);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin: 1rem 0;
    text-align: center;
}

.referral-reveal__heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.35rem;
}

.referral-reveal__sub {
    font-size: 0.85rem;
    color: var(--grey);
    margin-bottom: 0.75rem;
}

.referral-reveal__code-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.referral-reveal__code {
    background: var(--dark);
    color: var(--gold);
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
}

.referral-reveal__copy {
    background: none;
    border: 1px solid var(--gold);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s;
}
.referral-reveal__copy:hover { background: var(--gold-light); }

.referral-reveal__explain {
    font-size: 0.82rem;
    color: var(--grey);
    line-height: 1.5;
}

.referral-applied-notice {
    background: #DBEAFE;
    border: 1px solid #93C5FD;
    color: #1D4ED8;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.referral-applied-notice--green {
    background: #D1FAE5;
    border-color: #6EE7B7;
    color: #065F46;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 500px) {
    .form-row { grid-template-columns: 1fr; }
    .order-actions { flex-direction: column; }
    .order-actions .btn { min-width: 100%; }
    .egg-card__controls { gap: 0.5rem; }
    .qty-control button { width: 40px; height: 40px; }
}
