/* ==========================================================================
   Witzzart Artwork Store: responsive pass (m211)
   Loaded last from Areas/ArtworkStore/Views/Shared/_Layout.cshtml.
   Rules are inside width or touch-device queries, except those marked "all widths"
   in sections 2 and 3. Desktop (1200px to 1919px) is unchanged; section 7 widens the
   container on 1920px and larger monitors.
   Selectors start with "body .aw-store-shell" so they win over the per-page files.
   ========================================================================== */

/* ---- 1. Phones: shared side gutter (matches the page padding of the store layout) ---- */
body .aw-store-shell { --aw-gut: 16px; }
@media (max-width: 380px) { body .aw-store-shell { --aw-gut: 12px; } }

/* ---- 1a. Wishlist on phones: one clean row per saved piece ----
   Two columns left a single saved piece as a half-width card with empty space beside it. Now each
   piece is a full-width card: small picture and the artist / title / price at the top, one
   full-width button underneath. The filled heart in the corner removes the piece (it was already
   wired to do so), so the separate delete button is not shown on phones. Tablets and desktop keep the grid. */
@media (max-width: 575.98px) {
  body .aw-store-shell .wl-wrap { padding: 0 0 28px; }
  body .aw-store-shell .wl-head { margin: 0 0 16px; }
  body .aw-store-shell .wl-title { font-size: 26px; line-height: 1.15; }
  body .aw-store-shell .wl-sub { font-size: 14px; }
  body .aw-store-shell .wl-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  body .aw-store-shell .wl-card {
    display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto auto;
    grid-template-areas: "fig body" "actions actions"; column-gap: 14px; row-gap: 14px;
    padding: 14px; border-radius: 20px; box-shadow: 0 6px 20px rgba(44, 26, 35, .06); transform: none;
  }
  body .aw-store-shell .wl-card:hover { transform: none; box-shadow: 0 6px 20px rgba(44, 26, 35, .06); }
  body .aw-store-shell .wl-card:hover .wl-fig img { transform: none; }
  body .aw-store-shell .wl-card .wl-fig { grid-area: fig; width: 96px; aspect-ratio: 4 / 5; min-height: 0; height: auto; border-radius: 14px; }
  body .aw-store-shell .wl-card .wl-body { grid-area: body; min-width: 0; padding: 2px 40px 0 0; gap: 4px; align-self: start; }
  body .aw-store-shell .wl-card .wl-actions { grid-area: actions; flex-direction: row; padding: 0; gap: 0; }
  body .aw-store-shell .wl-card .wl-badge { left: 22px; top: 22px; padding: 3px 9px; font-size: 11px; }
  body .aw-store-shell .wl-card .aw-pc-heart { top: 12px; right: 12px; left: auto; width: 34px; height: 34px; box-shadow: 0 1px 6px rgba(0, 0, 0, .1); }
  body .aw-store-shell .wl-artist { font-size: 12px; gap: 6px; min-width: 0; }
  body .aw-store-shell .wl-artist > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body .aw-store-shell .wl-av { flex: 0 0 auto; width: 20px; height: 20px; font-size: 10px; }
  body .aw-store-shell .wl-name { font-size: 15px; line-height: 1.35; margin: 2px 0 0; overflow-wrap: anywhere; }
  body .aw-store-shell .wl-price { margin-top: 6px; gap: 8px; }
  body .aw-store-shell .wl-price .now { font-size: 18px; }
  body .aw-store-shell .wl-price .was { font-size: 13px; }
  body .aw-store-shell .wl-actions .wl-btn { flex: 1 1 auto; width: 100%; min-width: 0; height: 44px; padding: 0 16px; font-size: 14px; }
  /* the heart above removes the piece (it has the label "Remove from wishlist"), so the second delete button is not shown on phones */
  body .aw-store-shell .wl-actions .wl-btn.ghost { display: none; }
  body .aw-store-shell .wl-empty { margin: 16px auto 36px; padding: 36px 20px; border-radius: 22px; }
}
@media (max-width: 359.98px) {
  body .aw-store-shell .wl-card { grid-template-columns: 84px minmax(0, 1fr); column-gap: 12px; padding: 12px; }
  body .aw-store-shell .wl-card .wl-fig { width: 84px; }
  body .aw-store-shell .wl-card .wl-badge { left: 20px; top: 20px; }
  body .aw-store-shell .wl-card .aw-pc-heart { top: 10px; right: 10px; }
}

