/* Yuminaga wholesale cart — minimalist slide-out drawer (reference: boutique PDP “bag”) */
.wholesale-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.wholesale-cart-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.wholesale-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    height: 100dvh;
    width: min(380px, 100vw);
    max-width: 100%;
    background: #ffffff;
    z-index: 201;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
}

.wholesale-cart-drawer.is-open {
    transform: translateX(0);
}

.wholesale-cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid #eaeaea;
    flex-shrink: 0;
}

.wholesale-cart-drawer-title {
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #111;
    flex: 1;
    text-align: center;
    margin: 0 0.5rem;
}

.wholesale-cart-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: transparent;
    color: #111;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.wholesale-cart-icon-btn:hover {
    background: #f5f5f5;
}

.wholesale-cart-nav-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: #111;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.15s ease;
}

.wholesale-cart-nav-trigger:hover {
    background: #fff;
    transform: scale(1.02);
}

.wholesale-cart-nav-trigger:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.wholesale-cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.28rem;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
    border-radius: 9999px;
    background: #111;
    color: #fff;
    transform: translate(18%, -18%);
    display: none;
}

.wholesale-cart-badge.is-visible {
    display: inline-block;
}

/* Mobile-only bag button beside hamburger */
@media (max-width: 768px) {
    #wholesale-cart-toggle-mobile.wholesale-cart-nav-trigger {
        position: fixed !important;
        top: 20px !important;
        right: 4.75rem !important;
        padding: 0.55rem !important;
        z-index: 102 !important;
    }
}

.wholesale-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem 1.5rem;
    -webkit-overflow-scrolling: touch;
}

.wholesale-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
    min-height: 12rem;
    color: #333;
}

.wholesale-cart-empty p {
    font-size: 0.9375rem;
    font-weight: 500;
    margin: 0 0 1.5rem;
}

.wholesale-cart-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 16rem;
    padding: 0.875rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: #111;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.wholesale-cart-pill-btn:hover {
    background: #222;
}

.wholesale-cart-pill-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.wholesale-cart-line {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.wholesale-cart-line-thumb {
    width: 3.75rem;
    height: 3.75rem;
    flex-shrink: 0;
    border-radius: 0.5rem;
    object-fit: cover;
    background: #f8f8f8;
    border: 1px solid #eaeaea;
}

.wholesale-cart-line-thumb.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #999;
    text-align: center;
    padding: 0.25rem;
}

.wholesale-cart-line-meta {
    flex: 1;
    min-width: 0;
}

.wholesale-cart-line-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111;
    margin: 0 0 0.5rem;
    line-height: 1.35;
}

.wholesale-cart-qty-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wholesale-cart-qty-btn {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #111;
}

.wholesale-cart-qty-btn:hover {
    border-color: #111;
}

.wholesale-cart-remove {
    font-size: 0.75rem;
    color: #666;
    text-decoration: underline;
    text-underline-offset: 2px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 0.25rem;
}

.wholesale-cart-footer {
    margin-top: 1rem;
    padding-top: 0.5rem;
}

.wholesale-cart-footer-note {
    font-size: 0.6875rem;
    color: #777;
    line-height: 1.45;
    margin-top: 1rem;
}

.wholesale-cart-stripe-note {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.wholesale-cart-checkout-btn {
    background: #203c2b;
    margin-top: 0;
}

.wholesale-cart-checkout-btn:hover:not(:disabled) {
    background: #2a4d36;
}

.wholesale-cart-checkout-btn:disabled {
    cursor: wait;
    opacity: 0.85;
}

.wholesale-cart-checkout-error {
    font-size: 0.75rem;
    color: #b42318;
    line-height: 1.4;
    margin: 0.5rem 0 0;
}

.wholesale-cart-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0.875rem;
    padding: 0.65rem 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
    background: #111;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.wholesale-cart-add-btn:hover {
    background: #222;
}

.wholesale-cart-add-btn:active {
    opacity: 0.9;
}

@media (prefers-reduced-motion: reduce) {
    .wholesale-cart-overlay,
    .wholesale-cart-drawer,
    .wholesale-cart-nav-trigger {
        transition: none;
    }
}

body.wholesale-cart-drawer-open {
    overflow: hidden;
}

