/* ===== Shop Online — guided shopping mode ===== */

/* Shop Online button on the grocery list page */
.shop-online-btn {
    display: none; /* shown by JS when the list has items */
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 220px;
    height: 44px;
    margin: 0 auto 14px auto;
    padding: 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    font-family: 'Quicksand', sans-serif !important;
    border-radius: 24px !important;
    cursor: pointer;
    background: linear-gradient(to bottom, #FAF8F5 0%, #F0EBE5 100%) !important;
    color: #2D2D2D !important;
    border: 1.5px solid #F7941D !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.shop-online-btn:active {
    background: linear-gradient(to bottom, #EBE6E0 0%, #E5E0DA 100%) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
}

.shop-online-btn svg {
    flex-shrink: 0;
    margin: 0;
}

/* Full-screen overlay */
.shop-online-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Warm off-white ground (was pure white) with white lifted surfaces —
       matches the rest of Prepiva's tabs. */
    background: #F6F3EF;
    z-index: 10002; /* above app header (10000) and scan overlay (10001) */
    flex-direction: column;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px)) 20px;
    box-sizing: border-box;
    font-family: 'Quicksand', sans-serif;
}

.shop-online-overlay.active {
    display: flex;
}

/* Lock body scroll while shopping */
html.shop-online-open,
body.shop-online-open {
    overflow: hidden !important;
}

/* Header: Undo (left), counter (centre), close (right).
   3-column grid keeps the counter dead-centre even though the Undo pill and
   the round close button are different widths. */
.shop-online-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 40px;
    flex-shrink: 0;
}
.shop-online-header .shop-online-icon-btn { justify-self: end; }

/* Undo — a small labelled pill mirroring the close button, shown from item 2
   on. Orange-tinted because it's a correction (take back the last tap). */
