/* ============================================================
   OSPA - Shop (/shop/) · products from Buyz
   ============================================================ */

.shop-hero {
    padding: 40px 0 24px;
    background: radial-gradient(120% 100% at 50% 0%, #f4f1ea 0%, var(--canvas) 70%);
    text-align: center;
}
.shop-hero .breadcrumbs { justify-content: center; margin-bottom: var(--sp-md); }
.shop-hero h1 {
    font-size: clamp(32px, 5vw, 52px);
    letter-spacing: -1.5px;
    margin: var(--sp-md) auto var(--sp-sm);
}
.shop-mark {
    background: linear-gradient(transparent 62%, #e8dcc6 62%);
    padding-inline: 4px;
}
.shop-hero-sub {
    max-width: 620px;
    margin: 0 auto;
    font-size: 17px;
    color: var(--muted);
    line-height: 1.65;
}

.shop-section { padding-top: 24px; }

/* Result banner (after payment) */
.shop-result {
    display: flex; gap: var(--sp-md); align-items: center;
    margin: var(--sp-md) 0;
    padding: var(--sp-md) var(--sp-lg);
    border-radius: var(--r-xl);
}
.shop-result p { margin: 4px 0 0; font-size: 15px; }
.shop-result--ok { background: #ecfdf5; color: #065f46; }
.shop-result--err { background: #fef2f2; color: #991b1b; }
.shop-result-icon {
    flex: none; width: 44px; height: 44px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--success); color: #fff;
}
.shop-result-icon svg { width: 24px; height: 24px; }

/* Filters */
.shop-filters {
    display: flex; gap: var(--sp-xs);
    overflow-x: auto; scrollbar-width: none;
    padding-bottom: 4px;
    margin-bottom: var(--sp-lg);
    justify-content: center;
}
.shop-filters::-webkit-scrollbar { display: none; }
.shop-chip {
    flex: none;
    display: inline-flex; align-items: center; gap: 6px;
    height: 38px; padding: 0 16px;
    border-radius: var(--r-pill);
    border: 1px solid var(--hairline);
    background: var(--canvas);
    color: var(--ink);
    font: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.shop-chip span { font-size: 12px; color: var(--muted); font-weight: 500; }
.shop-chip:hover { border-color: var(--ink); }
.shop-chip.is-active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.shop-chip.is-active span { color: var(--on-dark-soft); }

/* Grid */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--sp-lg);
}
.shop-card {
    display: flex; flex-direction: column;
    background: var(--canvas);
    border: 1px solid var(--hairline-soft);
    border-radius: var(--r-xl);
    overflow: hidden;
    transition: box-shadow var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}
.shop-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.shop-card[hidden] { display: none; }
.shop-card.is-out .shop-card-media img { opacity: .45; filter: grayscale(.4); }

.shop-card-media {
    position: relative; display: block; width: 100%;
    aspect-ratio: 1 / 1; overflow: hidden;
    background: var(--surface-soft);
    border: 0; padding: 0; cursor: zoom-in;
}
.shop-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shop-tag {
    position: absolute; z-index: 1; top: 12px; inset-inline-start: 12px;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    background: #DBD7CB; color: #514c40;
    font-size: 12px; font-weight: 700;
}
.shop-tag--low { background: #ffedd5; color: #9a3412; inset-inline-start: auto; inset-inline-end: 12px; }
.shop-tag--out { background: var(--surface-strong); color: var(--muted); inset-inline-start: auto; inset-inline-end: 12px; }
.shop-modal .shop-tag { position: static; }

.shop-card-body {
    display: flex; flex-direction: column; gap: 6px;
    flex: 1;
    padding: var(--sp-md);
}
.shop-card-title { font-size: 16px; font-weight: 700; line-height: 1.4; letter-spacing: -0.2px; margin: 0; }
.shop-card-desc {
    font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.shop-card-foot {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-xs);
    margin-top: auto; padding-top: var(--sp-sm);
}
.shop-price { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; color: var(--ink); }
.shop-add { min-width: 108px; }

.shop-empty { text-align: center; padding: 48px 0; }
.shop-empty p { color: var(--muted); margin-bottom: var(--sp-md); }

/* Floating cart */
.shop-fab {
    position: fixed; z-index: 900;
    bottom: 20px; inset-inline-start: 50%; transform: translateX(50%);
    display: inline-flex; align-items: center; gap: 10px;
    height: 56px; padding: 0 22px;
    border: 0; border-radius: var(--r-pill);
    background: var(--primary); color: var(--on-primary);
    font: inherit; font-size: 15px; font-weight: 700;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
    cursor: pointer;
}
.shop-fab[hidden] { display: none; }
.shop-fab svg { width: 22px; height: 22px; }
.shop-fab-count {
    min-width: 24px; height: 24px; padding: 0 6px;
    display: grid; place-items: center;
    border-radius: var(--r-pill);
    background: #e8dcc6; color: var(--ink);
    font-size: 13px;
}
.shop-fab-total { opacity: .85; font-weight: 600; }
.shop-fab.is-bump { animation: shopBump .4s var(--ease-spring); }
@keyframes shopBump { 50% { transform: translateX(50%) scale(1.08); } }

/* Drawer + modal */
.shop-drawer { position: fixed; inset: 0; z-index: 1000; visibility: hidden; }
.shop-drawer.is-open { visibility: visible; }
.shop-drawer-backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, .4);
    opacity: 0; transition: opacity var(--dur-med) ease;
}
.shop-drawer.is-open .shop-drawer-backdrop { opacity: 1; }
.shop-drawer-panel {
    position: absolute; top: 0; bottom: 0; inset-inline-start: 0;
    width: min(440px, 100%);
    display: flex; flex-direction: column;
    background: var(--canvas);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--dur-med) var(--ease-out);
}
.shop-drawer.is-open .shop-drawer-panel { transform: none; }
body.shop-lock { overflow: hidden; }

