/* Shop page: product grid, cards, and the on-site cart drawer. */

p.shop-intro {
    font-size: 20px;
}

div.shop-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e4e4e4;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    transition: border-color .15s ease;
}

div.shop-card:hover {
    border-color: #111;
}

/* Red accent bar slides in on hover, like the feature list rows. */
div.shop-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #ff143f;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform .2s ease;
    z-index: 1;
}

div.shop-card:hover::before {
    transform: scaleY(1);
}

a.shop-card-image {
    display: block;
}

a.shop-card-image img {
    display: block;
    width: 100%;
    height: auto;
    border-bottom: 1px solid #e4e4e4;
}

div.shop-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 20px;
}

div.shop-card-price {
    font-family: "Geist Mono", monospace;
    font-size: 14px;
    text-transform: uppercase;
    color: #777;
    margin-bottom: 3px;
}

h3.shop-card-title {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 2px;
}

h3.shop-card-title a {
    color: #000;
}

h3.shop-card-title a:hover {
    color: #ff143f;
}

div.shop-card-subtitle {
    font-family: "Geist Mono", monospace;
    font-size: 12px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 12px;
}

p.shop-card-description {
    font-size: 15px;
    margin-bottom: 16px;
}

div.shop-card-options {
    margin-bottom: 16px;
}

div.shop-card-options-label {
    font-family: "Geist Mono", monospace;
    font-size: 12px;
    text-transform: uppercase;
    color: #777;
    margin-bottom: 6px;
}

/* Segmented size picker, styled like the capabilities category switcher. */
div.shop-variant-picker {
    display: flex;
    border: 1px solid #111;
    border-radius: 4px;
    overflow: hidden;
}

button.shop-variant {
    flex: 1 1 0;
    background: none;
    border: 0;
    border-right: 1px solid #111;
    padding: 8px 4px;
    font-family: "Geist Mono", monospace;
    font-size: 13px;
    text-transform: uppercase;
    color: #111;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

button.shop-variant:last-child {
    border-right: 0;
}

button.shop-variant:hover {
    background-color: #f5f5f5;
    color: #ff143f;
}

button.shop-variant.active {
    background-color: #111;
    color: #fff;
}

div.shop-card-actions {
    margin-top: auto;
    display: flex;
    gap: 10px;
}

div.shop-card-actions a.shop-details-btn {
    flex: 0 0 auto;
}

div.shop-card-actions button.shop-add-to-cart {
    flex: 1 1 auto;
}

button.shop-add-to-cart.added {
    background-color: #111;
    border-color: #111;
    color: #fff;
}

div.shop-note {
    font-size: 13px;
    color: #777;
    border-top: 1px solid #e4e4e4;
    padding-top: 20px;
    margin-top: 10px;
}

div.shop-note a {
    color: #777;
    text-decoration: underline;
}

div.shop-note a:hover {
    color: #ff143f;
}

/* Product detail pages. */
div.shop-detail-image {
    border: 1px solid #e4e4e4;
    border-radius: 4px;
    overflow: hidden;
}

div.shop-detail-image img {
    display: block;
    width: 100%;
    height: auto;
}

/* Thumbnail strip under the main image. Rendered only when a product has more
   than one image; shop.js swaps the main image on click. */
div.shop-gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

button.shop-gallery-thumb {
    flex: 1 1 0;
    min-width: 72px;
    padding: 0;
    background: none;
    border: 1px solid #e4e4e4;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .15s ease;
}

button.shop-gallery-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

button.shop-gallery-thumb:hover {
    border-color: #111;
}

button.shop-gallery-thumb.active {
    border-color: #ff143f;
}

button.shop-gallery-thumb:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

div.shop-detail-meta {
    margin-bottom: 20px;
}

span.shop-detail-price {
    font-family: "Geist Mono", monospace;
    font-size: 18px;
    text-transform: uppercase;
    color: #111;
    margin-right: 12px;
}

span.shop-detail-subtitle {
    font-family: "Geist Mono", monospace;
    font-size: 13px;
    text-transform: uppercase;
    color: #999;
}

div.shop-detail-body {
    margin-bottom: 24px;
}

div.shop-detail-body p {
    font-size: 17px;
}

div.shop-detail-body ul {
    list-style: none;
    padding: 0;
    margin: 0 0 0 2px;
    font-size: 16px;
}

div.shop-detail-body ul li {
    margin-bottom: 4px;
}

div.shop-detail-body ul li::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #ff143f;
    margin-right: 10px;
}

div.shop-detail div.shop-card-options {
    margin-bottom: 20px;
}

/* Floating cart toggle. */
button.shop-cart-toggle {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 950;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1px solid #ff143f;
    background-color: #ff143f;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: background-color .15s ease;
}

button.shop-cart-toggle:hover {
    background-color: #111;
    border-color: #111;
}

span.shop-cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 23px;
    height: 23px;
    padding: 0 5px;
    border-radius: 12px;
    background-color: #111;
    border: 1px solid #fff;
    color: #fff;
    font-family: "Geist Mono", monospace;
    font-size: 12px;
    line-height: 21px;
}

/* Cart drawer. */
div.shop-cart-backdrop {
    position: fixed;
    inset: 0;
    z-index: 990;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

aside.shop-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 991;
    width: 400px;
    max-width: 92vw;
    background-color: #111;
    color: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s ease;
}

