/* SHUEVO — tienda / producto / carrito (sobre shuevo.css) */

.sh-page {
  padding: 36px 0 72px;
}

.sh-page-head {
  margin-bottom: 28px;
}

.sh-page-head h1 {
  margin: 0 0 8px;
  font-family: var(--sh-serif);
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 600;
}

.sh-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: var(--sh-muted);
}

.sh-breadcrumbs a:hover { color: var(--sh-olive); }
.sh-breadcrumbs li[hidden] {
  display: none !important;
}
.sh-breadcrumbs li:has(+ li:not([hidden]))::after {
  content: "/";
  margin-left: 8px;
  opacity: .5;
}

.sh-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.sh-filters a,
.sh-filter-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(76, 88, 47, 0.22);
  background: transparent;
  font-family: var(--sh-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sh-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}

.sh-filters a:hover,
.sh-filters a.is-active,
.sh-filter-chip:hover,
.sh-filter-chip.is-active {
  background: var(--sh-olive);
  border-color: var(--sh-olive);
  color: #fff;
}

/* Toolbar: buscador + categorías */
.sh-shop-toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.sh-shop-search {
  position: relative;
  display: block;
  width: 100%;
  max-width: 420px;
}

.sh-shop-search-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sh-muted);
  pointer-events: none;
  display: grid;
  place-items: center;
}

.sh-shop-search input {
  width: 100%;
  box-sizing: border-box;
  height: 46px;
  padding: 0 42px 0 42px;
  border: 1px solid rgba(76, 88, 47, 0.18);
  border-radius: 999px;
  background: #fff;
  font-family: var(--sh-sans);
  font-size: 16px;
  color: var(--sh-ink);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.sh-shop-search input::placeholder {
  color: var(--sh-muted);
}

.sh-shop-search input:focus {
  border-color: rgba(76, 88, 47, 0.45);
  box-shadow: 0 0 0 3px rgba(76, 88, 47, 0.1);
}

.sh-shop-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--sh-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.sh-shop-search-clear:hover {
  color: var(--sh-olive);
}

.sh-shop-toolbar .sh-filters {
  margin-bottom: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 8px;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 28px), transparent 100%);
}

.sh-shop-toolbar .sh-filters::-webkit-scrollbar {
  display: none;
}

.sh-filter-chip {
  scroll-snap-align: start;
}

.sh-shop-empty {
  margin: 0 0 18px;
  color: var(--sh-muted);
  font-size: 14px;
}

.sh-card[hidden] {
  display: none !important;
}

@media (min-width: 900px) {
  .sh-shop-toolbar {
    gap: 16px;
  }

  .sh-shop-search {
    max-width: 480px;
  }

  .sh-shop-toolbar .sh-filters {
    mask-image: none;
    padding-bottom: 4px;
  }
}

/* Cart drawer */
.cart-modal {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100%;
  z-index: 10001;
  background: var(--sh-cream) !important;
  color: var(--sh-ink);
  font-family: var(--sh-sans);
  box-shadow: -12px 0 40px rgba(43, 41, 36, 0.16);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .45s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-cart-open .cart-modal {
  transform: translateX(0);
}

.modal-cart-open {
  overflow: hidden;
}

.site-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(43, 41, 36, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}

.modal-cart-open .site-modal-backdrop {
  opacity: 1;
  visibility: visible;
}

.cart-modal .cart-modal-header {
  padding: 28px 28px 20px;
  border-bottom: 1px solid rgba(76, 88, 47, 0.12);
  position: relative;
}

.cart-modal .modal-close {
  position: absolute;
  right: 18px;
  top: 18px;
  border: 0;
  cursor: pointer;
  color: #fff;
}

.cart-modal .cart-modal-header .main-title {
  display: block;
  font-size: 15px;
  line-height: 22px;
  font-weight: 400;
  color: var(--sh-muted);
  margin: 0;
  padding-right: 48px;
}

.cart-modal .cart-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.cart-modal .cart-empty {
  display: none;
  color: var(--sh-muted);
  opacity: 0;
  transform: translateY(8px);
}

/* Bloque vacío completo (hint + CTA): solo con carrito vacío */
.cart-modal .cart-empty-block {
  display: none;
  text-align: center;
  padding: 12px 8px 8px;
}

.cart-modal .cart-empty-hint {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--sh-muted);
}

.cart-modal .cart-empty-cta {
  display: inline-flex;
}

.cart-modal.is-empty .cart-empty-block {
  display: block;
}

.cart-modal.is-empty .cart-empty {
  display: block;
  animation: sh-cart-empty-in .42s cubic-bezier(.22, 1, .36, 1) forwards;
}

@keyframes sh-cart-empty-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cart-modal.is-empty .cart-list { display: none; }

