/* Add after style.css. These rules support the catalog preview only. */
.catalog-preview-note {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-left: 4px solid var(--yellow, #f8ef08);
    background: var(--black, #0e0803);
    color: var(--white, #fff);
    font-size: 15px;
    line-height: 1.5;
}

.catalog-result-count {
    margin: 0 0 18px;
    color: var(--white, #fff);
    line-height: 1.5;
}

.catalog-category-count {
    font-size: 0.85em;
    white-space: nowrap;
}

.catalog-card-image-frame {
    width: 100%;
    aspect-ratio: 3 / 4;
    display: block;
    background: var(--black, #0e0803);
    overflow: hidden;
}

.catalog-card-image-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.shop-product-price.catalog-pending-price {
    font-size: 15px;
    font-weight: 400;
}

.catalog-image-warning {
    margin: 0;
    padding: 16px;
    color: var(--white, #fff);
    line-height: 1.5;
    text-align: center;
}

.catalog-empty {
    padding: 24px 0;
    color: var(--white, #fff);
}

.catalog-empty[hidden],
.catalog-pagination[hidden] {
    display: none;
}

.catalog-pagination,
.catalog-gallery-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 24px;
}

.catalog-page-number {
    color: var(--white, #fff);
}

.catalog-action {
    min-height: 44px;
    padding: 10px 16px;
    border: 2px solid var(--yellow, #f8ef08);
    background: var(--yellow, #f8ef08);
    color: var(--black, #0e0803);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.catalog-action:disabled {
    opacity: 0.5;
    cursor: default;
}

.catalog-action:not(:disabled):hover {
    background: var(--white, #fff);
    border-color: var(--white, #fff);
}

.catalog-action:focus-visible,
.catalog-thumbnail:focus-visible,
.catalog-source-notes summary:focus-visible,
.shop-category-nav a:focus-visible,
#shop-product-grid .shop-product-button:focus-visible,
.catalog-result-count:focus-visible {
    outline: 3px solid var(--blue, #004efa);
    outline-offset: 4px;
}

#shop-product-grid .shop-product-button:focus-visible,
.catalog-result-count:focus-visible {
    outline-color: var(--yellow, #f8ef08);
}

.catalog-gallery {
    box-sizing: border-box;
    width: min(94vw, 960px);
    max-width: calc(100vw - 24px);
    max-height: 90vh;
    margin: auto;
    padding: 0;
    border: 3px solid var(--yellow, #f8ef08);
    background: var(--black, #0e0803);
    color: var(--white, #fff);
    overflow: auto;
    overscroll-behavior: contain;
    font-family: Arial, Helvetica, sans-serif;
}

.catalog-gallery::backdrop {
    background: rgb(0 0 0 / 80%);
}

.catalog-gallery-content {
    padding: 24px;
}

.catalog-gallery-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    justify-content: space-between;
}

.catalog-gallery-header h2 {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 24px;
    line-height: 1.25;
}

.catalog-gallery-header .catalog-action {
    flex-shrink: 0;
}

.catalog-gallery-category {
    color: var(--yellow, #f8ef08);
    font-weight: 700;
}

.catalog-gallery-stage {
    display: block;
    width: 100%;
    height: min(52vh, 560px);
}

.catalog-gallery-stage img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.catalog-gallery-caption {
    text-align: center;
    line-height: 1.5;
}

.catalog-gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.catalog-thumbnail {
    width: 68px;
    height: 84px;
    padding: 3px;
    border: 2px solid var(--white, #fff);
    background: var(--black, #0e0803);
    cursor: pointer;
}

.catalog-thumbnail[aria-pressed="true"] {
    border: 3px solid var(--yellow, #f8ef08);
}

.catalog-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.catalog-gallery-disclaimer,
.catalog-source-notes {
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.catalog-source-notes summary {
    cursor: pointer;
    color: var(--yellow, #f8ef08);
}

.shop-product-card {
    transition: transform 0.2s ease;
}

.shop-product-card h3 {
    font-size: 16px;
    line-height: 1.3;
}

.shop-product-card p {
    font-size: 14px;
    line-height: 1.4;
}

.shop-product-card .shop-product-category {
    font-size: 12px;
}

.shop-product-card .shop-product-price {
    font-size: 20px;
}

.shop-product-card .shop-product-button {
    font-size: 14px;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .shop-product-card:hover {
        transform: translateY(-4px);
    }
}

@media (max-width: 600px) {
    .catalog-gallery-content {
        padding: 16px;
    }

    .catalog-gallery-header {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .catalog-gallery-header .catalog-action {
        align-self: flex-end;
    }

    .catalog-gallery-header h2 {
        font-size: 20px;
    }

    .catalog-gallery-stage {
        height: 42vh;
    }
}

/* Keep long category labels inside very narrow phone screens. */
@media (max-width: 360px) {
    .shop-layout .shop-category-nav {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* =========================
   PRODUCT DETAIL PAGE
   ========================= */

.product-page {
    padding: 32px;
    background-color: var(--black);
    color: var(--white);
}

.product-back-link {
    display: inline-block;
    margin-bottom: 24px;
    color: var(--yellow);
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
}

.product-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 40px;
}

.product-gallery {
    min-width: 0;
    align-self: start;
}

/* Reserve the same space for portrait, square and landscape photos. */
.product-main-image-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    place-items: center;
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: 700px;
    max-height: min(70svh, 700px);
    background-color: var(--black);
    border: 3px solid var(--white);
    padding: clamp(8px, 2vw, 16px);
}

.product-main-image-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
}

.product-image-message {
    margin: 0;
    text-align: center;
    line-height: 1.5;
}

.product-gallery-status {
    margin: 12px 0;
    color: var(--white);
    font-size: 14px;
    line-height: 1.5;
}

/* Equal-sized buttons wrap into rows instead of overflowing the page. */
.product-thumbnails {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 4px;
}

.product-thumbnail {
    flex: 0 0 auto;
    width: 80px;
    height: 100px;
    padding: 4px;
    background-color: var(--black);
    border: 3px solid var(--white);
    cursor: pointer;
}

.product-thumbnail.active,
.product-thumbnail[aria-pressed="true"] {
    border-color: var(--yellow);
    background-color: var(--yellow);
    box-shadow: 0 0 0 2px var(--black), 0 0 0 4px var(--yellow);
}

.product-thumbnail:focus-visible {
    outline: 3px dashed var(--white);
    outline-offset: 4px;
}

@media (hover: hover) {
    .product-thumbnail:hover {
        border-color: var(--yellow);
    }
}

.product-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: var(--black);
}

.product-gallery [hidden] {
    display: none;
}

.product-detail-info {
    display: flex;
    flex-direction: column;
    padding: 32px;
    background-color: var(--blue);
    border: 4px solid var(--black);
    align-self: start;
}

.product-detail-info > * {
    order: 10;
}

.product-detail-category {
    order: 1;
    margin: 0 0 10px;
    color: var(--yellow);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.product-detail-info h1 {
    order: 2;
    margin: 0 0 18px;
    font-family: Impact, "Arial Black", sans-serif;
    font-size: clamp(38px, 4.5vw, 64px);
    -webkit-text-stroke: 2px var(--black);
    paint-order: stroke fill;
    line-height: 1;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.product-detail-price {
    order: 3;
    align-self: flex-start;
    margin: 0 0 18px;
    padding: 8px 14px;
    background-color: var(--yellow);
    color: var(--black);
    border: 3px solid var(--black);
    font-size: 34px;
    font-weight: 900;
}

.product-detail-size {
    order: 4;
    align-self: flex-start;
    margin: 0 0 22px;
    padding: 7px 12px;
    border: 2px solid var(--white);
    font-size: 16px;
    font-weight: 800;
}

.product-detail-description {
    order: 5;
    margin: 0;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.45);
    font-size: 17px;
    line-height: 1.6;
}

.product-add-cart {
    order: 6;
}

.product-view-cart {
    order: 7;
}

.product-add-cart,
.product-view-cart {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 14px 20px;
    border: 4px solid var(--black);
    box-shadow: 6px 6px 0 var(--black);
    font-size: 18px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
}

.product-add-cart {
    background-color: var(--yellow);
    color: var(--black);
    cursor: pointer;
}

.product-view-cart {
    background-color: var(--red);
    color: var(--white);
}

.product-add-cart:hover,
.product-view-cart:hover {
    transform: translateY(-4px);
}


/* =========================
   CART PAGE
   ========================= */

.cart-page {
    min-height: 70vh;
    padding: 40px 32px;
    background-color: var(--black);
    color: var(--white);
}

.cart-heading h1 {
    margin: 0 0 32px;
    font-family: Impact, "Arial Black", sans-serif;
    font-size: clamp(52px, 7vw, 90px);
    text-transform: uppercase;
}

.cart-items {
    display: grid;
    gap: 16px;
}

.cart-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 20px;
    padding: 16px;
    border: 2px solid var(--white);
    background-color: var(--black);
}

.cart-item-image {
    width: 150px;
    height: 180px;
    object-fit: cover;
}

.cart-item-info h2 {
    margin-top: 0;
}

.cart-item-price {
    font-size: 24px;
    font-weight: 800;
}

.cart-remove-button {
    padding: 10px 18px;
    background-color: var(--red);
    color: var(--white);
    border: 2px solid var(--white);
    font-weight: 800;
    cursor: pointer;
}

.cart-summary {
    max-width: 600px;
    margin: 30px 0 0 auto;
    padding: 24px;
    background-color: var(--yellow);
    color: var(--black);
    border: 4px solid var(--black);
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    font-size: 28px;
    font-weight: 900;
}

.cart-checkout-note {
    line-height: 1.5;
}

.cart-checkout-button,
.cart-continue-button {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 14px 20px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 800;
}

.cart-checkout-button {
    background-color: var(--blue);
    color: var(--white);
    border: 4px solid var(--black);
}

.cart-checkout-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.cart-continue-button {
    background-color: var(--black);
    color: var(--white);
}

.empty-cart {
    padding: 40px;
    background-color: var(--blue);
    text-align: center;
}

.empty-cart a {
    display: inline-block;
    margin-top: 12px;
    padding: 12px 20px;
    background-color: var(--yellow);
    color: var(--black);
    font-weight: 800;
    text-decoration: none;
}

.catalog-product-link,
.shop-product-title-link {
    color: inherit;
    text-decoration: none;
}

.shop-product-title-link:hover {
    color: var(--yellow);
}

.shop-product-button {
    display: block;
    text-align: center;
    text-decoration: none;
}


/* =========================
   PRODUCT + CART MOBILE
   ========================= */

@media (max-width: 800px) {

    .product-page {
        padding: 20px 16px;
    }

    .product-detail-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-detail-info {
        padding: 24px 20px;
    }

    .product-detail-info h1 {
        font-size: 40px;
        -webkit-text-stroke: 2px var(--black);
        paint-order: stroke fill;
    }

    .product-thumbnail {
        width: 64px;
        height: 80px;
    }

    .cart-page {
        padding: 28px 16px;
    }

    .cart-item {
        grid-template-columns: 100px 1fr;
        gap: 14px;
    }

    .cart-item-image {
        width: 100px;
        height: 125px;
    }

    .cart-summary {
        margin-left: 0;
        max-width: none;
    }
}
