@import url('/public/assets/css/public_base.css');

:root {
    --brand-dark: #0b1440;
    --brand-accent: #00b3cc;
    --bg-soft: #f6f8fb;
    --text-main: #1f2933;
    --text-muted: #6b7280;
    --border-soft: #e5e7eb;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-soft);
    color: var(--text-main);
}

body.order-body {
    padding-top: 130px;
    background-color: var(--bg-soft);
}

* {
    box-sizing: border-box;
}

.order-page {
    padding: 20px 16px 60px;
}

.order-container {
    width: 100%;
    max-width: var(--page-width, 900px);
    margin: 0 auto;
}

.back-to-dashboard {
    margin-bottom: 18px;
    padding: 10px 18px;
    background: var(--brand-dark);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.order-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.summary-column {
    flex: 1 1 auto;
    transition: transform 0.3s ease;
}

.order-summary {
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.08);
    position: relative;
    top: 0;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 12px;
}

.summary-close {
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    margin-left: auto;
}

.eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.company-name {
    color: var(--text-muted);
    margin-top: 4px;
    font-size: 14px;
}

.summary-count {
    display: none;
}

.summary-items {
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    padding: 16px 0;
    min-height: 80px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 15px;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-item .item-meta {
    display: flex;
    flex-direction: column;
}

.summary-item .item-qty {
    font-size: 13px;
    color: var(--text-muted);
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    font-size: 18px;
}

.summary-note {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 12px;
}

.summary-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

.summary-cta {
    width: 100%;
    margin-top: 18px;
    border: none;
    background: var(--brand-accent);
    color: #fff;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    cursor: pointer;
}

.summary-cta:hover {
    filter: brightness(0.95);
}

.mobile-summary-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-soft);
    background: #fff;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
}

h2, h3 {
    color: var(--brand-dark);
    margin: 0 0 20px;
}

.form-section {
    background-color: #ffffff;
    padding: 24px;
    border-radius: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.form-section.nested {
    border: 1px solid #eef2ff;
    box-shadow: none;
    margin-top: 24px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 8px;
}

#product-section {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.input-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.customer-input,
.customer-input-checkbox {
    font-size: 16px;
}

.customer-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #ffffff;
    color: var(--text-main);
    transition: border-color 0.2s;
}

.customer-input:focus {
    border-color: var(--brand-accent);
    outline: none;
}

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

.input-help {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

textarea.customer-input {
    resize: none;
    height: 100px;
}

.customer-input-checkbox {
    margin-right: 8px;
    width: 22px;
    height: 22px;
    accent-color: var(--brand-dark);
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.shipping-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.shipping-option input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.shipping-option__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shipping-option__hint {
    color: var(--text-muted);
    font-size: 13px;
}

.shipping-option:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.form-button {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    font-weight: 600;
    background-color: var(--brand-accent);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.form-button:hover {
    transform: translateY(-1px);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 12px;
}

.product-card {
    position: relative;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #e0e0e0;
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin-bottom: 15px;
    border-radius: 10px;
    background-color: #f2f2f2;
}

.product-card-header {
    font-size: 20px;
    font-weight: bold;
    color: #0077cc;
    margin-bottom: 10px;
}

.product-card-description {
    font-size: 14px;
    color: #555555;
    margin-bottom: 10px;
}

.product-price-container {
    font-size: 22px;
    font-weight: bold;
    color: #009688;
    text-align: center;
    margin-bottom: 15px;
}

.quantity-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.quantity-selector button {
    background-color: var(--brand-dark);
    border: none;
    color: white;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.quantity-selector button:hover {
    background-color: #1e2a68;
}

.quantity-selector input {
    width: 50px;
    text-align: center;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px;
}

/* Video popup styles from legacy (kept) */
.video-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    z-index: 9999;
    overflow: hidden;
}

.video-popup-content {
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.video-popup video {
    width: 100%;
    height: auto;
}

/* Toast */
#toast-root {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

.toast {
    background: #111827;
    color: #fff;
    padding: 14px 20px;
    border-radius: 999px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

/* SMS popup */
#sms-popup-layer {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

#sms-popup-layer.active {
    display: flex;
}

.sms-popup-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    width: min(420px, 90%);
    text-align: center;
    box-shadow: 0 24px 45px rgba(15, 23, 42, 0.25);
}

.sms-popup-card h3 {
    margin-bottom: 10px;
    font-size: 22px;
}

.sms-popup-card p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.sms-popup-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.sms-popup-btn {
    flex: 1 1 150px;
    border: none;
    border-radius: 10px;
    padding: 12px 0;
    font-weight: 600;
    cursor: pointer;
}

.sms-popup-btn.primary {
    background: var(--brand-dark);
    color: #fff;
}

.sms-popup-btn.secondary {
    background: #f3f4f6;
    color: var(--text-main);
}

.sms-loading {
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    box-shadow: 0 20px 35px rgba(15, 23, 42, 0.25);
}

.sms-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--brand-dark);
    border-radius: 50%;
    animation: spinner-rotate 1s linear infinite;
}

.sms-loading p {
    margin: 0;
    color: var(--text-muted);
    text-align: center;
}

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

.cart-floating-toggle {
    position: fixed;
    bottom: 5vh;
    right: 24px;
    border: none;
    background: var(--brand-dark);
    color: #fff;
    border-radius: 999px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.3);
    z-index: 1000;
}

.cart-floating-toggle .cart-icon {
    font-size: 18px;
}

.summary-open .cart-floating-toggle {
    bottom: calc(35vh + 12px);
}

@media (max-width: 1024px) {
    .summary-open .cart-floating-toggle {
        bottom: 220px;
    }
}

.payment-confirmation .payment-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 15px;
}

.payment-confirmation .email-notice {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

@media (max-width: 1024px) {
    .order-layout {
        flex-direction: column;
    }

    .summary-column {
        position: fixed;
        inset: auto 0 0 0;
        background: #fff;
        z-index: 999;
        transform: translateY(calc(100% - 64px));
    }

    .summary-column[data-open="true"] {
        transform: translateY(0);
    }

    .order-summary {
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.15);
        position: relative;
        top: 0;
    }

    .mobile-summary-toggle {
        display: inline-flex;
        position: absolute;
        top: 16px;
        right: 16px;
        z-index: 2;
    }

    .summary-column {
        padding-top: 48px;
    }

    .cart-floating-toggle {
        right: 12px;
        bottom: 4vh;
    }

    .summary-open .cart-floating-toggle {
        bottom: calc(42vh + 20px);
    }
}

@media (min-width: 960px) {
    .order-layout {
        flex-direction: row;
    }
    .summary-column {
        flex: 0 0 320px;
    }
    .order-summary {
        position: sticky;
        top: 120px;
    }
}

.media-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 18px;
    background: #000;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease;
}

.carousel-slide {
    min-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

.carousel-slide img,
.carousel-slide video {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.carousel-nav[data-dir="prev"] {
    left: 12px;
}

.carousel-nav[data-dir="next"] {
    right: 12px;
}

.product-popup {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.popup-content {
    background: #fff;
    border-radius: 18px;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
}

.popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}
.more-info {
    margin-top: 10px;
    border: 1px solid var(--brand-dark);
    background: transparent;
    color: var(--brand-dark);
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.more-info:hover {
    background: var(--brand-dark);
    color: #fff;
}