.shop-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--sp-md) var(--sp-lg);
    border-bottom: 1px solid var(--hairline-soft);
}
.shop-drawer-head h2 { font-size: 20px; margin: 0; }
.shop-x {
    width: 36px; height: 36px; border-radius: 50%;
    border: 0; background: var(--surface-card); color: var(--ink);
    font-size: 15px; cursor: pointer;
}
.shop-drawer-body { flex: 1; overflow-y: auto; padding: var(--sp-md) var(--sp-lg); }
.shop-drawer-foot { padding: var(--sp-md) var(--sp-lg) var(--sp-lg); border-top: 1px solid var(--hairline-soft); }
.shop-total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--sp-sm); }
.shop-total-row strong { font-size: 22px; letter-spacing: -0.5px; }
.shop-secure { text-align: center; font-size: 12px; color: var(--muted); margin: var(--sp-xs) 0 0; }
#shopPay:disabled { opacity: .5; cursor: not-allowed; }

.shop-lines { display: flex; flex-direction: column; gap: var(--sp-sm); margin-bottom: var(--sp-lg); }
.shop-lines-empty { color: var(--muted); text-align: center; padding: 24px 0; }
.shop-line { display: flex; align-items: center; gap: var(--sp-sm); }
.shop-line img, .shop-line-ph { flex: none; width: 56px; height: 56px; border-radius: var(--r-md); object-fit: cover; background: var(--surface-soft); }
.shop-line-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shop-line-info strong { font-size: 14px; line-height: 1.35; }
.shop-line-info span { font-size: 13px; color: var(--muted); }
.shop-qty { display: flex; align-items: center; gap: 4px; border: 1px solid var(--hairline); border-radius: var(--r-pill); padding: 2px; }
.shop-qty button {
    width: 28px; height: 28px; border-radius: 50%;
    border: 0; background: transparent; color: var(--ink);
    font-size: 16px; cursor: pointer;
}
.shop-qty button:hover:not(:disabled) { background: var(--surface-card); }
.shop-qty button:disabled { opacity: .3; cursor: not-allowed; }
.shop-qty span { min-width: 18px; text-align: center; font-weight: 700; font-size: 14px; }

.shop-form h3 { font-size: 16px; margin-bottom: var(--sp-sm); }
.shop-form[hidden] { display: none; }
.shop-form > label, .shop-address label {
    display: flex; flex-direction: column; gap: 4px;
    font-size: 13px; font-weight: 600; color: var(--body);
    margin-bottom: var(--sp-sm);
}
.shop-form small { font-weight: 400; color: var(--muted); }
.shop-form input:not([type=radio]), .shop-form textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    font: inherit; font-size: 16px; color: var(--ink);
    background: var(--canvas);
}
.shop-form input:focus, .shop-form textarea:focus { outline: none; border-color: var(--ink); }
.shop-form input[dir=ltr] { text-align: right; }
.shop-ship { border: 0; padding: 0; margin: 0 0 var(--sp-sm); }
.shop-ship legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.shop-radio {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px; margin-bottom: 6px;
    border: 1px solid var(--hairline); border-radius: var(--r-lg);
    cursor: pointer;
}
.shop-radio:has(input:checked) { border-color: var(--ink); background: var(--surface-soft); }
.shop-radio input { margin-top: 3px; accent-color: var(--primary); }
.shop-radio span { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.shop-address[hidden] { display: none; }
.shop-error {
    padding: 10px 12px; border-radius: var(--r-md);
    background: #fef2f2; color: #991b1b; font-size: 14px;
}
.shop-error[hidden] { display: none; }

/* Product modal */
.shop-modal-card {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -46%);
    width: min(520px, calc(100% - 32px));
    max-height: calc(100% - 48px); overflow-y: auto;
    padding: var(--sp-lg);
    background: var(--canvas);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: opacity var(--dur-med) ease, transform var(--dur-med) var(--ease-out);
}
.shop-modal.is-open .shop-modal-card { opacity: 1; transform: translate(-50%, -50%); }
.shop-modal-card .shop-x { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 1; }
.shop-modal-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-lg); margin-bottom: var(--sp-md); background: var(--surface-soft); }
.shop-modal-card h2 { font-size: 22px; letter-spacing: -0.5px; margin-bottom: var(--sp-xs); }
.shop-modal-card p, .shop-modal-card li { color: var(--body); font-size: 15px; line-height: 1.6; }
.shop-modal-card ul { padding-inline-start: 20px; margin-bottom: var(--sp-sm); list-style: disc; }

@media (max-width: 767px) {
    .shop-hero { padding-top: 24px; }
    .shop-hero-sub { font-size: 15px; }
    .shop-filters { justify-content: flex-start; margin-inline: calc(var(--sp-lg) * -1); padding-inline: var(--sp-lg); }
    .shop-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-sm); }
    .shop-card-body { padding: var(--sp-sm); }
    .shop-card-title { font-size: 14px; }
    .shop-card-desc { display: none; }
    .shop-card-foot { flex-direction: column; align-items: stretch; }
    .shop-price { font-size: 17px; }
    .shop-add, .shop-card-foot .btn { min-width: 0; width: 100%; height: 36px; padding: 8px; font-size: 13px; }
    .shop-fab { width: calc(100% - 32px); justify-content: center; bottom: 16px; }
    .shop-drawer-panel { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .shop-card, .shop-drawer-panel, .shop-modal-card, .shop-drawer-backdrop { transition: none; }
    .shop-fab.is-bump { animation: none; }
}