/* Matcha product detail (Rocky-style) — opens above cart drawer */
.matcha-product-modal {
    position: fixed;
    inset: 0;
    z-index: 310;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.matcha-product-modal[hidden] {
    display: none !important;
}

.matcha-product-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.matcha-product-modal__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 920px;
    max-height: min(92vh, 880px);
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
    padding: 1.35rem 1.5rem 1.5rem;
}

.matcha-product-modal__close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #333;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 9999px;
    transition: background 0.15s ease;
}

.matcha-product-modal__close:hover {
    background: #f3f3f3;
}

.matcha-product-modal__grid {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 768px) {
    .matcha-product-modal__grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    }
}

.matcha-product-modal__media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    background: #faf9f7;
}

.matcha-product-modal__title {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.35;
    margin: 0 0 1rem;
    padding-right: 2.5rem;
    color: #111;
}

.matcha-product-modal__slot {
    max-width: 340px;
}

/* Purchase type / subscription UI only in the modal — not on the catalog grid */
#matcha-ceremonial-yoshi article .matcha-purchase-slot-host,
#matcha-ceremonial-haru article .matcha-purchase-slot-host,
#matcha-premium article .matcha-purchase-slot-host,
#matcha-kai article .matcha-purchase-slot-host {
    display: none !important;
}

#matcha-product-modal-slot .matcha-purchase-slot-host {
    display: block !important;
    max-width: none !important;
}

.matcha-product-modal__add {
    margin-top: 1.25rem;
    width: 100%;
    max-width: 340px;
    padding: 0.9rem 1rem;
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
    background: #111;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.matcha-product-modal__add:hover {
    background: #222;
}

.matcha-product-modal__add:active {
    opacity: 0.92;
}

body.matcha-product-modal-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .matcha-product-card-hit {
        transition: none;
    }
}

/* Two-image fade for Matcha Haru conventional (Haru 2 / Haru 3) */
.matcha-card-slideshow {
    position: relative;
}

.matcha-card-slideshow__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 0.55s ease;
}

.matcha-card-slideshow__img.is-active {
    opacity: 1;
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    .matcha-card-slideshow__img {
        transition: none;
    }
}

/* Portal / account catalog grids: equal row height, align CTAs across cards */
#catalog-main .catalog-panel > .grid > article.flex.flex-col.items-center.text-center {
    height: 100%;
    align-self: stretch;
    min-height: 0;
}

/* Matcha: grow the clickable card so "View details" sits on a shared baseline per row */
#matcha-ceremonial-yoshi article .matcha-product-card-hit,
#matcha-ceremonial-haru article .matcha-product-card-hit,
#matcha-premium article .matcha-product-card-hit,
#matcha-kai article .matcha-product-card-hit {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    max-width: 280px;
    min-height: 0;
    align-items: center;
    text-align: center;
}

#matcha-ceremonial-yoshi article .matcha-product-card-hit > p:last-of-type,
#matcha-ceremonial-haru article .matcha-product-card-hit > p:last-of-type,
#matcha-premium article .matcha-product-card-hit > p:last-of-type,
#matcha-kai article .matcha-product-card-hit > p:last-of-type {
    margin-top: auto;
    padding-top: 0.5rem;
}

/* Spice wholesale catalog: same card-hit flex layout as matcha grids */
#catalog-main article .matcha-product-card-hit {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    max-width: 280px;
    min-height: 0;
    align-items: center;
    text-align: center;
}

#catalog-main article .matcha-product-card-hit > p:last-of-type {
    margin-top: auto;
    padding-top: 0.5rem;
}

.matcha-product-modal__media-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    background: #faf9f7;
    color: #6b7d72;
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    padding: 1rem;
    box-sizing: border-box;
}

#catalog-main
    .catalog-panel
    > .grid
    > article.flex.flex-col.items-center.text-center:has(.matcha-product-card-hit)
    > .wholesale-cart-add-btn {
    margin-top: 0.75rem;
    flex-shrink: 0;
}

/* Spices & other grid cards (image + title + add): pin button to card bottom */
#catalog-main
    .catalog-panel
    > .grid
    > article.flex.flex-col.items-center.text-center:not(:has(.matcha-product-card-hit))
    > .wholesale-cart-add-btn {
    margin-top: auto;
    flex-shrink: 0;
}
