/* ==========================================================================
   Order Page — Styles
   Inherits brand tokens from landing.css
   ========================================================================== */

/* ==========================================================================
   Compact Hero (order-specific)
   ========================================================================== */

.hero-compact {
    padding: 80px 24px 16px;
}

.hero-compact .hero-badge {
    margin-bottom: 4px;
    font-size: 11px;
}

.hero-compact .hero-title {
    font-size: 26px;
    margin-bottom: 4px;
}

.hero-compact .hero-subtitle {
    margin-bottom: 0;
    font-size: 14px;
    max-width: none;
}

/* ==========================================================================
   Active Nav Link
   ========================================================================== */

.nav-link-active {
    color: var(--white) !important;
    font-weight: 500 !important;
    position: relative;
}

.nav-link-active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--light-blue);
    border-radius: 1px;
}

/* ==========================================================================
   Order Section Layout
   ========================================================================== */

.order-section {
    padding: 48px 0 80px;
}

.order-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: start;
}

/* Right column: sticky + scrollable so it stays in viewport */
.order-options-col {
    position: sticky;
    top: 72px; /* below nav */
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* ==========================================================================
   Stepper Navigation
   ========================================================================== */

.stepper-nav {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 24px;
    position: relative;
}

.stepper-nav::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 24px;
    right: 24px;
    height: 2px;
    background: var(--gray-200);
    z-index: 0;
}

.stepper-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    cursor: pointer;
    position: relative;
    z-index: 1;
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font);
}

.stepper-nav-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.stepper-nav-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--gray-600);
    white-space: nowrap;
    transition: color 0.25s ease;
}

.stepper-nav-item.active .stepper-nav-dot {
    background: var(--light-blue);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(43, 171, 227, 0.3);
}

.stepper-nav-item.active .stepper-nav-label {
    color: var(--dark-blue);
    font-weight: 600;
}

.stepper-nav-item.completed .stepper-nav-dot {
    background: var(--light-blue);
    color: var(--white);
}

.stepper-nav-item.completed .stepper-nav-label {
    color: var(--dark-blue);
}

/* ==========================================================================
   Order Steps
   ========================================================================== */

.order-step {
    margin-bottom: 28px;
}

.order-options-col .order-step {
    margin-bottom: 0;
    display: none;
}

.order-options-col .order-step.active {
    display: block;
}

.order-step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.order-step-number {
    display: none;
}

.order-step-header h3 {
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

/* Step navigation buttons — sticky at bottom of the scrollable right column */
.step-nav-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    position: sticky;
    bottom: 0;
    background: var(--white);
    padding: 14px 0 2px;
    border-top: 1px solid var(--gray-200);
    z-index: 10;
}

.btn-step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}

.btn-step-back {
    background: var(--gray-200);
    color: var(--dark-blue);
}

.btn-step-back:hover {
    background: var(--gray-300);
}

.btn-step-next {
    background: var(--light-blue);
    color: var(--white);
    margin-left: auto;
}

.btn-step-next:hover {
    background: #2499cc;
}

.btn-step-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-step-next:disabled:hover {
    background: var(--light-blue);
}

/* ==========================================================================
   Search Bar
   ========================================================================== */

.search-container {
    position: relative;
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--gray-600);
    pointer-events: none;
    flex-shrink: 0;
}

.search-input {
    width: 100%;
    padding: 14px 40px 14px 42px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 400;
    color: var(--dark-blue);
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input::placeholder {
    color: var(--gray-300);
}

.search-input:focus {
    border-color: var(--light-blue);
    box-shadow: 0 0 0 3px rgba(43, 171, 227, 0.12);
}

.search-clear {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--gray-600);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color var(--transition);
}

.search-clear:hover {
    color: var(--dark-blue);
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    list-style: none;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 280px;
    overflow-y: auto;
    display: none;
}

.search-results.open {
    display: block;
}

.search-results li {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--dark-blue);
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.search-results li:last-child {
    border-bottom: none;
}

