/* Patriam Store presentation. Scoped to Store pages and the product modal. */
#storefront {
    --store-ink: var(--p-ink, #2b1a12);
    --store-muted: var(--p-muted, #6f6157);
    --store-card: var(--p-card, #fff);
    --store-line: var(--p-line, #e4dbcb);
    --store-gold: var(--p-gold, #c9a227);
    --store-red: var(--p-red, #7a1f1f);
    --store-shadow: var(--p-shadow, 0 6px 18px rgba(43, 26, 18, .08));
}

/* Keep the Store's existing grid intact inside its own full-width track. */
#storefront.store-community-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    min-width: 0;
}

#storefront .store-shell {
    min-width: 0;
    margin: 0;
}

/* The theme grid adds a row gutter above the catalogue, but not the sidebar. */
#storefront .store-shell > .row {
    padding-top: 0;
}

/* The grid used to be a direct child of .ui.container, which removed these gutters. */
#storefront .store-shell > .row > .column {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

#storefront .store-community-sidebar {
    width: 100%;
    max-width: 34rem;
    min-width: 0;
}

#storefront .store-community-card.ui.card {
    width: 100%;
    margin: 0;
    border: 1px solid var(--store-line);
    border-top: 3px solid var(--store-gold);
    background: var(--store-card);
    color: var(--store-ink);
    box-shadow: var(--store-shadow);
}

#storefront .store-community-activity {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

#storefront .store-community-existing-widgets {
    margin-top: 1rem;
}

#storefront [hidden] {
    display: none !important;
}

#storefront.store-community-enhanced .store-shell {
    grid-column: 1;
    grid-row: 1;
}

#storefront.store-community-enhanced .store-community-sidebar {
    grid-column: 1;
    grid-row: 2;
    max-width: none;
}

#storefront .store-community-heading.ui.header {
    margin: 0 0 .8rem;
    color: var(--store-ink);
    font-size: 1.15rem;
}

#storefront .store-community-month {
    margin: 0 0 .25rem;
    color: var(--store-muted);
    font-weight: 700;
}

#storefront .store-community-total {
    margin: 0;
    color: var(--store-ink);
    font-size: clamp(1.2rem, 2vw, 1.9rem);
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

#storefront .store-community-range {
    margin: .55rem 0 0;
    color: var(--store-muted);
    font-size: .85rem;
}

#storefront .store-community-purchases {
    margin: 0;
    padding: 0;
    list-style: none;
}

#storefront .store-community-purchase {
    padding: .75rem 0;
    border-top: 1px solid var(--store-line);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

#storefront .store-community-purchase:last-child {
    padding-bottom: 0;
}

#storefront .store-community-person,
#storefront .store-community-product {
    color: var(--store-ink);
    font-weight: 700;
}

#storefront .store-community-date {
    display: block;
    margin-top: .25rem;
    color: var(--store-muted);
    font-size: .82rem;
}

#storefront .store-community-empty {
    margin: 0;
    color: var(--store-muted);
}

/* Equal outer tracks keep the catalogue centered in the viewport. */
@media (min-width: 1800px) {
    body#page-store #wrapper > .ui.container.store-community-container {
        width: calc(100% - 4rem);
        max-width: 1750px;
    }

    #storefront.store-community-enhanced {
        grid-template-columns: 250px minmax(0, 1127px) 250px;
        column-gap: 2rem;
        justify-content: center;
        align-items: start;
    }

    #storefront.store-community-enhanced .store-shell {
        grid-column: 2;
    }

    #storefront.store-community-enhanced .store-community-sidebar {
        grid-column: 1;
        grid-row: 1;
    }
}

#storefront .store-community-tools {
    margin-bottom: 1rem;
}

#storefront .store-community-trigger,
#storefront .store-community-close {
    min-height: 44px;
    margin: 0;
    color: var(--store-ink) !important;
    border: 1px solid var(--store-line);
}

#storefront .store-community-trigger:focus-visible,
#storefront .store-community-close:focus-visible {
    outline: 3px solid var(--store-gold);
    outline-offset: 3px;
}

#storefront .store-community-dialog {
    display: none;
    width: min(36rem, calc(100% - 2rem));
    max-width: none;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: 0;
    border: 1px solid var(--store-line);
    border-top: 3px solid var(--store-gold);
    border-radius: .4rem;
    background: var(--store-card);
    color: var(--store-ink);
    box-shadow: 0 1rem 4rem rgba(0, 0, 0, .35);
    overflow: hidden;
}

#storefront .store-community-dialog[open] {
    display: flex;
    flex-direction: column;
}

#storefront .store-community-dialog::backdrop {
    background: rgba(0, 0, 0, .65);
}

