/*
Theme Name: TEESTER Shop
Template: teester-v5
Description: TEESTER's merchandise-first storefront.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: teester-shop
*/

body.teester-shop {
    --shop-ink: #181615;
    --shop-paper: #f7f3ec;
    --shop-white: #fff;
    --shop-red: #bd170f;
    --shop-line: #d7cfc4;
    background: var(--shop-paper);
    color: var(--shop-ink);
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.5;
}

.teester-shop #shell {
    max-width: none;
    padding: 0;
}

.shop-wrap {
    width: min(1320px, 100% - clamp(28px, 7vw, 96px));
    margin-inline: auto;
}

.shop-header {
    position: relative;
    z-index: 5;
    background: var(--shop-white);
    border-bottom: 1px solid var(--shop-line);
}

.shop-header-inner,
.shop-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 28px;
}

.shop-header-inner { min-height: 88px; }

.shop-brand { flex: none; }

.shop-brand img {
    display: block;
    width: 112px;
    height: auto;
}

.shop-nav,
.shop-utilities,
.shop-footer nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px clamp(14px, 2.4vw, 38px);
}

.shop-nav a,
.shop-utilities > a,
.shop-search summary,
.shop-footer nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: .875rem;
    font-weight: 750;
    text-decoration: none;
}

.shop-nav a:hover,
.shop-utilities > a:hover,
.shop-search summary:hover,
.shop-footer nav a:hover,
.shop-text-link:hover { color: var(--shop-red); }

.shop-utilities > .shop-cart {
    border: 1px solid var(--shop-ink);
    padding-inline: 14px;
}

.shop-search summary { display: list-item; align-content: center; }

.shop-search .woocommerce-product-search {
    display: flex;
    position: absolute;
    right: max(14px, calc((100% - 1320px) / 2));
    top: calc(100% + 6px);
    width: min(410px, calc(100% - 28px));
    padding: 10px;
    background: var(--shop-white);
    border: 1px solid var(--shop-line);
    box-shadow: 0 10px 24px #18161518;
}

.shop-search input { min-width: 0; }
.shop-search button { flex: none; }

.shop-hero {
    display: grid;
    grid-template-columns: 1.06fr 1fr;
    margin-top: clamp(18px, 3vw, 40px);
    background: var(--shop-ink);
    color: var(--shop-white);
}

.shop-hero-copy {
    align-self: center;
    padding: clamp(28px, 5.2vw, 76px);
}

