.button { display: inline-flex; min-height: 3rem; align-items: center; justify-content: center; gap: var(--space-2); padding: .8rem 1.25rem; border: 1px solid transparent; border-radius: var(--radius-md); font-size: var(--text-xs); font-weight: 800; letter-spacing: .08em; line-height: 1.1; text-align: center; text-transform: uppercase; transition: color var(--motion-fast) ease, background-color var(--motion-fast) ease, border-color var(--motion-fast) ease; }
.button--primary { color: #fff; background: var(--color-text); border-color: var(--color-text); }
.button--primary:hover:not(:disabled, .is-disabled) { background: color-mix(in srgb, var(--color-text) 84%, #fff); border-color: color-mix(in srgb, var(--color-text) 84%, #fff); }
.button--secondary { color: var(--color-text); background: var(--color-surface); border-color: var(--color-border); }
.button--secondary:hover:not(:disabled, .is-disabled), .button--ghost:hover:not(:disabled, .is-disabled) { color: #fff; background: var(--color-text); border-color: var(--color-text); }
.button--ghost { color: var(--color-text); background: transparent; border-color: var(--color-border); }
.button--light { color: #fff; background: var(--color-dark); border-color: var(--color-dark); }
.button--light:hover:not(:disabled, .is-disabled) { background: #1c1c1c; border-color: #1c1c1c; }
.button--small { min-height: 2.75rem; padding: .65rem 1rem; }
.button--block { width: 100%; }
.button:disabled, .button.is-disabled { color: #fff; background: #5c5c56; border-color: #5c5c56; cursor: not-allowed; }
.icon-button { position: relative; display: inline-flex; width: 2.75rem; height: 2.75rem; align-items: center; justify-content: center; padding: 0; color: inherit; background: transparent; border: 0; border-radius: 50%; transition: color var(--motion-fast) ease, background-color var(--motion-fast) ease; }
.icon-button:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.bag-icon { width: 1.15rem; height: 1.15rem; border: 1.5px solid currentColor; border-radius: 2px 2px 4px 4px; }
.bag-icon::before { display: block; width: .55rem; height: .4rem; margin: -.42rem auto 0; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 1rem 1rem 0 0; content: ""; }
.cart-count { position: absolute; top: .15rem; right: .1rem; display: grid; min-width: 1.25rem; height: 1.25rem; place-items: center; padding: 0 .25rem; color: #fff; background: #b83232; border-radius: 1rem; font-size: .65rem; font-weight: 700; }

.field { display: grid; gap: .4rem; align-content: start; }
.field > span, .price-fields legend { color: var(--color-muted); font-size: var(--text-xs); font-weight: 650; }
.field input, .field select, .field textarea { width: 100%; min-height: 3rem; padding: .7rem .85rem; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.field textarea { min-height: 6rem; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: color-mix(in srgb, var(--color-text) 30%, transparent); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--color-error); }
.field-error { min-height: 1em; color: var(--color-error); font-size: var(--text-xs); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.field--floating { position: relative; gap: .35rem; }
.field--floating input, .field--floating textarea { padding-top: 1.35rem; padding-bottom: .35rem; }
.field--floating > span { position: absolute; z-index: 1; top: .32rem; left: .85rem; color: var(--color-muted); font-size: .67rem; font-weight: 650; line-height: 1; pointer-events: none; }
.field--floating input::placeholder, .field--floating textarea::placeholder { color: color-mix(in srgb, var(--color-muted) 72%, transparent); opacity: 0; transition: opacity var(--motion-fast) ease; }
.field--floating input:focus::placeholder, .field--floating textarea:focus::placeholder { opacity: 1; }
.field--floating input:placeholder-shown:not(:focus) + span, .field--floating textarea:placeholder-shown:not(:focus) + span { top: 1rem; font-size: var(--text-xs); }
.field--floating input:-webkit-autofill + span, .field--floating textarea:-webkit-autofill + span { top: .32rem; font-size: .67rem; }
.field--floating:focus-within > span { top: .32rem; color: var(--color-text); font-size: .67rem; }
.check-field { display: flex; gap: var(--space-3); align-items: center; min-height: 2.75rem; font-size: var(--text-sm); }
.check-field input { width: 1.1rem; height: 1.1rem; accent-color: var(--color-text); }
.form-status { margin: var(--space-3) 0 0; color: var(--color-muted); font-size: var(--text-sm); }
.form-status.is-error { color: var(--color-error); }
.form-status.is-success { color: var(--color-success); }
.inline-alert { padding: var(--space-3) var(--space-4); color: var(--color-muted); background: var(--color-soft); border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: var(--text-sm); }
.inline-alert.is-error { color: var(--color-error); background: color-mix(in srgb, var(--color-error) 7%, var(--color-surface)); }

@media (prefers-reduced-motion: reduce) {
    .field--floating input::placeholder, .field--floating textarea::placeholder { transition-duration: .01ms; }
}

.badge { position: absolute; top: var(--space-3); left: var(--space-3); z-index: 2; display: inline-flex; min-height: 1.75rem; align-items: center; padding: .35rem .65rem; color: #111; background: #fff; border-radius: .25rem; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; box-shadow: var(--shadow-sm); }
.badge--muted { color: var(--color-muted); }
.badge--sold { right: var(--space-3); left: auto; color: #fff; background: #111; }

.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 2rem); }
.product-card { min-width: 0; container-type: inline-size; }
.product-card__media { position: relative; display: grid; overflow: hidden; aspect-ratio: 1; place-items: center; background: var(--color-soft); border-radius: var(--radius-md); }
.product-card__media img { width: 100%; height: 100%; object-fit: cover; }
.product-card__image { position: absolute; inset: 0; transition: opacity var(--motion-base) ease; }
.product-card__image--secondary { opacity: 0; }
.product-card__media:hover .product-card__image--primary, .product-card__media:focus-visible .product-card__image--primary { opacity: 0; }
.product-card__media:hover .product-card__image--secondary, .product-card__media:focus-visible .product-card__image--secondary { opacity: 1; }
.image-fallback { display: grid; width: 100%; height: 100%; min-height: 12rem; place-items: center; padding: var(--space-4); color: var(--color-muted); background: var(--color-soft); font-size: var(--text-sm); text-align: center; }
.product-card__body { display: grid; gap: .35rem; padding-top: var(--space-4); }
.product-card__body > p { margin: 0; color: var(--color-muted); font-size: .75rem; font-weight: 700; }
.product-card__body h2 { margin: 0; font-size: 1.0625rem; font-weight: 800; line-height: 1.25; }
.product-card__meta { color: var(--color-muted); font-size: var(--text-xs); }
.product-card__variant { position: relative; display: grid; gap: .35rem; margin-top: .5rem; }
.product-card__variant > span { color: var(--color-muted); font-size: .6875rem; font-weight: 700; }
.product-card__variant::after { position: absolute; right: .75rem; bottom: 1.05rem; width: .45rem; height: .45rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; content: ""; pointer-events: none; transform: rotate(45deg); }
.product-card__variant select { width: 100%; min-height: 2.5rem; min-width: 0; padding: .5rem 2rem .5rem .625rem; appearance: none; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); font-size: var(--text-xs); text-overflow: ellipsis; }
.product-card__variant select:focus-visible { border-color: color-mix(in srgb, var(--color-text) 42%, transparent); outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-text) 16%, transparent); }
.product-card__status { margin: .5rem 0 0; color: var(--color-muted); font-size: .6875rem; line-height: 1.35; }
.product-card__status.is-error { color: var(--color-error); }
.product-card__status.is-success { color: var(--color-success); }
.product-card__footer { display: grid; min-width: 0; gap: .625rem; margin-top: var(--space-3); }
.product-card__footer strong { font-size: 1.0625rem; font-weight: 800; line-height: 1.2; text-align: left; white-space: nowrap; }
.product-card__footer .button { width: 100%; min-width: 0; padding-inline: .875rem; }

.product-carousel__frame { position: relative; }
.product-carousel__controls { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.product-carousel__controls button { position: absolute; top: 38%; display: inline-grid; width: 3.5rem; height: 3.5rem; place-items: center; padding: 0; color: var(--color-text); background: rgb(255 255 255 / 88%); border: 1px solid var(--color-border); border-radius: 50%; pointer-events: auto; transition: color var(--motion-fast) ease, background-color var(--motion-fast) ease, border-color var(--motion-fast) ease, opacity var(--motion-fast) ease; }
.product-carousel__controls button:first-child { left: .5rem; }
.product-carousel__controls button:last-child { right: .5rem; }
.product-carousel__controls button:hover:not(:disabled) { color: #fff; background: var(--color-text); border-color: var(--color-text); }
.product-carousel__controls button:disabled { opacity: .3; cursor: default; }
.product-carousel__track { --product-carousel-gap: clamp(1rem, 1.4vw, 1.5rem); display: grid; grid-auto-columns: calc((100% - var(--product-carousel-gap) * 3) / 4); grid-auto-flow: column; gap: var(--product-carousel-gap); overflow-x: auto; overscroll-behavior-inline: contain; padding-bottom: .25rem; scroll-behavior: smooth; scroll-snap-type: x mandatory; scrollbar-width: none; }
.product-carousel__track::-webkit-scrollbar { display: none; }
.product-carousel__track > .product-card { scroll-snap-align: start; }

.dialog-layer { position: fixed; inset: 0; z-index: 200; }
.dialog-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; background: rgb(247 247 244 / 58%); border: 0; opacity: 0; transition: opacity var(--motion-base) ease; }
.dialog-layer.is-open .dialog-backdrop { opacity: 1; }
.cart-drawer { position: absolute; z-index: 1; top: 0; right: 0; display: grid; overflow: hidden; width: min(100%, 31.25rem); height: 100%; min-height: 0; grid-template-rows: auto auto minmax(0, 1fr) auto; padding: 1.75rem 1.75rem 1.5rem; background: var(--color-surface); border-left: 1px solid var(--color-border); box-shadow: -1.5rem 0 4rem rgb(17 17 17 / 10%); transform: translateX(100%); transition: transform var(--motion-base) var(--ease-standard); }
.dialog-layer.is-open .cart-drawer { transform: translateX(0); }
.drawer-header { display: flex; grid-row: 1; gap: var(--space-4); align-items: start; justify-content: space-between; padding-bottom: var(--space-4); border-bottom: 1px solid var(--color-border); }
.drawer-header h2 { margin-bottom: .25rem; font-size: 1.5rem; font-weight: 700; }
.drawer-header p { margin: 0; color: var(--color-muted); font-size: .8125rem; }
.cart-drawer-close { width: 3rem; height: 3rem; border: 1px solid var(--color-border); }
.cart-drawer-close svg { width: 1.35rem; height: 1.35rem; }
.cart-drawer-close:hover { color: #fff; background: var(--color-text); }
.drawer-status { grid-row: 2; padding: var(--space-4) 0; color: var(--color-muted); font-size: var(--text-sm); }
.drawer-status.is-error { color: var(--color-error); }
.drawer-status.is-error { display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; }
.cart-drawer-items { grid-row: 3; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; margin-right: -.25rem; padding-right: .25rem; scrollbar-width: thin; }
.cart-drawer-items > .empty-state { min-height: 100%; border: 0; }
.cart-item { display: grid; grid-template-columns: 5.25rem minmax(0, 1fr) minmax(4.75rem, auto); column-gap: .875rem; row-gap: .5rem; align-items: start; padding: 1rem 0; border-top: 1px solid var(--color-border); }
.cart-item:first-child { border-top: 0; }
.cart-item__image { overflow: hidden; aspect-ratio: 1 / 1.16; background: var(--color-soft); border-radius: var(--radius-sm); }
.cart-item__image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__copy { min-width: 0; }
.cart-item__copy > a { display: -webkit-box; max-width: 100%; overflow: hidden; font-size: .875rem; font-weight: 700; line-height: 1.28; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.cart-item__copy > p:not(.cart-item__quantity-note) { margin: .25rem 0 .75rem; color: var(--color-muted); font-size: var(--text-xs); line-height: 1.35; }
.quantity-control { display: inline-grid; width: fit-content; grid-template-columns: 2rem 2rem 2rem; margin-top: .25rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.cart-drawer .quantity-control { width: 7rem; height: 2.125rem; grid-template-columns: 2rem 1fr 2rem; margin-top: 0; }
.quantity-control button { width: 2rem; height: 2rem; padding: 0; background: transparent; border: 0; }
.quantity-control span { display: grid; place-items: center; font-size: var(--text-sm); }
.quantity-control button:disabled { color: color-mix(in srgb, var(--color-text) 24%, transparent); cursor: not-allowed; }
.cart-item__quantity-note { margin-top: .35rem !important; color: var(--color-text) !important; font-weight: 650; }
.cart-item__price { display: grid; min-width: 4.75rem; min-height: 100%; justify-items: end; align-content: space-between; gap: .75rem; white-space: nowrap; }
.cart-item__price .icon-button { width: 1.75rem; height: 1.75rem; color: color-mix(in srgb, var(--color-text) 50%, transparent); font-size: 1.3125rem; }
.cart-item__price .icon-button:hover { color: var(--color-text); background: var(--color-soft); }
.cart-item__confirmation { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem 1rem; align-items: center; padding: .875rem; background: var(--color-soft); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.cart-item__confirmation p { margin: 0; font-size: .8125rem; font-weight: 700; line-height: 1.35; }
.cart-item__confirmation-actions { display: flex; gap: .5rem; }
.cart-item__confirmation .button { min-height: 2.375rem; padding: .55rem .75rem; font-size: .6875rem; }
.cart-item__confirmation [data-cart-confirm="remove"] { color: var(--color-error); background: var(--color-surface); border-color: color-mix(in srgb, var(--color-error) 35%, transparent); }
.cart-item__confirmation [data-cart-confirm="remove"]:hover:not(:disabled) { color: #fff; background: var(--color-error); border-color: var(--color-error); }
.cart-drawer-summary { display: block; grid-row: 4; width: 100%; align-self: end; margin-top: 1.125rem; padding-top: 1.125rem; background: var(--color-surface); border-top: 1px solid var(--color-border); }
.cart-drawer-summary > div { display: flex; justify-content: space-between; gap: var(--space-4); margin-bottom: .625rem; color: var(--color-muted); font-size: var(--text-sm); line-height: 1.35; }
.cart-drawer-summary strong { color: var(--color-text); font-size: var(--text-sm); text-align: right; }
.cart-shipping strong { max-width: 16rem; font-weight: 600; }
.cart-total { margin: 1rem 0; padding-top: .875rem; color: var(--color-text) !important; border-top: 1px solid var(--color-border); font-size: 1.0625rem !important; font-weight: 700; }
.cart-total strong { font-size: 1.125rem; }
.cart-drawer-summary .button { min-height: 3.125rem; }

.empty-state { display: grid; min-height: 22rem; place-content: center; justify-items: center; padding: var(--space-6); color: var(--color-muted); background: var(--color-surface); border: 1px solid var(--color-border); text-align: center; }
.empty-state h2 { color: var(--color-text); font-size: var(--text-xl); }
.pagination { display: flex; gap: var(--space-3); align-items: center; justify-content: center; margin-top: var(--space-7); }
.pagination__pages { display: flex; gap: var(--space-2); }
.pagination__pages a { display: grid; width: 2.5rem; height: 2.5rem; place-items: center; border: 1px solid transparent; border-radius: var(--radius-md); font-size: var(--text-sm); }
.pagination__pages a[aria-current="page"] { color: #fff; background: var(--color-text); }

@media (max-width: 64rem) {
    .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .product-carousel__track { grid-auto-columns: calc((100% - var(--product-carousel-gap) * 2) / 3); }
}
@media (max-width: 48rem) {
    .cart-drawer { padding: 1.25rem 1.125rem 1.125rem; }
    .cart-item { grid-template-columns: 4.75rem minmax(0, 1fr); column-gap: .75rem; row-gap: .625rem; padding: .875rem 0; }
    .cart-item__price { grid-column: 2; display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; }
    .cart-item__confirmation { grid-template-columns: 1fr; }
    .cart-item__confirmation-actions { justify-content: stretch; }
    .cart-item__confirmation .button { flex: 1; }
    .cart-drawer-summary > div, .cart-drawer-summary strong { font-size: .8125rem; }
    .cart-shipping strong { max-width: 60%; }
    .cart-total, .cart-total strong { font-size: 1rem !important; }
    .cart-drawer-summary .button { min-height: 3rem; font-size: .75rem; }
    .pagination { justify-content: space-between; }
}
@media (max-width: 26.25rem) {
    .cart-item { grid-template-columns: 4.25rem minmax(0, 1fr); }
    .cart-item__copy > a { font-size: .8125rem; }
    .cart-item__copy > p:not(.cart-item__quantity-note) { font-size: .6875rem; }
    .cart-drawer .quantity-control { width: 6.375rem; height: 1.9375rem; grid-template-columns: 1.8125rem 1fr 1.8125rem; }
    .cart-drawer .quantity-control button { width: 1.8125rem; height: 1.8125rem; }
}
@media (max-width: 40rem) {
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem .75rem; }
    .product-carousel__controls button { width: 3rem; height: 3rem; }
    .product-carousel__track { grid-auto-columns: calc((100% - var(--product-carousel-gap)) / 2); }
}

@container (max-width: 13rem) {
    .product-card__body { padding-top: .75rem; }
    .product-card__body h2 { font-size: .875rem; overflow-wrap: anywhere; }
    .product-card__body > p, .product-card__meta { font-size: .6875rem; }
    .product-card__footer { gap: .5rem; margin-top: .5rem; }
    .product-card__footer strong { font-size: .9375rem; }
    .product-card .button--small { min-height: 2.5rem; padding-inline: .375rem; font-size: .625rem; letter-spacing: .05em; }
    .product-card__variant select { padding-right: 1.5rem; font-size: .6875rem; }
}

@media (hover: none) {
    .product-card__media:hover .product-card__image--primary { opacity: 1; }
    .product-card__media:hover .product-card__image--secondary { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .product-carousel__track { scroll-behavior: auto; }
}