/* ---- 2. My orders: the "find an order" form no longer pushes past the screen (all widths) ----
   The form's two children (field + button) kept their natural width and the
   flex parent could not shrink below it, so the Search button left the card. */
body .aw-store-shell .aw-mo-head > * { min-width: 0; max-width: 100%; }
body .aw-store-shell .aw-mo-lookup { min-width: 0; max-width: 480px; }
body .aw-store-shell .aw-mo-lookup input { flex: 1 1 0; width: 0; min-width: 0; }
body .aw-store-shell .aw-mo-lookup .aw-ord-btn { flex: 0 0 auto; }
body .aw-store-shell .aw-mo-bar > * { min-width: 0; max-width: 100%; }
@media (max-width: 575.98px) {
  body .aw-store-shell .aw-mo-search { flex: 1 1 100%; min-width: 0; }
}

/* ---- 3. Seller > Orders: scrolls on tablets, becomes cards on phones (all widths) ----
   The card used an inline overflow:hidden, which cut the table off on a phone
   and hid the status dropdown. The view now uses .aw-seller-orders. */
/* site script wtz-ui.js wraps every table in .wtz-table-wrap (own border + sideways scroll); inside this card the card is the border */
body .aw-store-shell .aw-card.aw-seller-orders { overflow: hidden; }
body .aw-store-shell .aw-seller-orders .wtz-table-wrap { position: relative; border: 0; border-radius: 0; background: transparent; overflow-x: auto; -webkit-overflow-scrolling: touch; }
body .aw-store-shell .aw-card.aw-seller-orders .table { min-width: 1000px; }
body .aw-store-shell .aw-seller-orders td[data-label="Buyer"] { min-width: 140px; }
body .aw-store-shell .aw-seller-orders td[data-label="Items"] { min-width: 190px; }
body .aw-store-shell .aw-seller-orders td[data-label="Update"] { min-width: 230px; }
body .aw-store-shell .aw-seller-orders td form select { min-width: 0; flex: 1 1 auto; }
body .aw-store-shell .aw-seller-orders td form .select2-container { flex: 1 1 auto; width: auto !important; min-width: 0; max-width: 100%; }
body .aw-store-shell .aw-seller-orders td form .btn { flex: 0 0 auto; white-space: nowrap; }