.search-results li:hover,
.search-results li.active {
    background: rgba(43, 171, 227, 0.06);
}

.search-results li .result-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    color: var(--light-blue);
}

.search-results li .result-text {
    flex: 1;
    min-width: 0;
}

.search-results li .result-label {
    display: block;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-results li .result-detail {
    display: block;
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 2px;
}

.search-no-results {
    padding: 16px;
    text-align: center;
    color: var(--gray-600);
    font-size: 14px;
}

/* ==========================================================================
   Map
   ========================================================================== */

.map-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px solid var(--gray-200);
    transition: border-color var(--transition);
}

.map-wrapper:focus-within {
    border-color: var(--light-blue);
}

.map-container {
    width: 100%;
    height: 480px;
}

.map-instructions {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(19, 43, 59, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--white);
    font-size: 13px;
    font-weight: 400;
    padding: 10px 20px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.map-instructions.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Bbox Dimensions Overlay */
.bbox-dimensions {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(19, 43, 59, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--white);
    font-size: 13px;
    font-weight: 500;
    font-family: 'SF Mono', 'Fira Code', monospace;
    padding: 8px 14px;
    border-radius: 6px;
    pointer-events: none;
    z-index: 10;
}

/* Map Layer Toggle */
.map-layer-toggle {
    position: absolute;
    top: 120px;
    right: 10px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.map-layer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: #fff;
    color: #333;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.map-layer-btn:not(:last-child) {
    border-bottom: 1px solid #e5e5e5;
}

.map-layer-btn:hover {
    background: #f0f0f0;
}

.map-layer-btn.active {
    background: var(--light-blue);
    color: #fff;
}

/* ==========================================================================
   Format Selector
   ========================================================================== */

.format-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.format-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.format-option:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.format-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.format-option input[type="radio"]:checked + .format-option-content + .format-check {
    opacity: 1;
    transform: scale(1);
}

.format-option input[type="radio"]:checked ~ .format-option-content,
.format-option:has(input:checked) {
    border-color: var(--light-blue);
}

.format-option:has(input:checked) {
    border-color: var(--light-blue);
    background: rgba(43, 171, 227, 0.04);
}

.format-option-content {
    flex: 1;
    min-width: 0;
}

.format-option-ext {
    display: inline-block;
    background: var(--dark-blue);
    color: var(--white);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 3px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    margin-right: 8px;
}

.format-option-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--dark-blue);
}

.format-option-desc {
    display: block;
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 3px;
}

.format-option-example {
    display: inline-block;
    font-size: 11px;
    color: var(--light-blue);
    text-decoration: none;
    margin-top: 4px;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.format-option-example:hover {
    opacity: 1;
    text-decoration: underline;
}

.format-check {
    width: 22px;
    height: 22px;
    color: var(--light-blue);
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.2s ease;
}

/* ==========================================================================
   Your Export — Included Layers (read-only list)
   ========================================================================== */

.step-subtitle {
    font-size: 13px;
    color: var(--gray-600);
    margin: 0;
    font-weight: 400;
}

.included-layers {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.layer-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 8px;
}

.layer-group-label {
    grid-column: 1 / -1;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-600);
    margin: 10px 0 2px;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--gray-200);
}

.layer-group:first-child .layer-group-label {
    margin-top: 0;
}

.layer-item {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 5px 6px;
    border-radius: 5px;
    transition: background var(--transition);
}

.layer-item:hover {
    background: rgba(43, 171, 227, 0.03);
}

.layer-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--light-blue);
    opacity: 0.7;
    margin-top: 1px;
}

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

.layer-name {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--dark-blue);
    line-height: 1.3;
}

