﻿/* WebOrders.Web/wwwroot/css/item-detail.css
   Styles for the item-detail modal partial. Loaded once from the home view
   (Slice C already adds the link). All colors driven by --wo-* vars.       */

.wo-item {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

/* ── Hero image (when item has one) ─────────────────────────────────── */
.wo-item-img {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #f3f4f6;
    overflow: hidden;
}

    .wo-item-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* Close button — overlay on image, top-right */
.wo-item-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    transition: background 0.15s;
}

    .wo-item-close:hover {
        background: #fff;
    }

.wo-item-close-floating {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

/* ── Body ───────────────────────────────────────────────────────────── */
.wo-item-body {
    padding: 1.25rem 1.5rem 1.5rem;
    overflow-y: auto;
    flex: 1;
    position: relative;
}

.wo-item-name {
    margin: 0 0 0.35rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: #111827;
    padding-right: 2.5rem; /* leave space for floating close button */
}

.wo-item-desc {
    margin: 0 0 1.25rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ── Modifier groups ────────────────────────────────────────────────── */
.wo-mod-group {
    margin: 0 0 1.25rem;
}

.wo-mod-group-head {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0 0 0.5rem;
}

    .wo-mod-group-head h3 {
        margin: 0;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #374151;
    }

.wo-mod-required {
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background: #dc2626;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wo-mod-hint {
    font-size: 0.75rem;
    color: #6b7280;
}

.wo-mods {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid #f3f4f6;
}

.wo-mod {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f3f4f6;
    gap: 0.75rem;
}

    .wo-mod label {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        cursor: pointer;
        flex: 1;
        user-select: none;
    }

    .wo-mod input[type=radio],
    .wo-mod input[type=checkbox] {
        width: 1.1rem;
        height: 1.1rem;
        accent-color: var(--wo-primary);
        cursor: pointer;
        flex: 0 0 auto;
    }

.wo-mod-name {
    color: #111827;
}

.wo-mod-price {
    color: #6b7280;
    font-size: 0.875rem;
    flex: 0 0 auto;
}

/* ── Special instructions ───────────────────────────────────────────── */
.wo-item-notes-label {
    display: block;
    margin: 0.5rem 0 1rem;
}

    .wo-item-notes-label > span {
        display: block;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #374151;
        margin-bottom: 0.4rem;
    }

.wo-item-notes {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font: inherit;
    font-size: 0.9rem;
    resize: vertical;
    background: #fff;
}

    .wo-item-notes:focus {
        outline: 0;
        border-color: var(--wo-primary);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--wo-primary) 22%, transparent);
    }

/* ── Error banner ───────────────────────────────────────────────────── */
.wo-item-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    margin: 0 0 1rem;
    font-size: 0.875rem;
}

/* ── Footer: qty stepper + add button ───────────────────────────────── */
.wo-item-foot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

/* ── Quantity stepper: segmented pill ─────────────────────────────── */
.wo-qty {
    display: inline-flex;
    align-items: stretch;
    height: 32px;
    border: 1px solid #d9dce1;
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}

.wo-qty-btn {
    width: 32px;
    border: 0;
    background: #f6f7f8;
    color: #374151;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s ease;
    user-select: none;
}

    .wo-qty-btn:hover {
        background: #ececee;
    }

    .wo-qty-btn:active {
        background: #e2e3e6;
    }

/* Quantity input rendered like the cart pill's value: borderless, centered,
   no native spinners — the −/+ buttons are the only affordance. */
.wo-qty input {
    border: 0;
    outline: none;
    background: transparent;
    width: 2.6rem;
    min-width: 2.4rem;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    color: #111827;
    padding: 0 0.2rem;
    -moz-appearance: textfield;
    appearance: textfield;
}

    .wo-qty input::-webkit-outer-spin-button,
    .wo-qty input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    .wo-qty input:focus {
        background: #f3f4f6;
    }

.wo-qty-btn:disabled {
    color: #b8bcc4;
    cursor: default;
    background: #f6f7f8;
}

.wo-qty-input {
    width: 40px;
    border: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #1a1d26;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

    .wo-qty-input::-webkit-outer-spin-button,
    .wo-qty-input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

.wo-item-add {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    height: 48px;
    padding: 0 1.2rem;
    border: 0;
    border-radius: 999px;
    background: var(--wo-primary);
    color: var(--wo-primary-text);
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s, transform 0.05s;
}

    .wo-item-add:hover {
        filter: brightness(0.92);
    }

    .wo-item-add:active {
        transform: scale(0.98);
    }

    .wo-item-add:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.wo-item-add-total {
    font-variant-numeric: tabular-nums;
}

/* ── Small viewport tweaks ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .wo-item-body {
        padding: 1rem 1.1rem 1.2rem;
    }

    .wo-item-name {
        font-size: 1.2rem;
    }

    .wo-item-foot {
        flex-wrap: wrap;
    }

    .wo-item-add {
        width: 100%;
    }
}
