/* ============================================================
   tailwind-functional.css
   JS-dependent functional styles for the Tailwind layout.
   No Bootstrap. No layout opinions. Pure behavior CSS.
   ============================================================ */

/* ── Base ───────────────────────────────────────────────────── */
html, body { height: 100%; }
.hide { display: none !important; }
input.hide {
    display: block !important;
    position: absolute;
    width: 0; height: 0;
    opacity: 0;
    pointer-events: none;
    margin: 0; padding: 0; border: 0;
}

/* ── Scroll wrapper ─────────────────────────────────────────── */
.scroll-wrapper {
    width: 100%;
    white-space: nowrap;
    overflow-y: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Error ──────────────────────────────────────────────────── */
.error { position: relative; }
.error input { border: solid 1px red !important; }
.error-message {
    color: red;
    font-weight: 600;
    max-width: 400px;
    margin: 0 auto;
    font-size: 11px;
    position: absolute;
}

/* ── Pac container (Google autocomplete) ───────────────────── */
.pac-container { z-index: 1051 !important; }

/* ── Unit badges ────────────────────────────────────────────── */
.product-menu .unit-size-badge {
    border-color: #2d87e2 !important;
    color: #2d87e2 !important;
    display: none;
    width: 100%;
}
.product-menu .has-cart-quantity:hover .unit-size-badge,
.product-menu .flyout-toggle-active .unit-size-badge {
    background-color: #c2dffc;
    display: inline-block;
}
.product-menu .unit-quantity-badge {
    border-color: #2d87e2 !important;
    color: #2d87e2 !important;
    width: 100%;
}
.product-menu .has-cart-quantity:hover .unit-quantity-badge,
.product-menu .flyout-toggle-active .unit-quantity-badge { display: none; }

/* ── Item quantity wrapper ──────────────────────────────────── */
.item-quantity-wrapper { position: relative; }
.product-menu.tiled-view .item-quantity-wrapper { width: 100%; }

/* ── Circle icons ───────────────────────────────────────────── */
.circle-plus-icon {
    font-size: 8px;
    background-color: #efefef;
    border-radius: 50%;
    max-width: 16px; max-height: 16px;
}
.circle-plus-icon:not(:hover) { color: #606060 !important; }
.circle-quantity-icon {
    font-size: 8px;
    border-radius: 50%;
    max-width: 16px; max-height: 16px;
    background-color: #efefef;
}
.product-menu .circle-quantity-icon {
    border-color: #2d87e2 !important;
    color: #2d87e2 !important;
}
.product-menu .circle-quantity-icon:hover { background-color: #c2dffc; }
.product-menu.tiled-view .circle-quantity-icon {
    position: absolute;
    right: -9px; top: -3px;
}
.item-quantity-add.negativeInventory { color: #d9534f; }
.fa-item-quantity { font-weight: 500; font-size: 1.4em; }

/* Flyout quantity counts — hidden at render, shown by JS */
/* .product-menu.tiled-view .item-quantity-wrapper .has-cart-quantity { display: none; } */

/* ── Flyout ─────────────────────────────────────────────────── */
.flyout-toggle { cursor: pointer; display: inline-block; }

.flyout {
    position: absolute;
    transform-origin: right top;
    top: -24px; right: 20px;
    z-index: 6;
    transform: scale(0);
    transition: all 0.1s linear 0s;
    width: 120px;
    overflow: hidden;
}
.flyout.flyout-show { transform: scale(1); overflow: visible; }
.flyout .flyout-container {
    width: 90%;
    border-radius: 5rem;
    padding: 0.5rem;
    background: white;
    display: flex;
    box-shadow: 0 0.2rem 3rem rgba(0,0,0,0.3);
    margin: 0 auto;
    justify-content: space-between;
}
.flyout .flyout-aligner { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.flyout .flyout-content  { display: flex; justify-content: space-between; align-items: center; flex: 1 1 0%; }
.flyout .flyout-button {
    background-color: transparent;
    border: 0; outline: none;
    font-weight: 400;
    text-align: center;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.15s ease;
}
.flyout .flyout-button:hover { opacity: 0.7; }
.flyout .fa-trash-alt { color: #d9534f; }
.flyout .flyout-middle { display: flex; align-items: center; flex-direction: column; }

/* ── Checkout bar ───────────────────────────────────────────── */
.checkout-bar-btn {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 600;
    transition: filter 0.15s ease;
}
.checkout-bar-btn:hover { filter: brightness(1.06); }
.checkout-bar__icon  { position: absolute; left: 14px; font-size: 14px; line-height: 1; }
.checkout-bar__total { position: absolute; right: 14px; font-size: 13px; line-height: 1; display: flex; align-items: center; }

/* ── Loading spinner ────────────────────────────────────────── */
.lds-ring {
    display: none;
    height: 1em; width: 1em;
    position: relative;
}
.lds-ring.active { display: inline-block; }
.lds-ring > div {
    animation: lds-ring 1.2s cubic-bezier(0.5,0,0.5,1) infinite;
    border: solid;
    border-color: #fff transparent transparent transparent;
    border-radius: 50%;
    box-sizing: border-box;
    display: block;
    height: inherit; width: inherit;
    position: absolute;
}
.lds-ring > div:nth-child(1) { animation-delay: -0.45s; }
.lds-ring > div:nth-child(2) { animation-delay: -0.3s; }
.lds-ring > div:nth-child(3) { animation-delay: -0.15s; }
.lds-ring-sm { width: 16px; height: 16px; }
.lds-ring-sm > div { border-width: 2px; }
.lds-ring-blue > div { border-color: #007bff transparent transparent transparent; }
.lds-ring-primary > div { border-color: var(--color-primary) transparent transparent transparent; }
@keyframes lds-ring {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ── Shake animation ────────────────────────────────────────── */
.negativeInventory { border: 0; position: relative; cursor: pointer; text-decoration: none; }
.negativeInventory:active { color: red; pointer-events: painted; animation: shakeAnim 0.4s ease; }
@keyframes shakeAnim {
    0%   { left: 0; color: red; }
    15%  { left: -4px; }
    30%  { left: 6px; }
    45%  { left: -8px; }
    60%  { left: 8px; }
    75%  { left: -4px; }
    90%  { left: 3px; }
    100% { left: 0; }
}

/* ── Skeleton loading ───────────────────────────────────────── */
.skeleton { position: relative; overflow: hidden; }
.skeleton::before {
    content: '';
    display: block;
    position: absolute;
    left: -150px; top: 0;
    height: 100%; width: 150px;
    background: linear-gradient(to right, transparent 0%, #E8E8E8 50%, transparent 100%);
    animation: load 1s cubic-bezier(0.4,0.0,0.2,1) infinite;
}
@keyframes load {
    from { left: -150px; }
    to   { left: 100%; }
}

/* ── Filter active state ────────────────────────────────────── */
.filter-menu-item.selected {
    border-color: #2d87e2 !important;
    color: #2d87e2 !important;
}

/* ── Item detail fill height ────────────────────────────────── */
.fill-main-height-sm { height: calc(100% - 65px); }
@media (min-width: 768px) { .fill-main-height-sm { height: calc(100% - 134px); } }

/* ── Badge (Bootstrap replacement) ─────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.25em 0.5em;
    font-size: 75%;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}
.badge-outline {
    border: solid 1px #ced4da;
    color: #212529;
    font-weight: 500;
    background: transparent;
    min-width: 2rem;
    text-align: center;
}

/* ── fa-stack (FontAwesome stack — Bootstrap/FA replacement) ── */
.fa-stack {
    display: inline-block;
    height: 2em;
    line-height: 2em;
    position: relative;
    vertical-align: middle;
    width: 2.5em;
}
.fa-stack-1x,
.fa-stack-2x {
    left: 0;
    position: absolute;
    text-align: center;
    width: 100%;
}
.fa-stack-1x { line-height: inherit; }
.fa-stack-2x { font-size: 2em; }

/* ── Loading blur ───────────────────────────────────────────── */
.loading-blur { filter: blur(0.15rem); opacity: .75; }

/* ── Tiled view item units ──────────────────────────────────── */
.product-menu.tiled-view .item-units-wrapper {
    margin: 12px 9px 58px 9px;
    position: relative;
}
.product-menu.tiled-view .item-units-scroller {
    white-space: nowrap;
    overflow-x: auto;
    padding-bottom: 10px;
}
.product-menu.tiled-view .unit {
    color: #212529;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 0 1px 4px 0;
    position: relative;
}
.product-menu.tiled-view .details-btn-wrapper {
    padding: 8px 10px;
    width: 100%;
    position: absolute;
    top: 256px;
    left: 0;
}