#storefront .store-community-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: 0 0 auto;
    padding: 1rem;
    border-bottom: 1px solid var(--store-line);
}

#storefront .store-community-dialog-header h2 {
    margin: 0;
    font-size: 1.3rem;
    line-height: 1.3;
}

#storefront .store-community-dialog-content {
    min-height: 0;
    padding: 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

html.store-community-modal-open {
    overflow: hidden;
}

.store-product-modal {
    --store-ink: var(--p-ink, #2b1a12);
    --store-muted: var(--p-muted, #6f6157);
    --store-gold: var(--p-gold, #c9a227);
}

#storefront .store-main {
    padding: clamp(1.1rem, 2vw, 2rem);
    border-top: 3px solid var(--store-gold);
}

#storefront .store-page-heading {
    margin-bottom: 1.3rem;
}

#storefront .store-eyebrow {
    display: block;
    margin-bottom: .3rem;
    color: var(--store-muted);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

#storefront .store-page-heading .ui.header {
    margin: 0;
    line-height: 1.2;
}

#storefront .ui.top.attached.menu {
    display: flex;
    flex-wrap: wrap;
    margin-top: 1.2rem;
    border-color: var(--store-line);
}

#storefront .ui.top.attached.menu > .item {
    min-height: 2.75rem;
}

#storefront .ui.top.attached.menu > .active.item {
    border-bottom: 2px solid var(--store-gold);
}

#storefront .store-catalogue {
    padding: 1.5rem 0 0;
    border: 0;
    box-shadow: none;
}

#storefront .store-category-description {
    margin-bottom: 1.5rem;
    color: var(--store-ink);
    line-height: 1.65;
}

#storefront .store-category-description > :first-child {
    margin-top: 0;
}

#storefront .store-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 1.2rem;
    align-items: stretch;
}

#storefront .store-product-card.ui.card {
    width: 100%;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--store-line);
    background: var(--store-card);
    box-shadow: var(--store-shadow);
}

#storefront .store-product-art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(201, 162, 39, .14), rgba(122, 31, 31, .07));
    color: var(--store-red);
}

#storefront .store-product-art img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    object-fit: contain;
}

#storefront .store-product-art > .icon {
    margin: 0;
    font-size: clamp(3rem, 7vw, 5rem);
    opacity: .65;
}

#storefront .store-product-offer {
    position: absolute;
    top: .7rem;
    left: .7rem;
    max-width: calc(100% - 1.4rem);
    padding: .45rem .6rem;
    border-radius: .25rem;
    background: var(--store-red);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

#storefront .store-product-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    padding: 1.2rem !important;
}

#storefront .store-product-title.header {
    margin: 0 0 .6rem;
    color: var(--store-ink);
    font-size: 1.2rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

#storefront .store-product-summary {
    margin: 0 0 1rem;
    color: var(--store-muted);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

#storefront .store-product-price,
.store-product-modal .store-modal-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .3rem .6rem;
    margin-top: auto;
}

#storefront .store-price-before,
.store-product-modal .store-price-before {
    color: var(--store-muted);
    font-size: .9rem;
}

#storefront .store-price-current,
.store-product-modal .store-price-current {
    color: var(--store-ink);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}

#storefront .store-product-action.ui.button {
    width: 100%;
    margin: 0;
    border-radius: 0;
    text-align: center;
}

#storefront .store-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.store-product-modal.ui.modal > .header h2 {
    margin: 0;
    font-size: 1.35rem;
}

.store-product-modal .image.content > .image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 11rem;
    padding: .8rem;
    background: rgba(201, 162, 39, .09);
}

.store-product-modal .image.content > .image img {
    max-height: 12rem;
    object-fit: contain;
}

.store-product-modal .description {
    min-width: 0;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.store-product-modal .description details {
    margin-top: 1rem;
}

.store-product-modal .store-modal-offer {
    margin: 1rem 0 0;
    font-weight: 700;
}

.store-product-modal .description summary {
    cursor: pointer;
    font-weight: 700;
}

.store-product-modal .store-modal-price {
    margin: 1.1rem 0 0;
    padding-top: .8rem;
    border-top: 1px solid var(--p-line, #e4dbcb);
}

.store-product-modal .actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .5rem;
}

.store-product-modal .actions .ui.button {
    margin: 0;
}

#storefront .store-checkout-section {
    margin-top: 1.7rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--store-line);
}

#storefront .store-product-options-form {
    margin-top: 1.7rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--store-line);
}

#storefront .store-field-label {
    display: block;
    margin-bottom: .45rem;
    color: var(--store-ink);
    font-weight: 700;
}