body.shop-cart-open div.shop-cart-backdrop {
    opacity: 1;
    visibility: visible;
}

body.shop-cart-open aside.shop-cart-drawer {
    transform: translateX(0);
}

div.shop-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #2f2f2f;
}

div.shop-cart-title {
    font-family: "Geist Mono", monospace;
    font-size: 16px;
    text-transform: uppercase;
}

button.shop-cart-close {
    background: none;
    border: 0;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

button.shop-cart-close:hover {
    color: #ff143f;
}

div.shop-cart-items {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 24px;
}

div.shop-cart-empty {
    font-family: "Geist Mono", monospace;
    font-size: 14px;
    text-transform: uppercase;
    color: #777;
    text-align: center;
    padding: 50px 0;
}

div.shop-cart-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #2f2f2f;
}

div.shop-cart-item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #2f2f2f;
}

div.shop-cart-item-name {
    font-size: 15px;
    font-weight: 600;
}

div.shop-cart-item-name a {
    color: #fff;
}

div.shop-cart-item-name a:hover {
    color: #ff143f;
}

div.shop-cart-item-variant {
    font-family: "Geist Mono", monospace;
    font-size: 11px;
    text-transform: uppercase;
    color: #999;
}

div.shop-cart-item-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #2f2f2f;
    border-radius: 4px;
    margin-top: 8px;
}

div.shop-cart-item-qty button {
    background: none;
    border: 0;
    color: #fff;
    width: 26px;
    height: 26px;
    font-family: "Geist Mono", monospace;
    font-size: 14px;
    cursor: pointer;
}

div.shop-cart-item-qty button:hover {
    color: #ff143f;
}

div.shop-cart-item-qty span {
    font-family: "Geist Mono", monospace;
    font-size: 13px;
    min-width: 24px;
    text-align: center;
}

div.shop-cart-item-price {
    font-family: "Geist Mono", monospace;
    font-size: 14px;
    text-align: right;
}

button.shop-cart-item-remove {
    background: none;
    border: 0;
    color: #777;
    font-size: 12px;
    cursor: pointer;
    margin-top: 10px;
    padding: 0;
}

button.shop-cart-item-remove:hover {
    color: #ff143f;
}

div.shop-cart-footer {
    padding: 20px 24px;
    border-top: 1px solid #2f2f2f;
}

div.shop-cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-family: "Geist Mono", monospace;
    font-size: 15px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

div.shop-cart-shipping-note {
    font-size: 12px;
    color: #999;
    margin-bottom: 14px;
}

button.shop-checkout-btn {
    border: 1px solid #ff143f;
}

button.shop-checkout-btn:hover {
    background-color: #ff143f;
    border-color: #ff143f;
}

button.shop-checkout-btn:disabled {
    opacity: 0.4;
}

div.shop-demo-note {
    margin-top: 12px;
    font-family: "Geist Mono", monospace;
    font-size: 11px;
    text-transform: uppercase;
    line-height: 1.7;
    color: #ff143f;
    border: 1px dotted #ff143f;
    border-radius: 4px;
    padding: 10px 12px;
}

/* Sold out variants stay visible but unpickable, so the size run still reads
   as a size run. Set from Shopify's availability by shop.js. */
button.shop-variant.unavailable {
    color: #ccc;
    text-decoration: line-through;
    cursor: not-allowed;
}

button.shop-variant.unavailable:hover {
    background: none;
    color: #ccc;
}

button.shop-add-to-cart:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Mobile. The grid and the two detail columns stack on their own through
   Bootstrap; what needs help is everything sized in fixed pixels: the drawer,
   its rows, the floating toggle and the pickers. */
@media (max-width: 767.98px) {
    p.shop-intro {
        font-size: 18px;
    }

    div.shop-card-body {
        padding: 18px;
    }

    h3.shop-card-title {
        font-size: 23px;
    }

    /* Side by side these get too narrow to read on a phone. */
    div.shop-card-actions {
        flex-direction: column;
    }

    div.shop-card-actions a.shop-details-btn,
    div.shop-card-actions button.shop-add-to-cart {
        flex: 0 0 auto;
        width: 100%;
    }

    button.shop-gallery-thumb {
        min-width: 60px;
    }

    div.shop-detail-body p {
        font-size: 16px;
    }

    /* Clear of the thumb, and out of the way of the footer links. */
    button.shop-cart-toggle {
        right: 16px;
        bottom: 16px;
        width: 52px;
        height: 52px;
        font-size: 18px;
    }

    aside.shop-cart-drawer {
        max-width: 100%;
        width: 100%;
    }

    /* The drawer covers the screen here, so the page behind it must not scroll
       with it. Mobile scrollbars are overlays, so hiding the overflow costs no
       layout shift; on desktop it would, which is why this stays scoped. */
    body.shop-cart-open {
        overflow: hidden;
    }

    div.shop-cart-header,
    div.shop-cart-footer {
        padding: 16px 18px;
    }

    div.shop-cart-items {
        padding: 8px 18px;
    }

    div.shop-cart-item {
        grid-template-columns: 56px 1fr auto;
        gap: 12px;
    }

    div.shop-cart-item img {
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 575.98px) {
    /* A full size run (S through 3XL) has to fit the width of a phone. */
    button.shop-variant {
        padding: 8px 2px;
        font-size: 12px;
    }

    div.shop-cart-item-price {
        font-size: 13px;
    }
}