.shop-kicker {
    margin: 0 0 10px;
    font-size: .875rem;
    font-weight: 780;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.shop-hero-copy h1 {
    margin: 12px 0 20px;
    font-size: clamp(3.1rem, 8.4vw, 8rem);
    line-height: .85;
    letter-spacing: -.08em;
}

.shop-hero-copy h1 span { color: #ff5043; }

.shop-hero-copy > p:last-of-type {
    color: #eee4d9;
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    max-width: 27ch;
}

.shop-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.shop-button {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 18px;
    background: var(--shop-red);
    border: 1px solid var(--shop-red);
    color: var(--shop-white);
    text-decoration: none;
    font-weight: 760;
}

.shop-button:hover { background: #9d130c; }
.shop-button-outline { background: transparent; border-color: #f7f3ec80; }
.shop-button-outline:hover { background: #ffffff24; }

.shop-hero-product {
    min-width: 0;
    display: grid;
    grid-template-rows: 1fr auto;
    background: #e9ded0;
    color: var(--shop-ink);
    text-decoration: none;
}

.shop-hero-garment {
    position: relative;
    justify-self: center;
    align-self: center;
    width: min(83%, 450px);
}

.shop-hero-garment > img:first-child {
    display: block;
    width: 100%;
    height: auto;
    mix-blend-mode: multiply;
}

.shop-hero-label {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 15px clamp(16px, 2.5vw, 36px);
    background: var(--shop-white);
    border-top: 1px solid var(--shop-line);
}

.shop-hero-label span { text-decoration: underline; text-underline-offset: .2em; }

.shop-section { margin-block: clamp(40px, 6vw, 85px); }

.shop-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin-bottom: 16px;
}

.shop-section .shop-kicker { color: var(--shop-red); }

.shop-section h2,
.teester-shop .teester-content h1 {
    margin: 0 0 15px;
    font-size: clamp(2.3rem, 5vw, 5rem);
    line-height: .95;
    letter-spacing: -.062em;
}

.shop-section-heading h2 { margin-bottom: 0; }
.shop-text-link { font-weight: 750; text-underline-offset: .24em; }

.shop-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(10px, 2vw, 24px);
}

.shop-card {
    overflow: hidden;
    display: block;
    background: var(--shop-white);
    border: 1px solid var(--shop-line);
    color: inherit;
    text-decoration: none;
}

.shop-card:hover { border-color: var(--shop-red); }
.shop-card:hover h3 { color: var(--shop-red); }

.shop-card img { display: block; width: 100%; height: auto; }
.shop-card-image { aspect-ratio: 1; background: #efe7dc; }
.shop-card-image img { height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.teester-home .shop-card-image { position: relative; }
/* Keep the original logo colors over the garment while blending the photo backdrop. */
.teester-home img.shop-garment-logo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: normal;
    mask-image: linear-gradient(to right, transparent 30%, black 35% 72%, transparent 76%),
                linear-gradient(to bottom, transparent 19%, black 22% 41%, transparent 45%);
    mask-composite: intersect;
}
.shop-card-image--acrylic-charm { background: #e5e5e5; }
.shop-card-image--acrylic-charm img { mix-blend-mode: normal; }
.shop-card-sticker img { object-fit: cover; }
.shop-merch-sticker img {
    width: 88%;
    margin-inline: auto;
    mix-blend-mode: normal;
}
.teester-home .shop-card-sticker img {
    width: 88%;
    margin-inline: auto;
    object-fit: contain;
    mix-blend-mode: normal;
}
.shop-card-copy { padding: 15px clamp(12px, 2.2vw, 25px) 20px; }
.shop-card-copy h3 { margin: 0; font-size: clamp(1.2rem, 2vw, 1.65rem); letter-spacing: -.035em; }
.shop-card-copy p { margin: 5px 0 0; color: #554a43; }
.shop-collection-grid > .shop-card { border-width: 2px; }

.shop-collection-image {
    container-type: inline-size;
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.shop-collection-image-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 103.6%;
    transform: translate(-50%, -50%);
}

.shop-collection-image--studio .shop-collection-image-frame {
    width: 100%;
}

.shop-wall-art-sizes {
    position: absolute;
    top: 46.2%;
    left: 6.6%;
    width: 21.5%;
    height: 14%;
    background: #f1eae0;
}

.shop-footer {
    margin-top: 36px;
    background: var(--shop-white);
    border-top: 1px solid var(--shop-line);
}

.shop-footer-inner { min-height: 106px; flex-wrap: wrap; }
.shop-footer-inner > span { font-size: .9rem; color: #554a43; }

.teester-shop .teester-content { padding-block: clamp(22px, 4vw, 62px); }
.teester-shop .sectionhead { border: 1px solid var(--shop-line); background: #eee6d9; }
.teester-shop .teester-categories .sub { border: 1px solid var(--shop-line); background: var(--shop-white); }
.teester-shop .teester-categories .sub:hover { border-color: var(--shop-red); }
.teester-shop .teester-product-previews figure { border: 1px solid var(--shop-line); background: var(--shop-white); }
.shop-house-sticker-backdrop { overflow: hidden; background: #eae5dd; }
.shop-house-sticker-backdrop img { mix-blend-mode: normal; }
.teester-shop .woocommerce-breadcrumb { margin-bottom: 18px; }

@media (max-width: 850px) {
    .shop-header-inner { flex-wrap: wrap; gap: 0 18px; padding-block: 4px; }
    .shop-nav { order: 3; width: 100%; }
    .shop-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .shop-hero { grid-template-columns: 1fr; }
    .shop-hero-garment { width: min(83%, 264px); }
}

@media (max-width: 480px) {
    .shop-card-grid { grid-template-columns: 1fr; }
    .shop-footer-inner { padding-block: 12px 20px; }
    .shop-footer-inner > span { flex-basis: 65%; }
    .shop-brand img { width: 92px; }
}

/* Collection landing pages and catalog previews */
.shop-collection-heading {
    display: grid;
    grid-template-columns: 1fr minmax(150px, 31%);
    align-items: center;
    gap: clamp(16px, 4vw, 55px);
    padding: clamp(22px, 4vw, 56px);
    background: var(--shop-ink);
    color: var(--shop-white);
    margin-bottom: clamp(22px, 4vw, 44px);
}

.shop-collection-heading p { color: #eee4d9; margin-bottom: 0; }
.shop-collection-heading img { display: block; width: 100%; }

.shop-category-grid { margin-bottom: 36px; align-items: stretch; }
.shop-category-grid:has(.shop-card:nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.shop-category-grid .shop-card-copy h2 { font-size: clamp(1.15rem, 2.6vw, 1.8rem); margin-block: 0; }
.shop-category-grid .shop-card:not(:has(.shop-card-image)) .shop-card-copy { padding-block: 22px; }
.shop-category-heading > p { max-width: 62ch; }

.shop-category-preview,
.shop-empty-panel,
.shop-studio-content {
    margin-top: 26px;
    padding: clamp(16px, 3vw, 36px);
    border: 1px solid var(--shop-line);
    background: var(--shop-white);
}

.shop-category-preview > h2,
.shop-empty-panel h2,
.shop-studio-content h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
.shop-category-preview > p { max-width: 62ch; }
.shop-preview-price { color: var(--shop-red); font-weight: 800; }

.shop-product-specs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    border: 1px solid var(--shop-line);
    background: var(--shop-line);
}

.shop-product-specs > div { padding: 15px 18px; background: var(--shop-white); }
.shop-product-specs dt { font-weight: 800; }
.shop-product-specs dd { margin: 4px 0 0; }

.shop-collection-links .shop-text-link { display: inline-block; margin: 8px 18px 4px 0; }

/* Keep WooCommerce controls familiar while matching the shop typography and palette. */
.teester-shop #shell .woocommerce form.login,
.teester-shop #shell .woocommerce form.register,
.teester-shop #shell .woocommerce form.woocommerce-ResetPassword {
    max-width: 560px;
    padding: clamp(16px, 3vw, 32px);
    border: 1px solid var(--shop-line);
    background: var(--shop-white);
}

.teester-shop #shell .woocommerce input[type="checkbox"] { width: auto; }
.teester-shop #shell .woocommerce-MyAccount-navigation ul { padding-left: 0; list-style: none; }
.teester-shop #shell .woocommerce-MyAccount-navigation a { display: block; padding: 7px 0; }
.teester-shop #shell .wc-block-cart,
.teester-shop #shell .wc-block-checkout { margin-top: 24px; }
.teester-shop #shell .woocommerce-message,
.teester-shop #shell .woocommerce-info { border-top-color: var(--shop-red); }
.teester-shop #shell .woocommerce-message::before,
.teester-shop #shell .woocommerce-info::before { color: var(--shop-red); }
.teester-shop #shell div.product .summary .product_title {
    font-size: clamp(2rem, 4vw, 4.2rem);
    line-height: .96;
    overflow-wrap: anywhere;
}

@media (max-width: 850px) {
    .shop-category-grid:has(.shop-card:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
    .shop-collection-heading { grid-template-columns: 1fr; }
    .shop-collection-heading img { max-width: 235px; }
    .shop-product-specs { grid-template-columns: 1fr; }
}

.term-house-stickers .teester-product-previews {
    grid-template-columns: repeat(2, minmax(0, 480px));
}

.shop-house-sticker-backdrop { aspect-ratio: 4 / 3; }
.shop-house-sticker-backdrop img { height: 100%; object-fit: contain; }
.shop-house-sticker-card .shop-house-sticker-backdrop img { padding: 6%; transform: none; }
.shop-house-sticker-original .shop-house-sticker-backdrop img {
    padding: 0;
    transform: translate(-2.2%, 7.1%) scale(1.32);
}
.shop-single-house-sticker .woocommerce-product-gallery__image {
    overflow: hidden;
    background: #eae5dd;
}
.shop-single-house-sticker .woocommerce-product-gallery__image img { width: 100%; height: auto; }

/* The sticker preview JPEG includes a black frame in the artwork. */
.single-product .woocommerce-product-gallery__image:has(> .shop-sticker-product-example) {
    box-sizing: border-box;
    border: 1px solid #b0b0b0;
}

.single-product .woocommerce-product-gallery__image > .shop-sticker-product-example {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 353 / 301;
}

.single-product .woocommerce-product-gallery__image > .shop-sticker-product-example img.wp-post-image {
    position: absolute;
    top: -2.66%;
    left: -1.98%;
    width: 103.12%;
    max-width: none;
}
.shop-single-house-sticker-original .woocommerce-product-gallery__image img {
    transform: translate(-2.2%, 7.1%) scale(1.32);
}
.term-house-stickers .teester-product-previews figure:first-child img {
    transform: translate(-2.2%, 7.1%) scale(1.32);
}
.term-house-stickers .teester-product-previews figure:not(:first-child) img {
    transform: none;
    padding: 6%;
}

@media (max-width: 600px) {
    .term-house-stickers .teester-product-previews { grid-template-columns: minmax(0, 480px); }
}

.shop-die-cut-preview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
    gap: clamp(20px, 4vw, 54px);
    max-width: 1000px;
    margin-top: 28px;
    align-items: start;
}

.shop-die-cut-art {
    border: 1px solid var(--shop-line);
    background: var(--shop-white);
}

.shop-die-cut-art img { display: block; width: 100%; height: auto; }
.shop-die-cut-art p { margin: 0; padding: 16px 20px; }

.shop-die-cut-controls {
    min-width: 0;
    padding: clamp(16px, 3vw, 26px);
    border: 1px solid var(--shop-line);
    border-top: 4px solid var(--shop-red);
    background: var(--shop-white);
}

.shop-die-cut-controls h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
.shop-die-cut-controls fieldset { margin: 18px 0; padding: 0; border: 0; min-width: 0; }
.shop-die-cut-controls legend { margin-bottom: 7px; font-weight: 800; }
.shop-die-cut-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }

.shop-die-cut-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px;
    min-height: 44px;
    background: var(--shop-paper);
    border: 1px solid var(--shop-line);
    cursor: pointer;
}

.shop-die-cut-options label:has(:checked) { border-color: var(--shop-red); }
.shop-die-cut-options input { width: auto; margin: 0; accent-color: var(--shop-red); }
.shop-die-cut-summary { padding-block: 14px; border-top: 1px solid var(--shop-line); }
.shop-die-cut-summary p { margin: 0 0 3px; }
.shop-die-cut-summary strong { color: var(--shop-red); }

.shop-die-cut-artwork summary {
    padding: 12px 14px;
    background: var(--shop-red);
    color: var(--shop-white);
}

.shop-die-cut-artwork input { max-width: 100%; }

@media (max-width: 720px) {
    .shop-die-cut-preview { grid-template-columns: minmax(0, 1fr); }
    .shop-die-cut-art { order: 1; max-width: 440px; }
}

.shop-studio-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(8px, 1.5vw, 18px);
    margin-top: 20px;
}

.shop-studio-tile {
    display: block;
    aspect-ratio: 1;
    border: 1px solid var(--shop-line);
    background: #f8f7f5;
    cursor: zoom-in;
}

.shop-studio-tile:hover { border-color: var(--shop-red); }
.shop-studio-tile img { display: block; width: 100%; height: 100%; object-fit: contain; }

.shop-studio-viewer {
    position: fixed;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    padding: 10px;
    border: 1px solid var(--shop-line);
    background: var(--shop-ink);
    color: var(--shop-white);
}

.shop-studio-viewer::backdrop { background: #100e0de6; }
.shop-studio-viewer { width: min(1100px, calc(100vw - 24px)); }
.shop-studio-viewer-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(4px, 1vw, 12px);
}
.shop-studio-viewer-row button {
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 2rem;
    line-height: 1;
}
.shop-studio-viewer figure { margin: 0; }
.shop-studio-viewer img { display: block; max-width: 100%; max-height: calc(100dvh - 120px); object-fit: contain; margin-inline: auto; }
.shop-studio-viewer figcaption { padding: 8px 4px; }
.shop-studio-viewer form { text-align: right; }

@media (max-width: 800px) {
    .shop-studio-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
    .shop-studio-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Collection panels */
.shop-collection-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
    align-items: center;
    gap: clamp(24px, 4vw, 56px);
    max-width: 1080px;
    margin: 18px auto 40px;
    padding: clamp(18px, 3vw, 36px);
    background: var(--shop-white);
    border: 1px solid var(--shop-line);
}

.shop-collection-panel h1 { margin: 0 0 12px; }
.shop-collection-panel h2 { margin: 22px 0 8px; font-size: 1.2rem; }
.shop-collection-panel p { margin: 0 0 12px; max-width: 54ch; }

.shop-collection-options {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.shop-collection-option {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: clamp(8px, 2vw, 20px);
    padding: 12px;
    border: 1px solid var(--shop-line);
    color: var(--shop-ink);
    text-decoration: none;
}

.shop-collection-option:hover,
.shop-collection-option:focus-visible {
    border-color: var(--shop-red);
    background: var(--shop-paper);
}

.shop-collection-option > span:last-child { color: var(--shop-red); font-weight: 750; }
.shop-collection-option small { display: block; margin-top: 2px; }
.shop-sticker-collection-image { display: block; width: 100%; height: auto; }
.shop-wall-blueprint { margin: 0; }
.shop-wall-blueprint img { display: block; width: 100%; height: auto; }
.shop-collection-panel .shop-wall-shipping { font-size: .9rem; }
.shop-collection-panel .shop-text-link { display: inline-block; margin-top: 4px; }

@media (max-width: 760px) {
    .shop-collection-panel { grid-template-columns: minmax(0, 1fr); }
    .shop-sticker-collection-image,
    .shop-wall-blueprint { width: min(100%, 340px); margin-inline: auto; }
}

body.teester-shop.shop-apparel-gallery .product .woocommerce-product-gallery .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image {
    width: 100%;
}

.shop-apparel-gallery .woocommerce-product-gallery__image img[data-apparel-color] {
    width: 100%;
    height: auto;
}

body.teester-shop.shop-apparel-gallery .product .woocommerce-product-gallery .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image[hidden] {
    display: none;
}

body.teester-shop.shop-single-shirt {
    --shop-paper: #fff;
}
