/* Shared commerce component. Grids and shelves own layout, the card owns its contents. */
.ubx-product-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    container: unbox-product-card / inline-size;
    padding: 10px;
    border: 1px solid var(--ubx-line, #e4e1d6);
    border-radius: 18px;
    background: #fff;
    color: var(--ubx-ink, #20231f);
    font-family: var(--ub-body, Heebo, Arial, sans-serif);
    text-align: start;
    transition: box-shadow .2s;
}
.ubx-product-card:hover { box-shadow: 0 10px 28px #20231f12; }
.ubx-product-card *, .ubx-purchase * { box-sizing: border-box; }
.unbox-site .ubx-product-card a { color: inherit; text-decoration: none; }
.unbox-site .ubx-product-card .ubx-product-photo {
    position: relative;
    display: block;
    flex: none;
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.unbox-site .ubx-product-card .ubx-product-photo img,
.unbox-site .ubx-product-card .ubx-product-photo > svg {
    /* Match the frame height, preserve proportions and crop only the sides. */
    position: absolute;
    top: 0;
    left: 50%;
    display: block;
    width: auto;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    object-fit: contain;
    transform: translateX(-50%);
    filter: none;
}

.ubx-product-card .ubx-product-photo > .ubx-badge {
    position: absolute;
    z-index: 1;
    inset-block-start: 10px;
    inset-inline-start: 10px;
    display: inline-flex;
    align-items: center;
    max-width: calc(100% - 20px);
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--ubx-ink, #20231f);
    color: #fffef8;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}
.ubx-product-card .ubx-product-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 12px 8px 4px;
}
.ubx-product-card .ubx-product-category { font-size: 12px; line-height: 1.5; color: #6b6e63; }
.unbox-site .ubx-product-card .ubx-product-copy h3 {
    min-height: 1.2em;
    margin: 0;
    padding: 0;
    color: inherit;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.ubx-product-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; line-height: 1.5; color: #5b5e54; }
.ubx-product-meta > span { white-space: nowrap; }
.ubx-product-card .ubx-product-meta { padding-bottom: 12px; border-bottom: 1px solid #edeae0; }
.ubx-product-card .ubx-product-meta:empty { display: none; }
.ubx-product-card .ubx-product-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 3px 7px;
    padding-top: 8px;
    margin-top: auto;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.4;
}
.ubx-product-price .amount { white-space: nowrap; }
.ubx-product-price del { font-size: .75em; opacity: .6; font-weight: 400; }
.ubx-product-price ins { text-decoration: none; background: none; }
.ubx-product-price .woocommerce-price-suffix { font-size: .6em; font-weight: 400; }
.ubx-purchase { position: relative; min-width: 0; margin-top: 5px; font-family: var(--ub-body, Heebo, Arial, sans-serif); }
.unbox-site .ubx-purchase .ubx-buy {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    float: none;
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 10px 20px;
    border: 0;
    border-radius: 999px;
    background: var(--ubx-lime, #d6ee3f);
    box-shadow: none;
    color: var(--ubx-ink, #20231f);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    cursor: pointer;
}
.unbox-site .ubx-purchase .ubx-buy:hover { background: #c8e22a; color: var(--ubx-ink, #20231f); }
.ubx-purchase [hidden], .ubx-purchase .added_to_cart { display: none !important; }
.unbox-site .ubx-purchase .ubx-buy.added::after,
.unbox-site .ubx-purchase .ubx-buy.loading::after {
    position: static;
    margin: 0;
    font-family: inherit;
    line-height: 1;
    animation: none;
}
.unbox-site .ubx-purchase .ubx-buy.added::after { content: '✓'; }
.unbox-site .ubx-purchase .ubx-buy.loading { opacity: .6; pointer-events: none; }
.unbox-site .ubx-purchase .ubx-buy.loading::after { content: '…'; }
.ubx-quantity { display: flex; gap: 8px; width: 100%; height: 46px; }
.ubx-quantity > div {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    padding: 0 4px;
    border: 1.5px solid var(--ubx-ink, #20231f);
    border-radius: 999px;
}
.unbox-site .ubx-quantity button {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 42px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: var(--ubx-ink, #20231f);
    font-family: inherit;
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}
.ubx-quantity button:disabled { opacity: .35; cursor: default; }
.ubx-quantity output { min-width: 1.25em; font-size: 16px; font-weight: 800; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; }
body.unbox-site .ubx-quantity > a {
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 0;
    border-radius: 999px;
    background: var(--ubx-ink, #20231f);
    color: var(--ubx-paper, #f6f4ed);
    text-decoration: none;
}
.ubx-quantity .unbox-icon { display: block; width: 19px; height: 19px; }
.ubx-purchase[aria-busy=true] { opacity: .5; pointer-events: none; }
.ubx-product-card a:focus-visible,
.ubx-purchase :is(a, button, summary, select):focus-visible { outline: 2px solid #627d28; outline-offset: 4px; }

/* Native Woo variations retain the same purchase entry point as simple products. */
.ubx-purchase .unbox-card-options { margin: 0; padding: 0; border: 0; }
.unbox-site .ubx-purchase .unbox-card-options > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--ubx-lime, #d6ee3f);
    color: var(--ubx-ink, #20231f);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    list-style: none;
    cursor: pointer;
}
.ubx-purchase .unbox-card-options > summary::-webkit-details-marker { display: none; }
.ubx-purchase .unbox-card-options > summary::marker { content: ''; }
.ubx-purchase .unbox-card-options > summary .unbox-icon { flex: none; width: 17px; height: 17px; }
.ubx-purchase .unbox-card-options[open] > summary .unbox-icon { transform: rotate(45deg); }
.ubx-purchase .unbox-card-options > summary:hover { background: #c8e22a; }
.unbox-site .ubx-purchase .sp-shop-card__variations-form { margin: 14px 0 0; padding: 0; }
.ubx-purchase .sp-shop-card__variations { display: grid; gap: 12px; }
.ubx-purchase .sp-shop-card__variation-row { display: grid; gap: 6px; min-width: 0; }
.ubx-purchase .sp-shop-card__variation-label { margin: 0; font-size: 12px; font-weight: 600; line-height: 1.5; }
.unbox-site .ubx-purchase .unbox-card-options select {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    height: auto;
    margin: 0;
    padding: 9px 10px;
    border: 1px solid var(--ubx-line, #e4e1d6);
    border-radius: 8px;
    background-color: #fffef8;
    color: var(--ubx-ink, #20231f);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
}
.unbox-site .ubx-purchase .reset_variations { display: inline-block; margin-top: 7px; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.ubx-purchase .woocommerce-variation { margin-block: 12px 0; font-size: 13px; line-height: 1.5; }
.ubx-purchase .woocommerce-variation :is(p, .price) { margin: 0 0 8px; font-size: inherit; color: inherit; }
.ubx-purchase .woocommerce-variation-price .price { font-weight: 700; }
.unbox-site .ubx-purchase .single_add_to_cart_button {
    display: flex;
    align-items: center;
    justify-content: center;
    float: none;
    width: 100%;
    min-height: 46px;
    margin: 12px 0 0;
    padding: 10px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--ubx-lime, #d6ee3f);
    color: var(--ubx-ink, #20231f);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 700;
    white-space: normal;
}
.unbox-site .ubx-purchase .single_add_to_cart_button:hover { background: #c8e22a; }
.unbox-site .ubx-purchase .single_add_to_cart_button.disabled { opacity: .5; cursor: not-allowed; }
.ubx-purchase .sp-shop-card__qty-hidden { display: none; }

/* Woo loop items must stretch the component without imposing the legacy card geometry. */
.unbox-site ul.products:has(> li.unbox-loop-item) {
    display: grid;
    grid-template-columns: repeat(var(--ubx-product-columns, 4), minmax(0, 1fr));
    gap: 22px;
    float: none;
    width: 100%;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}
.unbox-site ul.products.columns-1 { --ubx-product-columns: 1; }
.unbox-site ul.products.columns-2 { --ubx-product-columns: 2; }
.unbox-site ul.products.columns-3 { --ubx-product-columns: 3; }
.unbox-site ul.products.columns-4 { --ubx-product-columns: 4; }
.unbox-site ul.products.columns-5 { --ubx-product-columns: 5; }
.unbox-site ul.products.columns-6 { --ubx-product-columns: 6; }
.unbox-site ul.products:has(> li.unbox-loop-item)::before,
.unbox-site ul.products:has(> li.unbox-loop-item)::after { display: none; }
.unbox-site ul.products li.unbox-loop-item {
    display: flex;
    flex-direction: column;
    float: none !important;
    clear: none !important;
    min-width: 0;
    width: auto !important;
    margin: 0 !important;
    padding: 0;
    border: 0;
    background: none;
    list-style: none;
}
.unbox-site ul.products li.unbox-loop-item > .ubx-product-card { height: 100%; }

/* Card content adapts to its real width, including narrow recommendation columns. */
@container unbox-product-card (max-width: 220px) {
    .ubx-product-card .ubx-product-copy { padding: 10px 5px 4px; }
    .unbox-site .ubx-product-card .ubx-product-copy h3 { font-size: 18px; }
    .ubx-product-card .ubx-product-meta { font-size: 12px; gap: 3px 8px; }
    .ubx-product-card .ubx-product-price { font-size: 19px; }
    .unbox-site .ubx-product-card .ubx-buy { padding-inline: 10px; font-size: 14px; }
    .unbox-site .ubx-product-card .unbox-card-options > summary { padding-inline: 8px; font-size: 14px; }
    .ubx-product-card .ubx-quantity { gap: 6px; }
    .unbox-site .ubx-product-card .ubx-quantity button { flex-basis: 30px; width: 30px; }
    .ubx-product-card .ubx-quantity > div { padding-inline: 2px; }
    body.unbox-site .ubx-product-card .ubx-quantity > a { flex-basis: 42px; width: 42px; }
}
@media (max-width: 639px) {
    .ubx-product-card { padding: 8px; border-radius: 16px; }
    .ubx-product-meta { font-size: 12px; gap: 3px 8px; }
}
@media (max-width: 1100px) {
    .unbox-site ul.products:is(.columns-4, .columns-5, .columns-6) { --ubx-product-columns: 3; }
}
@media (max-width: 767px) {
    .unbox-site ul.products:has(> li.unbox-loop-item) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .unbox-site ul.products.columns-1:has(> li.unbox-loop-item) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
    .unbox-site .unbox-product-grid:has(> .ubx-product-card),
    .unbox-site .unbox-detail .unbox-product-grid:has(> .ubx-product-card),
    .unbox-site ul.products:has(> li.unbox-loop-item) { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .ubx-product-card { transition: none; }
}

/* Shared live feedback is created once by the purchase controller. */
.ubx-cart-feedback{position:fixed;bottom:22px;left:22px;z-index:1500;max-width:calc(100vw - 32px);padding:16px 22px;background:var(--ubx-ink);color:var(--ubx-paper);border:1px solid #454840;border-radius:16px;box-shadow:0 12px 35px #20231f33;font-size:14px}.ubx-cart-feedback[hidden]{display:none}
.unbox-search-dialog .ubx-cart-feedback{position:sticky;inset:auto;top:0;max-width:100%;margin-bottom:12px;z-index:2}

/* The genre link uses the card's existing label line on both shelves and grids. */
.unbox-site .ubx-product-card .ubx-game-genre {
    align-self: flex-start;
    color: #51613a;
    text-decoration: underline;
    text-underline-offset: .18em;
}
.ubx-shelf-heading-copy, .ubx-collection-intro { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ubx-collection-intro { margin-block-end: 20px; }
.ubx-collection-intro h2 { margin: 0; }
.ubx-collection-intro p { margin: .35em 0 0; }
.ubx-shelf-heading-copy img.ubx-collection-cover, .ubx-collection-intro img.ubx-collection-cover {
    flex: none; width: clamp(48px, 9vw, 92px); height: clamp(48px, 9vw, 92px);
    border-radius: 12px; object-fit: cover;
}