#storefront .store-checkout-section > .ui.header,
#storefront .store-payment-methods > legend.ui.header {
    margin: 0 0 1.1rem;
    color: var(--store-ink);
    font-size: 1.35rem;
}

#storefront .store-cart-lines {
    margin: 0;
    padding: 0;
    list-style: none;
}

#storefront .store-cart-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: .9rem;
    align-items: start;
    padding: 1rem 0;
    border-bottom: 1px solid var(--store-line);
}

#storefront .store-cart-line-main,
#storefront .store-cart-line-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

#storefront .store-cart-line-name {
    display: block;
    color: var(--store-ink);
    font-size: 1.07rem;
}

#storefront .store-cart-line-options {
    margin: .45rem 0 0;
    color: var(--store-muted);
    font-size: .92rem;
}

#storefront .store-cart-line-options > div {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
}

#storefront .store-cart-line-options dt {
    font-weight: 700;
}

#storefront .store-cart-line-options dt::after {
    content: ':';
}

#storefront .store-cart-line-options dd {
    margin: 0;
    overflow-wrap: anywhere;
}

#storefront .store-cart-line-quantity {
    display: block;
    margin-top: .45rem;
    color: var(--store-muted);
    font-size: .9rem;
}

#storefront .store-cart-line-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .25rem;
    white-space: nowrap;
}

#storefront .store-cart-remove.ui.button {
    margin: 0;
    min-width: 2.75rem;
    min-height: 2.75rem;
    color: var(--store-red) !important;
}

#storefront .store-cart-remove-form {
    margin: 0;
}

#storefront .store-order-totals {
    max-width: 26rem;
    margin: 1rem 0 0 auto;
}

#storefront .store-order-totals > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .35rem 0;
    color: var(--store-muted);
}

#storefront .store-order-totals dd {
    margin: 0;
    text-align: right;
    white-space: nowrap;
}

#storefront .store-order-totals .store-order-grand-total {
    margin-top: .4rem;
    padding-top: .9rem;
    border-top: 1px solid var(--store-line);
    color: var(--store-ink);
    font-size: 1.2rem;
    font-weight: 700;
}

#storefront .store-coupon-input {
    display: flex;
    max-width: 34rem;
}

#storefront .store-coupon-input input {
    min-width: 0;
}

#storefront .store-payment-methods {
    min-width: 0;
    padding-right: 0;
    padding-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
}

#storefront .store-payment-methods > legend {
    float: left;
    width: 100%;
    padding: 0;
}

#storefront .store-payment-methods > legend + * {
    clear: both;
}

#storefront .store-payment-choice {
    padding: .85rem 1rem;
    border: 1px solid var(--store-line);
    border-radius: .3rem;
    background: var(--store-card);
}

#storefront .store-credit-choice {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--store-line);
    border-radius: .3rem;
}

#storefront .store-checkout-help {
    margin: .4rem 0 0;
    color: var(--store-muted);
    font-size: .9rem;
    line-height: 1.45;
}

#storefront .store-purchase-section .ui.checkbox {
    min-height: 1.4rem;
}

#storefront .store-purchase-button {
    margin: 1rem 0 0;
    min-height: 2.75rem;
}

#storefront .store-purchase-button .icon {
    margin-left: .4rem;
}

#storefront :is(a, button, input, select, textarea, summary):focus-visible,
.store-product-modal :is(a, button, summary):focus-visible {
    outline: 3px solid var(--store-gold, #c9a227);
    outline-offset: 2px;
}

#storefront #widget-store-account .description {
    display: flex;
    justify-content: space-between;
    gap: .7rem;
    flex-wrap: wrap;
}

#storefront #widget-featured-products .ui.card {
    width: 100%;
    margin: 1rem 0 0;
}

#storefront #widget-featured-products .image img {
    max-height: 12rem;
    padding: .8rem;
    object-fit: contain;
}

@media (max-width: 767px) {
    #storefront .store-main {
        padding: 1rem;
    }

    #storefront .ui.top.attached.menu > .item {
        flex: 1 1 auto;
        justify-content: center;
    }

    #storefront .store-cart-line {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    #storefront .store-cart-line-price {
        grid-column: 1;
        grid-row: 2;
        align-items: flex-start;
    }

    #storefront .store-cart-remove-form {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    #storefront .store-coupon-input {
        flex-wrap: wrap;
        gap: .5rem;
    }

    #storefront .store-coupon-input input,
    #storefront .store-coupon-input button,
    #storefront .store-purchase-button {
        width: 100%;
    }

    .store-product-modal .actions .ui.button {
        flex: 1 1 auto;
        text-align: center;
    }
}