.layer-desc {
    display: block;
    font-size: 10px;
    color: var(--gray-600);
    margin-top: 1px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layer-badge {
    display: inline-block;
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(43, 171, 227, 0.1);
    color: var(--light-blue);
    margin-left: 4px;
    vertical-align: middle;
}

.layer-check {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #27ae60;
    opacity: 0.6;
    margin-top: 1px;
}

/* ==========================================================================
   Setback Configuration
   ========================================================================== */

.setback-config {
    margin-top: 16px;
    padding: 14px 16px;
    background: rgba(43, 171, 227, 0.03);
    border: 1px solid rgba(43, 171, 227, 0.12);
    border-radius: var(--radius);
}

.setback-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.setback-header-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--light-blue);
    margin-top: 1px;
}

.setback-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-blue);
}

.setback-desc {
    display: block;
    font-size: 11px;
    color: var(--gray-600);
    margin-top: 1px;
}

.setback-inputs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setback-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setback-row label {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-800);
    min-width: 0;
    flex: 1;
}

.setback-row input[type="number"] {
    width: 64px;
    padding: 5px 8px;
    font-size: 12px;
    font-family: var(--font);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    text-align: right;
    background: #fff;
}

.setback-row input[type="number"]:focus {
    outline: none;
    border-color: var(--light-blue);
    box-shadow: 0 0 0 2px rgba(43, 171, 227, 0.15);
}

.setback-row .setback-unit {
    font-size: 11px;
    color: var(--gray-500);
    min-width: 14px;
}

/* ==========================================================================
   Price Card
   ========================================================================== */

.price-card {
    margin-bottom: 28px;
}

.price-card-inner {
    background: linear-gradient(135deg, var(--dark-blue) 0%, #1a3a4f 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.price-card-inner::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(43, 171, 227, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.price-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    position: relative;
}

.price-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    position: relative;
}

.price-currency {
    font-size: 18px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
}

.price-amount {
    font-size: 42px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--white);
}

.price-detail {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
    position: relative;
}

/* ==========================================================================
   Customer Form
   ========================================================================== */

.order-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--dark-blue);
}

.form-label .required {
    color: #c0392b;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 400;
    color: var(--dark-blue);
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-input::placeholder {
    color: var(--gray-300);
}

.form-input:focus {
    border-color: var(--light-blue);
    box-shadow: 0 0 0 3px rgba(43, 171, 227, 0.12);
}

.form-input.error {
    border-color: #c0392b;
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%235a6b77' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-error {
    font-size: 12px;
    color: #c0392b;
    min-height: 0;
    transition: min-height 0.2s ease;
}

/* Pay Button */
.btn-pay {
    width: 100%;
    gap: 10px;
    margin-top: 8px;
    font-size: 16px;
    padding: 16px 28px;
    position: relative;
    overflow: hidden;
}

.btn-pay:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-pay:disabled:hover {
    background: var(--light-blue);
    border-color: var(--light-blue);
}

.btn-pay-icon {
    flex-shrink: 0;
}

.btn-pay.loading .btn-pay-icon {
    display: none;
}

.btn-pay.loading::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

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

.pay-disclaimer {
    font-size: 12px;
    color: var(--gray-600);
    text-align: center;
    margin-top: 8px;
    line-height: 1.5;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: var(--dark-blue);
    color: var(--white);
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 400;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 400px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.toast-error {
    border-left: 4px solid #c0392b;
}

.toast.toast-success {
    border-left: 4px solid #27ae60;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .order-layout {
        grid-template-columns: 1fr 360px;
        gap: 32px;
    }

    .layer-group {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-compact {
        padding: 72px 24px 12px;
    }

    .hero-compact .hero-title {
        font-size: 22px;
    }

    .order-section {
        padding: 32px 0 56px;
    }

    .order-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .map-container {
        height: 360px;
    }

    .order-options-col {
        margin-top: 24px;
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    .stepper-nav-label {
        font-size: 10px;
    }

    .price-amount {
        font-size: 36px;
    }

    .toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .map-container {
        height: 300px;
    }

    .map-instructions {
        font-size: 12px;
        padding: 8px 14px;
    }
}