.cart-modal .cart-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cart-modal .cart-list li {
  display: flex;
  align-items: flex-start;
  position: relative;
  margin: 0 0 28px;
  padding: 0 28px 0 0;
  overflow: hidden;
  transition:
    opacity .36s cubic-bezier(.22, 1, .36, 1),
    transform .36s cubic-bezier(.22, 1, .36, 1),
    max-height .42s cubic-bezier(.22, 1, .36, 1),
    margin .42s cubic-bezier(.22, 1, .36, 1),
    padding .42s cubic-bezier(.22, 1, .36, 1);
}

.cart-modal .cart-list li.is-leaving {
  opacity: 0;
  transform: translateX(14px) scale(0.98);
  max-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  pointer-events: none;
}

.cart-modal .cart-list .image {
  width: 72px;
  flex-shrink: 0;
  margin: 0 18px 0 0;
  overflow: hidden;
  border-radius: 10px;
  background: var(--sh-cream-deep);
}

.cart-modal .cart-list .image img {
  max-width: 100%;
  display: block;
}

.cart-modal .cart-list .description { flex: 1; min-width: 0; }

.cart-modal .cart-modal-footer {
  padding: 20px 28px 28px;
  border-top: 1px solid rgba(76, 88, 47, 0.12);
  background: var(--sh-cream-deep);
}

.cart-modal .total-price-area {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 20px;
}

.cart-modal .total-price-area .title-text {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sh-muted);
}

.cart-modal .total-price-area .price {
  font-family: var(--sh-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--sh-olive);
}

.cart-modal .cart-actions {
  display: grid;
  gap: 8px;
}

.cart-modal .btn-primary,
.cart-modal .sh-btn:not(.sh-btn-ghost) {
  background: var(--sh-olive);
  color: #fff;
}

/* Ghost no puede heredar oliva+oliva (texto invisible) */
.cart-modal .cart-actions .sh-btn-ghost {
  background: transparent !important;
  color: var(--sh-olive) !important;
  border: 1px solid rgba(76, 88, 47, 0.28) !important;
  box-shadow: none !important;
}

.cart-modal .cart-actions .sh-btn-ghost:hover {
  background: var(--sh-olive) !important;
  color: #fff !important;
  border-color: var(--sh-olive) !important;
}

.cart-num {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--sh-gold);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sh-icon-btn { position: relative; }

/* Product detail overrides */
body.shuevo-body .main-heading,
body.shuevo-body .product-title,
body.shuevo-body h1.main-heading {
  font-family: var(--sh-serif) !important;
  color: var(--sh-ink);
}

body.shuevo-body .btn-primary,
body.shuevo-body button.btn-primary,
body.shuevo-body .add-to-cart,
body.shuevo-body [data-add-to-cart].btn {
  background: var(--sh-olive) !important;
  border-color: var(--sh-olive) !important;
  border-radius: 999px !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.shuevo-body .price,
body.shuevo-body .product-price {
  color: var(--sh-olive) !important;
  font-family: var(--sh-serif);
}

.sh-empty-note {
  padding: 48px 24px;
  text-align: center;
  color: var(--sh-muted);
  border: 1px dashed rgba(76, 88, 47, 0.25);
  border-radius: var(--sh-radius);
  background: rgba(255,255,255,0.35);
  grid-column: 1 / -1;
}

/* Cart page */
.sh-cart-page {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 320px);
  gap: 32px;
  align-items: start;
}

.sh-cart-table {
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(76, 88, 47, 0.12);
  border-radius: var(--sh-radius);
  overflow: hidden;
}

.sh-cart-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(76, 88, 47, 0.08);
}

.sh-cart-head {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sh-muted);
  font-weight: 700;
  background: rgba(76, 88, 47, 0.04);
}

.sh-cart-product {
  display: flex;
  gap: 14px;
  align-items: center;
}

.sh-cart-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--sh-cream-deep);
}

.sh-cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sh-cart-name {
  font-family: var(--sh-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--sh-olive);
  line-height: 1.25;
}

.sh-cart-product-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.sh-cart-product-meta .sh-cart-name {
  flex: 1;
  min-width: 0;
}

.sh-cart-unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--sh-muted);
}

.sh-cart-line-total {
  font-family: var(--sh-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--sh-olive);
}

.sh-cart-remove {
  display: none;
}

.sh-cart-qty {
  justify-content: center;
}

.cart-modal .cart-list .product-name {
  display: block;
  font-family: var(--sh-serif);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.25;
}

.cart-modal .cart-list .product-name a {
  color: var(--sh-olive);
  text-decoration: none;
}

.cart-modal .cart-list .product-name a:hover {
  color: var(--sh-olive-dark);
}