.shop-online-undo-btn {
    justify-self: start;
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 13px 0 10px !important;
    background: #FFFFFF !important;
    color: #E07A10 !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
    font-family: 'Quicksand', sans-serif !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
.shop-online-undo-btn svg { flex-shrink: 0; }
.shop-online-undo-btn:active { background: #FBF0E4 !important; }
.shop-online-undo-btn:hover,
.shop-online-undo-btn:focus {
    background: #FFFFFF !important;
    color: #E07A10 !important;
    outline: none !important;
}

.shop-online-icon-btn {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #FFFFFF !important;
    color: #2D2D2D !important;
    border: none !important;
    border-radius: 50% !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
    font-size: 15px !important;
    cursor: pointer;
    margin: 0;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.shop-online-icon-btn:active,
.shop-online-icon-btn:focus {
    background: #F3F0EB !important;
    outline: none !important;
    transform: none !important;
}

.shop-online-counter {
    font-size: 14px;
    font-weight: 600;
    color: #888888;
    letter-spacing: 0.02em;
    margin: 0;
}

/* Progress bar */
.shop-online-progress-track {
    width: 100%;
    height: 6px;
    background: #EFEFEF;
    border-radius: 3px;
    margin: 12px 0 0 0;
    overflow: hidden;
    flex-shrink: 0;
}

.shop-online-progress-fill {
    height: 100%;
    width: 0%;
    background: #F7941D;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Centre panels — children get explicit margins (flexbox centring gotcha) */
.shop-online-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 0;
    width: 100%;
}

.shop-online-panel > * {
    margin: 0;
}

/* The store picker reads better anchored near the top rather than floating in
   the vertical centre (which left a big empty gap under the header). The
   item-swipe panel stays centred. */
#shop-online-store-picker {
    justify-content: flex-start;
    padding-top: 8vh;
}
#shop-online-store-picker .shop-online-heading { margin-bottom: 10px; }
#shop-online-store-picker .shop-online-subtext { margin-bottom: 26px; }

.shop-online-heading {
    font-size: 26px;
    font-weight: 700;
    color: #2D2D2D;
    margin: 0 0 8px 0;
}

.shop-online-subtext {
    font-size: 14px;
    font-weight: 500;
    color: #999999;
    margin: 0 0 6px 0;
}

.shop-online-item-name {
    font-size: 30px;
    font-weight: 700;
    color: #2D2D2D;
    line-height: 1.25;
    margin: 6px 0 4px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    padding: 0 8px;
    box-sizing: border-box;
}

/* Soft card around the current item — white, lifted off the off-white ground */
.shop-online-item-card {
    width: 100%;
    background: #FFFFFF;
    border-radius: 28px;
    padding: 46px 20px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    box-sizing: border-box;
}

.shop-online-item-card .shop-online-item-name {
    font-size: 40px;
    margin: 8px 0 18px 0;
}

.shop-online-qty-pill {
    display: inline-block;
    font-size: 17px;
    font-weight: 700;
    color: #F7941D;
    background: #F6F3EF;
    border: 1.5px solid #F7941D;
    border-radius: 24px;
    padding: 9px 24px;
    margin: 0;
}

.shop-online-finish-icon {
    font-size: 52px;
    line-height: 1;
    margin: 0 0 14px 0;
}

/* Action buttons */
.shop-online-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 320px;
    margin: 22px 0 0 0;
}

.shop-online-actions button {
    margin: 0;
}

.shop-online-btn-primary {
    width: 100% !important;
    height: 52px !important;
    padding: 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    font-family: 'Quicksand', sans-serif !important;
    background: #F7941D !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 26px !important;
    box-shadow: 0 4px 12px rgba(247, 148, 29, 0.35) !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.shop-online-btn-primary:active {
    background: #E07A10 !important;
}

/* iOS keeps hover/focus after tap — always return to the resting colour */
.shop-online-btn-primary:hover,
.shop-online-btn-primary:focus,
.shop-online-btn-primary:visited {
    background: #F7941D !important;
    outline: none !important;
}

.shop-online-btn-secondary {
    width: 100% !important;
    height: 48px !important;
    padding: 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    font-family: 'Quicksand', sans-serif !important;
    background: linear-gradient(to bottom, #FAF8F5 0%, #F0EBE5 100%) !important;
    color: #2D2D2D !important;
    border: 1.5px solid #F7941D !important;
    border-radius: 24px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.shop-online-btn-secondary:active {
    background: linear-gradient(to bottom, #EBE6E0 0%, #E5E0DA 100%) !important;
}

.shop-online-btn-secondary:hover,
.shop-online-btn-secondary:focus,
.shop-online-btn-secondary:visited {
    background: linear-gradient(to bottom, #FAF8F5 0%, #F0EBE5 100%) !important;
    color: #2D2D2D !important;
    outline: none !important;
}

.shop-online-btn-tertiary {
    background: transparent !important;
    color: #999999 !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: 'Quicksand', sans-serif !important;
    padding: 8px 16px !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.shop-online-btn-tertiary:active {
    opacity: 0.6;
}

.shop-online-btn-tertiary:hover,
.shop-online-btn-tertiary:focus {
    background: transparent !important;
    color: #999999 !important;
    outline: none !important;
    box-shadow: none !important;
    opacity: 1 !important;
}

/* Touch devices keep :active/:hover stuck after a tap — no lingering states */
@media (hover: none), (pointer: coarse) {
    .shop-online-btn-tertiary:active {
        opacity: 1 !important;
        background: transparent !important;
        color: #999999 !important;
        box-shadow: none !important;
    }
}

/* Icon-row layout for the main action buttons (icon + label left, chevron right) */
.shop-online-actions-wide {
    max-width: 100%;
    margin-top: 26px;
}

.shop-online-btn-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 22px !important;
    text-align: left !important;
}

.shop-online-btn-left {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.shop-online-btn-chevron {
    flex-shrink: 0;
    opacity: 0.9;
}

.shop-online-btn-row.shop-online-btn-primary {
    height: 58px !important;
    border-radius: 29px !important;
    font-size: 17px !important;
    font-weight: 700 !important;
}

/* Done, next item — white with orange border and orange text */
.shop-online-btn-done {
    width: 100% !important;
    height: 56px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    font-family: 'Quicksand', sans-serif !important;
    background: #FFFFFF !important;
    color: #F7941D !important;
    border: 1.5px solid #F7941D !important;
    border-radius: 28px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.shop-online-btn-done:active {
    background: #FFF4E8 !important;
}

.shop-online-btn-done:hover,
.shop-online-btn-done:focus,
.shop-online-btn-done:visited {
    background: #FFFFFF !important;
    color: #F7941D !important;
    outline: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

/* Skip this item — small white pill aligned left */
/* Skip — a plain, quiet text button (no pill/bubble), centred under the
   primary actions. */
.shop-online-skip-pill {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    align-self: center;
    height: 40px !important;
    padding: 0 16px !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    font-family: 'Quicksand', sans-serif !important;
    background: transparent !important;
    color: #A29D94 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    margin: 0;
}

.shop-online-skip-pill svg {
    color: #C7C1B8;
    flex-shrink: 0;
}

.shop-online-skip-pill span {
    margin: 0;
}

.shop-online-skip-pill:active { opacity: 0.6; }

.shop-online-skip-pill:hover,
.shop-online-skip-pill:focus,
.shop-online-skip-pill:visited {
    background: transparent !important;
    color: #A29D94 !important;
    outline: none !important;
    box-shadow: none !important;
    opacity: 1;
}

@media (hover: none), (pointer: coarse) {
    .shop-online-skip-pill:active {
        opacity: 1 !important;
        background: transparent !important;
    }
    .shop-online-btn-done:active {
        background: #FFFFFF !important;
    }
}

/* Store picker buttons — off-white with brand badge on the left */
.shop-online-store-btn {
    display: flex !important;
    align-items: center !important;
    gap: 14px;
    width: 100% !important;
    height: 56px !important;
    padding: 0 20px !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    font-family: 'Quicksand', sans-serif !important;
    background: #FAF8F5 !important;
    color: #2D2D2D !important;
    border: 1.5px solid #F7941D !important;
    border-radius: 18px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    cursor: pointer;
    text-align: left !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.shop-online-store-btn:active {
    background: #F0EBE5 !important;
}

.shop-online-store-btn:hover,
.shop-online-store-btn:focus,
.shop-online-store-btn:visited {
    background: #FAF8F5 !important;
    color: #2D2D2D !important;
    outline: none !important;
}

.shop-online-store-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0;
    overflow: hidden;
}

.shop-online-store-logo img {
    max-width: 30px;
    max-height: 30px;
    object-fit: contain;
    display: block;
    margin: 0;
}

.shop-online-store-label {
    flex: 1;
    margin: 0;
}

/* Store footer */
.shop-online-store-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #999999;
    margin: 0;
    padding: 10px 0 0 0;
    flex-shrink: 0;
}

.shop-online-footer-logo {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #FFFFFF;
    object-fit: contain;
    padding: 2px;
    box-sizing: border-box;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.shop-online-footer-sep {
    color: #DDDDDD;
}

.shop-online-store-footer strong {
    color: #666666;
}

.shop-online-change-store {
    color: #F7941D;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
