/*
 * Themeshop products - neutral default styling.
 * Everything is scoped under .tiqs-products so it never leaks into the theme.
 * A theme can override these rules, or provide its own #tiqsProducts container.
 */

.tiqs-products {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px 80px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a1a;
    line-height: 1.4;
}

/* Order-type picker (Local / Pickup / Delivery) */
.tiqs-type-select {
    max-width: 460px;
    margin: 0 auto;
    padding: 48px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    text-align: center;
}

.tiqs-type-heading {
    margin: 0 0 24px;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

.tiqs-spot-search {
    display: block;
    width: 100%;
    margin: 0 0 16px;
    padding: 11px 14px;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.tiqs-type-option {
    display: block;
    width: 100%;
    margin: 0 0 12px;
    padding: 16px 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    color: #111;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.tiqs-type-option:hover {
    border-color: #111;
    background: #111;
    color: #fff;
}

/* A closed type (Dine-In): shown but not selectable, with its next opening time. */
.tiqs-type-option--closed,
.tiqs-type-option--closed:hover {
    background: #f7f7f8;
    border-color: #ececec;
    color: #9aa0a6;
    cursor: not-allowed;
}

.tiqs-type-option-label { display: block; }

.tiqs-type-option-info {
    display: block;
    margin-top: 4px;
    font-size: 12.5px;
    font-weight: 600;
    color: #e11d48;
}

/* Closed / empty notices (holiday period, no types/spots, no products) */
.tiqs-closed,
.tiqs-empty {
    max-width: 460px;
    margin: 48px auto;
    padding: 24px 16px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    color: #555;
}

/* Checkout screen */
.tiqs-checkout {
    max-width: 560px;
    margin: 0 auto;
    padding: 8px 16px 60px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a1a;
}

.tiqs-co-title {
    margin: 12px 0 16px;
    font-size: 20px;
    font-weight: 700;
}

.tiqs-co-summary {
    margin-bottom: 20px;
    padding: 12px 14px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    font-size: 14px;
}

.tiqs-co-line { padding: 6px 0; border-bottom: 1px solid #f0f0f0; }
.tiqs-co-line-head { display: flex; justify-content: space-between; font-weight: 600; }
.tiqs-co-addon { margin-left: 12px; color: #777; font-size: 12.5px; }

.tiqs-co-line-remark {
    width: 100%;
    margin-top: 6px;
    padding: 7px 10px;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}

.tiqs-co-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
    color: #444;
}

.tiqs-co-tip {
    width: 90px;
    padding: 6px 8px;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    text-align: right;
}

.tiqs-co-total {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 2px solid #111;
    font-size: 16px;
    font-weight: 700;
}

.tiqs-co-field { margin-bottom: 14px; }
.tiqs-co-field label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; }

/* Grouped checkout block (delivery location). Resets the browser's default
   fieldset chrome and re-styles it to match the rest of the form. */
.tiqs-co-fieldset {
    margin: 0 0 14px;
    padding: 14px 14px 2px;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    min-width: 0; /* let inputs shrink inside the fieldset */
}
.tiqs-co-legend {
    padding: 0 6px;
    font-size: 13px;
    font-weight: 700;
}

.tiqs-co-field input,
.tiqs-co-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.tiqs-co-phone { display: flex; gap: 8px; }
.tiqs-co-phone .tiqs-co-num { flex: 1 1 auto; min-width: 0; }

/* Country dial code is a <select>, so it needs its own box styling (the
   .tiqs-co-field input rule doesn't apply to selects). Wide enough for
   "+385 Croatia", but allowed to shrink so the number keeps room on mobile. */
.tiqs-co-phone .tiqs-co-cc {
    flex: 0 1 150px;
    min-width: 104px;
    padding: 10px 12px;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
}

/* Scheduled date + time picker (pickup / delivery): day pills + time-slot chips. */
.tiqs-sched-label {
    margin: 20px 0 10px;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Day pills scroll horizontally so a long date range stays one tidy row. */
.tiqs-day-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.tiqs-day-pill {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 74px;
    padding: 12px 14px;
    border: 1.5px solid #e3e3e3;
    border-radius: 12px;
    background: #fff;
    color: #111;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.tiqs-day-pill:hover { border-color: #111; }
.tiqs-day-pill.selected {
    border-color: #111;
    background: #111;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.tiqs-day-pill-top { font-size: 13px; font-weight: 700; }
.tiqs-day-pill-bottom { font-size: 12px; opacity: 0.82; }

/* Time chips wrap into a grid; capped height with its own scroll so a fine slot
   interval (e.g. every 5 min) doesn't produce an endless wall. */
.tiqs-time-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding: 2px;
}
.tiqs-time-chip {
    flex: 0 0 auto;
    min-width: 68px;
    padding: 9px 14px;
    border: 1.5px solid #e3e3e3;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.tiqs-time-chip:hover { border-color: #111; }
.tiqs-time-chip.selected {
    border-color: #111;
    background: #111;
    color: #fff;
}
.tiqs-sched-hint { margin: 2px 0; color: #9ca3af; font-size: 13px; }

.tiqs-sched-continue {
    display: block;
    width: 100%;
    margin: 22px 0 0;
    padding: 15px 20px;
    border: 0;
    border-radius: 10px;
    background: #16a34a;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.tiqs-sched-continue:hover { background: #128a3f; }
.tiqs-sched-continue:disabled { background: #cbd5cf; cursor: default; }

.tiqs-co-payment { margin: 4px 0 16px; }

.tiqs-co-pm-title { margin-bottom: 8px; font-size: 13px; font-weight: 600; }

.tiqs-co-pm {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 12px 14px;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    cursor: pointer;
}

.tiqs-co-pm:hover { border-color: #111; }

.tiqs-co-pm-icon { width: 24px; height: 24px; object-fit: contain; }
.tiqs-co-pm-name { flex: 1 1 auto; font-size: 14px; text-transform: capitalize; }
.tiqs-co-pm-fee { color: #777; font-size: 12.5px; }
.tiqs-co-pm-empty { color: #999; font-size: 13px; text-align: center; }

/* Applied-voucher chip (after the payment methods, once a code is entered). */
.tiqs-co-voucher-applied {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 0;
    padding: 8px 12px;
    border: 1px solid #16a34a;
    border-radius: 8px;
    color: #15803d;
    font-size: 13px;
    font-weight: 600;
}
.tiqs-co-voucher-code { font-family: monospace; letter-spacing: .03em; cursor: pointer; text-decoration: underline; }
.tiqs-co-voucher-remove {
    margin-left: auto;
    border: 0;
    background: none;
    color: #15803d;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

/* Voucher-code popup (opened when "Pay with voucher" is chosen). */
.tiqs-voucher-popup {
    position: fixed;
    inset: 0;
    z-index: 2147483003;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
}
.tiqs-voucher-popup-box {
    width: 100%;
    max-width: 340px;
    padding: 20px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.tiqs-voucher-popup-title { margin-bottom: 12px; font-size: 15px; font-weight: 700; }
.tiqs-voucher-popup-input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    font-size: 15px;
}
.tiqs-voucher-popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}
.tiqs-voucher-popup-cancel,
.tiqs-voucher-popup-ok {
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.tiqs-voucher-popup-cancel { border: 1px solid #d5d5d5; background: #fff; color: #111; }
.tiqs-voucher-popup-ok { border: 0; background: #111; color: #fff; }

.tiqs-co-error { margin: 0 0 12px; color: #e11d48; font-size: 13px; font-weight: 600; }

/* Per-field validation message, shown under its field. */
.tiqs-co-field-error {
    margin: 5px 0 0;
    color: #e11d48;
    font-size: 12.5px;
    font-weight: 600;
}
.tiqs-co-field-error:empty { display: none; }

/* Prominent error toast — fixed in the upper third of the screen. */
.tiqs-toast {
    position: fixed;
    top: 18%;
    left: 50%;
    transform: translate(-50%, -12px);
    z-index: 2147483002;
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(100% - 32px);
    max-width: 460px;
    padding: 16px 18px;
    background: #e11d48;
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.tiqs-toast.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.tiqs-toast-icon { flex: 0 0 auto; font-size: 22px; line-height: 1; }
.tiqs-toast-msg { flex: 1 1 auto; }
.tiqs-toast-line + .tiqs-toast-line { margin-top: 5px; }

.tiqs-toast-close {
    flex: 0 0 auto;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
}

.tiqs-toast-close:hover { opacity: 1; }

.tiqs-co-place {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border: 0;
    border-radius: 8px;
    background: #16a34a;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.tiqs-co-place:hover { background: #128a3f; }

/* While the order is being created: hide the label, show a centered spinner, and
   block re-clicks. Reverted on an error response so the buyer can retry. */
.tiqs-co-place.is-loading {
    position: relative;
    color: transparent;
    cursor: default;
}
.tiqs-co-place.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tiqs-spin 0.6s linear infinite;
}
@keyframes tiqs-spin { to { transform: rotate(360deg); } }

/* "Change order type" / "Change spot" / "Back" control shown above a chosen
   type's products. A centered pill so it reads as a clear, balanced action. */
.tiqs-type-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin: 6px auto 24px;      /* auto side margins center it */
    padding: 10px 20px;
    border: 1px solid #e6e6e6;
    border-radius: 999px;
    background: #f7f7f8;
    color: #333;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.tiqs-type-back:hover {
    background: #111;
    border-color: #111;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.tiqs-type-back:active { transform: translateY(1px); }

.tiqs-products * {
    box-sizing: border-box;
}

.tiqs-category-title {
    margin: 36px 0 4px;
    padding-bottom: 8px;
    border-bottom: 2px solid #111;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Per-category product list: show roughly 10 products, then scroll inside this
   area (keeps a long category from stretching the page). Only scrolls when the
   content is taller than the cap. Tune max-height to change how many show. */
.tiqs-category-products {
    max-height: 500px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.tiqs-product {
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}

.tiqs-product-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tiqs-product-name {
    flex: 1 1 auto;
    font-size: 15px;
    font-weight: 600;
}

.tiqs-product-price {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    color: #111;
}

.tiqs-product-desc {
    margin: 4px 0 0;
    font-size: 13px;
    color: #777;
}

/* Allergen icons (from product.allergies), like the make_order page. */
.tiqs-allergies {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin: 8px 0 0;
}

.tiqs-allergy-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* Per-product remark on the product card — only visible once it's added. */
.tiqs-product-remark {
    display: none;
    width: 100%;
    margin: 10px 0 0;
    padding: 8px 12px;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}

.tiqs-product--added .tiqs-product-remark {
    display: block;
}

/* Quantity control (no behaviour yet - the basket library binds to these) */
.tiqs-qty {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.tiqs-qty-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 50%;
    background: #fff;
    color: #111;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.tiqs-qty-btn:hover {
    background: #111;
    border-color: #111;
    color: #fff;
}

.tiqs-qty-value {
    min-width: 22px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

/* Addon groups (children of a product) */
.tiqs-addon-group {
    margin: 10px 0 0;
    padding: 8px 12px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
}

.tiqs-addon-label {
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #888;
}

/* "Choose up to N" instruction for a group */
.tiqs-addon-hint {
    display: block;
    margin-bottom: 6px;
    font-size: 11.5px;
    color: #aaa;
}

.tiqs-addon {
    display: inline-flex;
    align-items: center;
    margin: 0 6px 6px 0;
    padding: 5px 12px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.tiqs-addon:hover {
    border-color: #111;
}

/* Selected choice */
.tiqs-addon.selected {
    border-color: #111;
    background: #111;
    color: #fff;
}

/* Brief flash on a choice that was auto-removed to make room (rolling max) */
.tiqs-addon--removed {
    border-color: #e11d48;
    background: #fff5f6;
    color: #e11d48;
    transition: none;
}

/* Per-addon quantity stepper — visible only once the addon is selected */
.tiqs-addon-qty {
    display: none;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.tiqs-addon.selected .tiqs-addon-qty {
    display: inline-flex;
}

/* Read-only count (max-1 addon): just "×N", no buttons */
.tiqs-addon-qty--readonly { gap: 1px; font-weight: 700; }

.tiqs-addon-qty-btn {
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.tiqs-addon-qty-value {
    min-width: 14px;
    text-align: center;
    font-weight: 700;
}

/* Trailing "remove" mark — visible only once the addon is selected, so a black
   chip clearly reads as removable. Clicking it deselects (bubbles to the chip). */
.tiqs-addon-remove {
    display: none;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border-radius: 50%;
    font-size: 11px;
    line-height: 1;
    color: #e11d48;
    transition: background 0.15s;
}

.tiqs-addon.selected .tiqs-addon-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tiqs-addon-remove:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* A mandatory group still awaiting a choice (highlighted after a blocked add) */
.tiqs-addon-group--required {
    border-color: #e11d48;
    background: #fff5f6;
}

.tiqs-addon-group--required .tiqs-addon-label {
    color: #e11d48;
}

/* Inline hint shown when "+" is blocked because required options are missing */
.tiqs-product--needs-options::after {
    content: "Please choose the required options";
    display: block;
    margin-top: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #e11d48;
}
