/* ==========================================================================
   Gentora quick-add sheet (card "Select size" / "Choose options")
   Mobile: bottom sheet · Desktop: centred dialog. Uses --brand-* tokens.
   ========================================================================== */
.gjqa-root { position: fixed; inset: 0; z-index: 1080; display: flex; align-items: flex-end; justify-content: center; }
.gjqa-root[hidden] { display: none; }
.gjqa-backdrop { position: absolute; inset: 0; background: rgba(31, 26, 23, .48); opacity: 0; transition: opacity .25s ease; }
.gjqa-root.is-open .gjqa-backdrop { opacity: 1; }

.gjqa-sheet {
    position: relative; width: 100%; max-height: 88vh; display: flex; flex-direction: column;
    background: var(--brand-bg, #fff); color: var(--brand-ink, #1F1A17);
    border-radius: 18px 18px 0 0; box-shadow: 0 -8px 32px rgba(0,0,0,.16);
    transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
    font-family: var(--brand-font-sans, inherit); outline: none;
}
.gjqa-root.is-open .gjqa-sheet { transform: translateY(0); }
.gjqa-handle { width: 40px; height: 4px; border-radius: 4px; background: #D9D2C8; margin: 8px auto 0; flex-shrink: 0; }
.gjqa-close {
    position: absolute; top: 10px; right: 10px; z-index: 3; width: 44px; height: 44px; border-radius: 50%;
    border: 0; background: rgba(255,255,255,.92); color: var(--brand-ink, #1F1A17); font-size: 22px;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.gjqa-close:hover { background: #fff; }
.gjqa-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1; min-height: 0; }

/* Skeleton */
.gjqa-skel { padding: 16px; display: grid; gap: 12px; }
.gjqa-skel span { display: block; border-radius: 8px; background: linear-gradient(90deg, #F1ECE5 25%, #F8F4EE 37%, #F1ECE5 63%); background-size: 400% 100%; animation: gjqa-shimmer 1.2s ease infinite; }
.gjqa-skel .s-img { aspect-ratio: 1; max-height: 42vh; }
.gjqa-skel .s-line { height: 16px; }
.gjqa-skel .s-line.short { width: 40%; }
.gjqa-skel .s-chips { height: 48px; }
@keyframes gjqa-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* Layout */
.gjqa-grid { display: block; }
.gjqa-gallery { position: relative; background: var(--brand-ivory, #FAF6F0); }
.gjqa-slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gjqa-slides::-webkit-scrollbar { display: none; }
.gjqa-slide { flex: 0 0 100%; width: 100%; aspect-ratio: 1; max-height: 40vh; object-fit: contain; scroll-snap-align: center; background: var(--brand-ivory, #FAF6F0); }
.gjqa-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.gjqa-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(31,26,23,.25); transition: width .2s; }
.gjqa-dots span.is-active { width: 16px; border-radius: 4px; background: var(--brand-primary, #6E2433); }
.gjqa-info { padding: 16px 16px 8px; }

.gjqa-title { font-family: var(--brand-font-serif, Georgia, serif); font-size: 19px; line-height: 1.3; font-weight: 600; margin: 0 48px 6px 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gjqa-rating { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--brand-muted, #6F655C); text-decoration: none; margin-bottom: 6px; }
.gjqa-rating b { color: var(--brand-ink, #1F1A17); }
.gjqa-star { color: var(--brand-gold, #B08A4E); }
.gjqa-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.gjqa-price-now { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.gjqa-price-now small { font-size: 13px; font-weight: 500; color: var(--brand-muted, #6F655C); }
.gjqa-price-was { color: var(--brand-muted, #6F655C); font-size: 14px; }
.gjqa-price-off { color: var(--brand-success, #1F7A4D); font-weight: 700; font-size: 14px; }
.gjqa-tax { font-size: 12px; color: var(--brand-muted, #6F655C); margin: 2px 0 10px; }
.gjqa-best { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; background: #EEF7F1; color: var(--brand-success, #1F7A4D); font-size: 13px; margin-bottom: 12px; }
.gjqa-best[hidden] { display: none; }
.gjqa-best i { font-size: 16px; }

/* Options */
.gjqa-opt { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
.gjqa-opt-head { display: flex; align-items: center; justify-content: space-between; width: 100%; font-size: 14px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.gjqa-opt-val { color: var(--brand-primary, #6E2433); }
.gjqa-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gjqa-chip {
    min-width: 48px; height: 48px; padding: 0 12px; border-radius: 10px; border: 1px solid #D6CEC3; background: #fff;
    color: var(--brand-ink, #1F1A17); font-size: 15px; font-weight: 600; cursor: pointer; position: relative; overflow: hidden;
    transition: border-color .15s, background .15s, color .15s;
}
.gjqa-chip:hover { border-color: var(--brand-ink, #1F1A17); }
.gjqa-chip[aria-checked="true"] { background: var(--brand-primary, #6E2433); border-color: var(--brand-primary, #6E2433); color: #fff; }
.gjqa-chip.is-oos { color: #A29789; background: #F7F4F0; border-style: dashed; }
.gjqa-chip.is-oos::after { content: ''; position: absolute; left: -4px; right: -4px; top: 50%; height: 1px; background: #B9AEA2; transform: rotate(-35deg); }
.gjqa-chip.is-oos[aria-checked="true"] { background: #EFE9E2; color: var(--brand-ink, #1F1A17); border-color: var(--brand-ink, #1F1A17); }
.gjqa-color { width: 44px; height: 44px; border-radius: 50%; border: 2px solid transparent; padding: 3px; background: #fff; cursor: pointer; }
.gjqa-color span { display: block; width: 100%; height: 100%; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }
.gjqa-color[aria-checked="true"] { border-color: var(--brand-primary, #6E2433); }
.gjqa-color.is-oos { opacity: .4; }
.gjqa-chip:focus-visible, .gjqa-color:focus-visible, .gjqa-btn:focus-visible, .gjqa-link:focus-visible, .gjqa-qty-btn:focus-visible, .gjqa-close:focus-visible {
    outline: 2px solid var(--brand-gold, #B08A4E); outline-offset: 2px;
}
.gjqa-opt.is-invalid .gjqa-chips { animation: gjqa-shake .4s ease; }
.gjqa-opt.is-invalid .gjqa-chip:not(.is-oos) { border-color: var(--brand-danger, #B42318); }
@keyframes gjqa-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.gjqa-err { color: var(--brand-danger, #B42318); font-size: 13px; font-weight: 600; min-height: 0; }
.gjqa-err:not(:empty) { margin: -4px 0 10px; }

.gjqa-link { border: 0; background: none; padding: 6px 0; min-height: 32px; color: var(--brand-primary, #6E2433); font-weight: 600; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.gjqa-guide { margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--brand-ivory, #FAF6F0); font-size: 12.5px; }
.gjqa-guide p { margin: 0 0 8px; color: var(--brand-muted, #6F655C); }
.gjqa-guide table { width: 100%; border-collapse: collapse; }
.gjqa-guide th, .gjqa-guide td { padding: 6px 4px; text-align: left; border-bottom: 1px solid #ECE5DB; }
.gjqa-guide th { font-weight: 600; color: var(--brand-muted, #6F655C); }
.gjqa-note { font-size: 13px; color: var(--brand-muted, #6F655C); margin: -4px 0 12px; display: flex; gap: 6px; align-items: center; }

.gjqa-qty-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; }
.gjqa-qty-row .gjqa-opt-head { width: auto; margin: 0; }
.gjqa-qty { display: inline-flex; align-items: center; border: 1px solid #D6CEC3; border-radius: 10px; overflow: hidden; }
.gjqa-qty-btn { width: 44px; height: 44px; border: 0; background: #fff; font-size: 20px; cursor: pointer; color: var(--brand-ink, #1F1A17); }
.gjqa-qty-btn:disabled { color: #C9C0B4; cursor: not-allowed; }
.gjqa-qty input { width: 44px; height: 44px; border: 0; text-align: center; font-size: 16px; font-weight: 600; -moz-appearance: textfield; }
.gjqa-qty input::-webkit-outer-spin-button, .gjqa-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.gjqa-stock { font-size: 13px; color: #B45309; font-weight: 600; margin: 0 0 8px; }

.gjqa-notify { margin: 8px 0 4px; padding: 14px; border-radius: 12px; border: 1px solid var(--brand-border, #E9E2D8); background: var(--brand-ivory, #FAF6F0); }
.gjqa-notify[hidden] { display: none; }
.gjqa-notify-title { font-weight: 700; margin: 0 0 4px; display: flex; gap: 6px; align-items: center; }
.gjqa-notify-sub { font-size: 13px; color: var(--brand-muted, #6F655C); margin: 0 0 10px; }
.gjqa-notify-row { display: flex; border: 1px solid #D6CEC3; border-radius: 10px; overflow: hidden; background: #fff; margin-bottom: 8px; }
.gjqa-cc { padding: 0 12px; display: flex; align-items: center; font-weight: 600; border-right: 1px solid #D6CEC3; background: var(--brand-ivory, #FAF6F0); }
.gjqa-notify-phone { flex: 1; border: 0; height: 46px; padding: 0 12px; font-size: 16px; min-width: 0; }
.gjqa-consent { display: flex; gap: 8px; align-items: center; font-size: 12.5px; margin: 0 0 10px; }
.gjqa-notify .gjqa-btn { width: 100%; }
.gjqa-notify-msg { font-size: 13px; margin: 8px 0 0; }
.gjqa-notify-msg.is-ok { color: var(--brand-success, #1F7A4D); }
.gjqa-notify-msg.is-err { color: var(--brand-danger, #B42318); }

.gjqa-details { margin: 4px 0 8px; }

/* Footer */
.gjqa-footer {
    position: sticky; bottom: 0; display: flex; gap: 10px; align-items: center; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--brand-border, #E9E2D8); z-index: 2;
}
.gjqa-footer-price { display: none; }
.gjqa-btn { min-height: 50px; padding: 0 16px; border-radius: 10px; font-weight: 700; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s; }
.gjqa-btn-primary { flex: 1.4; background: var(--brand-primary, #6E2433); border: 1px solid var(--brand-primary, #6E2433); color: #fff; }
.gjqa-btn-primary:hover { background: var(--brand-primary-hover, #5A1C29); }
.gjqa-btn-outline { flex: 1; background: #fff; border: 1px solid var(--brand-ink, #1F1A17); color: var(--brand-ink, #1F1A17); }
.gjqa-btn-outline:hover { background: var(--brand-ivory, #FAF6F0); }
.gjqa-btn[disabled], .gjqa-btn.is-busy { opacity: .6; cursor: progress; }
/* Sold-out option: the notify-me box has its own button, so the footer steps aside */
.gjqa-footer.is-soldout { display: none; }

/* Desktop: centred dialog, image left / options right */
@media (min-width: 768px) {
    .gjqa-root { align-items: center; padding: 24px; }
    .gjqa-sheet { max-width: 760px; max-height: 86vh; border-radius: 16px; transform: translateY(12px) scale(.98); opacity: 0; transition: transform .25s ease, opacity .25s ease; }
    .gjqa-root.is-open .gjqa-sheet { transform: none; opacity: 1; }
    .gjqa-handle { display: none; }
    .gjqa-grid { display: grid; grid-template-columns: 44% 56%; }
    .gjqa-gallery { border-radius: 16px 0 0 0; overflow: hidden; align-self: start; position: sticky; top: 0; }
    .gjqa-slide { max-height: none; }
    .gjqa-info { padding: 22px 24px 10px; }
    .gjqa-skel { grid-template-columns: 44% 1fr; align-items: start; }
    .gjqa-skel .s-img { grid-row: span 5; max-height: none; }
    .gjqa-footer { padding: 14px 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .gjqa-sheet, .gjqa-backdrop, .gjqa-dots span { transition: none !important; }
    .gjqa-skel span, .gjqa-opt.is-invalid .gjqa-chips { animation: none !important; }
}
body.gjqa-lock { overflow: hidden; }