@media (max-width: 767.98px) {
  body .aw-store-shell .aw-card.aw-seller-orders { background: transparent; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
  body .aw-store-shell .aw-seller-orders .wtz-table-wrap { overflow: visible; }
  body .aw-store-shell .aw-card.aw-seller-orders .table { display: block; min-width: 0; width: 100%; background: transparent; border: 0; }
  body .aw-store-shell .aw-seller-orders .table thead { display: none; }
  body .aw-store-shell .aw-seller-orders .table tbody { display: flex; flex-direction: column; gap: 12px; }
  body .aw-store-shell .aw-seller-orders .table tbody tr { display: block; background: #fff; border: 1px solid #ece4dd; border-radius: 18px; overflow: hidden; box-shadow: 0 6px 18px rgba(44, 26, 35, .05); }
  body .aw-store-shell .aw-seller-orders .table tbody td {
    display: block; position: relative; min-height: 44px; width: auto !important; box-sizing: border-box;
    padding: 11px 16px 11px clamp(112px, 36%, 170px) !important;
    border: 0; border-top: 1px solid #f1ebe5; text-align: left; overflow-wrap: anywhere;
  }
  body .aw-store-shell .aw-seller-orders .table tbody td:first-child { border-top: 0; background: #faf6f2; font-weight: 600; }
  body .aw-store-shell .aw-seller-orders .table tbody td[data-label]::before {
    content: attr(data-label); position: absolute; left: 16px; top: 13px; width: calc(clamp(112px, 36%, 170px) - 28px);
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6A6A6A; line-height: 1.3;
  }
  body .aw-store-shell .aw-seller-orders .table tbody td[colspan] { padding: 28px 16px !important; text-align: center; }
  body .aw-store-shell .aw-seller-orders .table tbody td[data-label] { min-width: 0; }
  body .aw-store-shell .aw-seller-orders td form { width: 100%; }
  body .aw-store-shell .aw-seller-orders td form select { min-height: 44px; font-size: 16px; }
  body .aw-store-shell .aw-seller-orders td form .btn { min-height: 44px; padding-inline: 18px; }
}

/* ---- 4. Rows on 320 to 380px screens: gutters match the 12px page padding ----
   Bootstrap rows here pull 16px outside their container, but below 381px the page padding is
   12px, so every row (cart, admin dashboard of the store, details) stuck out 4px and was
   silently cut off by the shell. Rows that set their own gutter (g-0, g-3 ...) and the product details row are left alone. */
@media (max-width: 380px) {
  body .aw-store-shell .aw-store-main .row:not([class*="g-"]):not([class*="gx-"]):not(.aw-crumb + .row) { --bs-gutter-x: 1.5rem; margin-inline: -12px; }
  body .aw-store-shell .aw-store-main .row:not([class*="g-"]):not([class*="gx-"]):not(.aw-crumb + .row) > * { padding-inline: 12px; }
}

/* ---- 5. Phones: button rows wrap instead of running off the screen ----
   Admin dashboard of the store: "Refund review / Platform Fees / Categories" sat in a row that
   could not wrap and left the 320px screen. Rows that hold a field (coupon box, order status)
   are not touched. */
@media (max-width: 575.98px) {
  body .aw-store-shell .aw-store-main .d-flex.gap-2:has(> .btn):not(:has(> :is(input, select, textarea, .form-control, .form-select))) { flex-wrap: wrap; }
}

/* ---- 6. Small phones ---- */
@media (max-width: 359.98px) {
  body .aw-store-shell .aw-mo-lookup { flex-wrap: wrap; }
  body .aw-store-shell .aw-mo-lookup .aw-ord-btn { flex: 1 1 100%; }
}

/* ---- 7. Touch devices: 40 to 44px hit areas for the small controls the audit found ---- */
@media (pointer: coarse) {
  body .aw-store-shell :is(.aw-my-btn, .awf-mini-btn, .aw-clear-all, .aw-tag, .aw-cat-btn, #awOrdCopy) { min-height: 40px; }
  body .aw-store-shell .aw-seller-orders td form .btn,
  body .aw-store-shell .aw-seller-orders td form select { min-height: 40px; }
  body .aw-store-shell :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]), select, textarea) { font-size: 16px; }
}

/* ---- 9. Browse artwork on phones: calm, uncluttered layout ----
   Before: the page used the whole screen width (controls and cards sat 9 to 10px from the edges), the big
   banner pushed everything down, and the search box, sort box, wishlist heart, category chips and a
   full-width Filters bar stacked as four separate rows before the first piece. Now: a fixed 16px side
   margin; a short banner; search on row one, sort + Filters side by side on row two (the Filters button
   moved into the toolbar in Listing.cshtml); then the category chips. The wishlist heart sits at the top
   right of the heading. The chip row reaches the screen edge and fades out on the right so a cut-off chip
   reads as "scroll for more" (scroll-snap used to pull the first chip against the screen edge). Cards are
   flat and quiet: title first, artist under it in small grey, then price. */
@media (max-width: 767.98px) {
  /* one fixed side margin for every store page on phones, whatever the page wrapper adds */
  body .aw-store-shell .aw-store-main { padding-inline: var(--aw-gut) !important; }
  body .aw-store-shell .aw-store-main .wz-gallery-shell { padding-inline: 0 !important; }

  body .aw-store-shell .wz30-hero { padding: 20px 20px 22px; margin-bottom: 16px; border-radius: 20px; }
  body .aw-store-shell .wz30-hero h2 { font-size: clamp(22px, 6.4vw, 30px); line-height: 1.12; margin: 8px 0 0; }
  body .aw-store-shell .wz30-hero p { font-size: 13.5px; line-height: 1.55; margin: 8px 0 14px; }
  body .aw-store-shell .wz30-hero-cta { padding: 0 18px; height: 40px; font-size: 13px; }
  body .aw-store-shell .aw-store-main .aw-page-title { font-size: clamp(26px, 7.4vw, 30px) !important; }
  body .aw-store-shell .wz-gallery-shell .aw-page-head { gap: 12px; margin-bottom: 14px; }
  body .aw-store-shell .wz-gallery-shell .aw-page-sub { font-size: 13.5px; }

  body .aw-store-shell .aw-page-head .aw-tools {
    display: grid !important; width: 100%; gap: 10px; justify-content: stretch;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "search search" "sort filter";
  }
  body .aw-store-shell .aw-page-head .aw-tools > .aw-search { grid-area: search; width: 100%; max-width: none; border-radius: 999px; }
  body .aw-store-shell .aw-page-head .aw-tools > form#sortForm { grid-area: sort; min-width: 0; }
  body .aw-store-shell .aw-page-head .aw-tools > .aw-filter-toggle { grid-area: filter; }
  /* the wishlist heart sits at the top right of the heading instead of taking space in the toolbar */
  body .aw-store-shell .wz-gallery-shell .aw-page-head { position: relative; }
  body .aw-store-shell .wz-gallery-shell .aw-page-head .aw-tools > .aw-icon-btn { position: absolute; top: 0; right: 0; width: 42px; height: 42px; box-shadow: none; }
  body .aw-store-shell .wz-gallery-shell .aw-page-head:has(> .aw-tools > .aw-icon-btn) > div:first-child { padding-right: 54px; }
  body .aw-store-shell .aw-tools .aw-search input.form-control { height: 44px; border-radius: 999px; border-color: #e7ded8; box-shadow: none; }
  body .aw-store-shell .aw-tools select.aw-select { height: 44px; border-radius: 999px; padding-left: 18px; border-color: #e7ded8; box-shadow: none; }
  body .aw-store-shell .aw-page-head .aw-tools > .aw-filter-toggle {
    width: auto; min-width: 0; height: 44px; min-height: 44px; margin: 0; padding: 0 18px; gap: 8px; border-radius: 999px !important;
    font-size: 14px; font-weight: 600; white-space: nowrap; border-color: #e7ded8; box-shadow: none;
  }
  body .aw-store-shell .aw-filter-count {
    display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: 999px; background: #ff3131; color: #fff; font-size: 11px; font-weight: 600; line-height: 1;
  }

  body .aw-store-shell .aw-chips {
    margin: 0 calc(var(--aw-gut) * -1) 16px !important;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  body .aw-store-shell .aw-chip-scroll { padding: 4px 36px 4px var(--aw-gut); scroll-padding-inline: var(--aw-gut); gap: 8px; }
  body .aw-store-shell .aw-cat-chip { height: 36px; padding: 0 15px; font-size: 13px; font-weight: 500; border-color: #e7ded8; }

  body .aw-store-shell .aw-pc-grid { gap: 16px 12px; }
  body .aw-store-shell .aw-pc { border-radius: 16px; border-color: #eee6e0; box-shadow: none; }
  body .aw-store-shell .wz-gallery-shell .aw-pc-figure { aspect-ratio: 4 / 5; }
  body .aw-store-shell .aw-pc-body { display: flex; flex-direction: column; padding: 10px 12px 14px; }
  body .aw-store-shell .aw-pc-title { order: 1; font-size: 14px !important; font-weight: 500 !important; line-height: 1.35; margin: 0 0 2px; }
  body .aw-store-shell .aw-pc-artist { order: 2; gap: 6px; margin: 0 0 6px; font-size: 12px; color: #756c79; }
  body .aw-store-shell .aw-pc-avatar { display: none; }
  body .aw-store-shell .aw-pc-rating { order: 3; margin-bottom: 4px; }
  body .aw-store-shell .aw-pc-price { order: 4; gap: 2px 6px; }
  body .aw-store-shell .aw-pc-price .now { font-size: 15px; font-weight: 600; }
  body .aw-store-shell .aw-pc-price .was { font-size: 12px; }
  body .aw-store-shell .aw-pc-meta { display: none; }
  body .aw-store-shell .aw-pc-coupon { order: 6; align-self: flex-start; margin-top: 8px; }
  body .aw-store-shell .aw-pc-badge { top: 8px; left: 8px; height: 22px; padding: 0 9px; font-size: 11px; box-shadow: none; }
  body .aw-store-shell .aw-pc-heart { top: 8px; right: 8px; width: 32px; height: 32px; box-shadow: 0 1px 6px rgba(0, 0, 0, .1); }
}
@media (max-width: 575.98px) {
  /* phones: the banner is a short headline strip; the collection starts right below it */
  body .aw-store-shell .wz30-hero p, body .aw-store-shell .wz30-hero-cta { display: none; }
  body .aw-store-shell .wz-gallery-shell .wz-gallery-label { display: none; }
}
/* the Filters button now lives in the toolbar, so the (empty) side column no longer takes a row.
   The site theme also gives every <section> 40px of padding above and below, which left a wide
   blank band between the chips and the first piece. */
@media (max-width: 991.98px) {
  body .aw-store-shell .aw-shop > aside { display: contents; }
  body .aw-store-shell .aw-shop > section { padding-block: 0; }
}
@media (max-width: 991.98px) and (min-width: 768px) {
  body .aw-store-shell .aw-tools > .aw-filter-toggle { width: auto; margin: 0; height: 46px; padding: 0 20px; flex: 0 0 auto; }
}
/* very small phones: Filters becomes a round icon so the sort box keeps its full label */
@media (max-width: 359.98px) {
  body .aw-store-shell .aw-page-head .aw-tools > .aw-filter-toggle { width: 46px; padding: 0; position: relative; }
  body .aw-store-shell .aw-filter-toggle > span:not(.aw-filter-count) { display: none; }
  body .aw-store-shell .aw-filter-toggle .aw-filter-count { position: absolute; top: -5px; right: -5px; border: 2px solid #faf7f2; }
}
/* Tablets (640 to 991px): three columns instead of two oversized cards */
@media (min-width: 640px) and (max-width: 991.98px) {
  body .aw-store-shell .aw-pc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Laptops and desktops: the side rail is always open, so the Filters button is not needed (before this pass it
   showed above the rail and did nothing on a wide screen). */
@media (min-width: 992px) {
  body .aw-store-shell .aw-tools > .aw-filter-toggle { display: none !important; }
}
/* no "stuck" lift on touch screens */
@media (hover: none) {
  body .aw-store-shell .aw-pc:hover { transform: none; }
}
body .aw-store-shell .wz-gallery-issue { font-style: normal; }

/* ---- 10. My orders (and the other order pages) on phones: full-width cards, compact header ----
   .aw-ord brings its own 16px side padding on top of the store container's 16px, so every card was
   inset 32px on each side ("card width is so slim"). On phones the container alone provides the gutter.
   Order cards: status on the first line, order number, then Placed / Total / Payment side by side. */
@media (max-width: 767.98px) {
  body .aw-store-shell .aw-store-main .aw-ord { padding: 4px 0 32px; }
  body .aw-store-shell .aw-ord .aw-back { margin-bottom: 14px; }
}
@media (max-width: 575.98px) {
  body .aw-store-shell .aw-mo-head { margin: 2px 0 16px; }
  body .aw-store-shell .aw-mo-head h1 { font-size: 28px; }
  body .aw-store-shell .aw-mo-head p { margin-top: 6px; font-size: 14px; }
  /* same destination as the Back button right above it */
  body .aw-store-shell .aw-mo-head > .aw-ord-btn { display: none; }
  body .aw-store-shell .aw-mo-lookup { margin-top: 12px; max-width: none; }
  body .aw-store-shell .aw-mo-lookup input { height: 46px; }
  body .aw-store-shell .aw-mo-lookup .aw-ord-btn { min-height: 46px; }

  body .aw-store-shell .aw-mo-bar { gap: 10px; margin-bottom: 14px; }
  body .aw-store-shell .aw-mo-bar .aw-mo-tabs {
    flex: none; width: calc(100% + var(--aw-gut) * 2); max-width: none; margin-inline: calc(var(--aw-gut) * -1);
    padding: 2px 36px 2px var(--aw-gut); scroll-padding-inline: var(--aw-gut);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  body .aw-store-shell .aw-mo-tab { height: 40px; padding: 0 16px; }
  body .aw-store-shell .aw-mo-search input { height: 46px; padding-left: 42px; }
  body .aw-store-shell .aw-mo-search i { left: 16px; }

  body .aw-store-shell .aw-mo-list { gap: 14px; }
  body .aw-store-shell .aw-mo-order { border-radius: 18px; }
  body .aw-store-shell .aw-mo-order .aw-mo-order-head {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 12px 14px; align-items: start; padding: 14px 16px;
  }
  body .aw-store-shell .aw-mo-order .aw-mo-meta { display: contents; }
  body .aw-store-shell .aw-mo-order .aw-mo-order-head .is-status { order: -1; grid-column: 1 / -1; width: auto; }
  body .aw-store-shell .aw-mo-order .aw-mo-meta > div { min-width: 0; }
  body .aw-store-shell .aw-mo-order .aw-mo-meta > div:first-child { grid-column: 1 / -1; }
  body .aw-store-shell .aw-mo-order .aw-mo-meta small { font-size: 11.5px; letter-spacing: .06em; }
  body .aw-store-shell .aw-mo-order .aw-mo-body { padding: 14px 16px 16px; gap: 14px; }
  body .aw-store-shell .aw-mo-order .aw-mo-prods { gap: 12px; }
  body .aw-store-shell .aw-mo-order .aw-mo-thumbs img,
  body .aw-store-shell .aw-mo-order .aw-mo-more { width: 48px; height: 48px; margin-left: -12px; }
  body .aw-store-shell .aw-mo-order .aw-mo-thumbs > :first-child { margin-left: 0; }
  body .aw-store-shell .aw-mo-order .aw-mo-actions { gap: 8px; }
  body .aw-store-shell .aw-mo-order .aw-mo-actions .aw-ord-btn { flex: 1 1 calc(50% - 4px); min-height: 44px; }
  body .aw-store-shell .aw-mo-order .aw-mo-actions form { flex: 1 1 100%; }
}

/* ---- 8. Large monitors: use the extra room instead of a narrow strip in the middle ---- */
@media (min-width: 1920px) {
  body .aw-store-shell .aw-store-main { max-width: 1520px; }
  body .aw-store-shell .aw-store-main:has(.wz-gallery-shell) { max-width: 1800px; }
}
@media (min-width: 2400px) {
  body .aw-store-shell .aw-store-main { max-width: 1680px; }
  body .aw-store-shell .aw-store-main:has(.wz-gallery-shell) { max-width: 2080px; }
}