.cart-modal .cart-list .price {
  display: block;
  font-family: var(--sh-serif);
  font-size: 18px;
  color: var(--sh-olive);
  font-weight: 700;
  margin-bottom: 10px;
}

.cart-modal .cart-list .icon-close {
  display: none;
}

.cart-modal .modal-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid transparent;
  background: var(--sh-olive);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.cart-modal .modal-close:hover {
  color: #fff;
  background: var(--sh-olive-dark);
  border-color: transparent;
}

.cart-modal .cart-modal-header .main-title i {
  font-family: var(--sh-serif);
  font-style: normal;
  font-size: 18px;
  color: var(--sh-olive);
  font-weight: 700;
}

.sh-cart-summary {
  position: sticky;
  top: 100px;
  padding: 24px;
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(76, 88, 47, 0.12);
  border-radius: var(--sh-radius);
}

.sh-cart-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sh-muted);
}

.sh-cart-summary-total strong {
  font-family: var(--sh-serif);
  font-size: 28px;
  color: var(--sh-olive);
}

.sh-cart-summary-note {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--sh-muted);
  line-height: 1.6;
}

.sh-cart-summary-actions {
  display: grid;
  gap: 10px;
}

.sh-btn-ghost {
  background: transparent;
  color: var(--sh-olive);
  border: 1px solid rgba(76, 88, 47, 0.35);
}

.sh-btn-ghost:hover {
  background: rgba(76, 88, 47, 0.06);
}

@media (max-width: 900px) {
  .sh-cart-page {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .sh-cart-row:not(.sh-cart-head) {
    grid-template-columns: 64px 1fr;
    grid-template-areas:
      "thumb meta"
      "thumb price"
      "thumb qty"
      "total total";
    gap: 10px 14px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.45);
    margin-bottom: 10px;
    border-bottom: 0;
  }
  .sh-cart-row:not(.sh-cart-head) .sh-cart-product {
    display: contents;
  }
  .sh-cart-row:not(.sh-cart-head) .sh-cart-thumb {
    grid-area: thumb;
    width: 64px;
    height: 64px;
    flex: none;
  }
  .sh-cart-row:not(.sh-cart-head) .sh-cart-product-meta {
    grid-area: meta;
  }
  .sh-cart-row:not(.sh-cart-head) .sh-cart-unit {
    grid-area: price;
    font-size: 13px;
  }
  .sh-cart-row:not(.sh-cart-head) .sh-cart-unit::before {
    content: "Precio: ";
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 10px;
    color: var(--sh-gold);
  }
  .sh-cart-row:not(.sh-cart-head) .sh-cart-qty {
    grid-area: qty;
    justify-content: flex-start;
  }
  .sh-cart-row:not(.sh-cart-head) .sh-cart-line-total {
    grid-area: total;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(76, 88, 47, 0.08);
    font-size: 22px;
  }
  .sh-cart-row:not(.sh-cart-head) .sh-cart-line-total::before {
    content: "Total";
    font-family: var(--sh-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sh-muted);
  }
  .sh-cart-head { display: none; }
  .sh-cart-table {
    background: transparent;
    border: 0;
  }
  .sh-cart-summary { position: static; }
}

/* Carrito móvil — bottom sheet tipo app */
@media (max-width: 720px) {
  .sh-shop-toolbar {
    gap: 12px;
    margin-bottom: 22px;
  }

  .sh-shop-search {
    max-width: none;
  }

  .sh-shop-search input {
    height: 44px;
    font-size: 16px;
  }

  .sh-shop-toolbar .sh-filters {
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
    padding-right: 20px;
  }

  .cart-modal {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: calc(100dvh - 56px);
    max-height: calc(100vh - 56px);
    border-radius: 22px 22px 0 0;
    transform: translateY(104%);
    box-shadow: 0 -12px 40px rgba(43, 41, 36, 0.16);
  }

  .modal-cart-open .cart-modal {
    transform: none;
  }

  .cart-modal .cart-modal-header {
    padding: 18px 18px 14px;
  }

  .cart-modal .cart-modal-header::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: rgba(76, 88, 47, 0.22);
  }

  .cart-modal .cart-modal-header .main-title {
    font-size: 18px;
    padding-right: 36px;
  }

  .cart-modal .cart-modal-body {
    padding: 12px 16px;
  }

  .cart-modal .cart-modal-footer {
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  }

  .cart-modal .cart-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .cart-modal .cart-actions .sh-btn {
    width: 100%;
    min-height: 48px;
    padding: 12px 10px;
    font-size: 11px;
  }

  .cart-modal .cart-list li {
    padding: 12px 0;
    gap: 10px;
  }
}
