/* PiMa WooCommerce skin: classic cart/checkout with the atelier visual system. */

.site-account-link,
.site-cart-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: var(--pima-ink);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 160ms ease, color 160ms ease;
}

.site-account-link {
  width: 44px;
  border-radius: 999px;
}

.site-account-link:hover { color: var(--pima-rose); }

.site-account-icon,
.site-cart-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-cart-link {
  gap: 10px;
  padding: 0 16px;
  border: 1px solid rgba(238, 232, 225, 0.16);
  border-radius: 999px;
}

.site-cart-link:hover { border-color: rgba(238, 232, 225, 0.45); }

.site-cart-count {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  color: #fff;
  background: var(--pima-accent);
  font-size: 11px;
}

@media (max-width: 960px) {
  .site-cart-link {
    position: relative;
    width: 44px;
    padding: 0;
    border-color: transparent;
  }

  .site-cart-link .site-action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .site-cart-count {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 17px;
    height: 17px;
    font-size: 10px;
  }
}

.pima-commerce-shell,
.pima-content--commerce {
  width: min(var(--pima-max), calc(100% - 32px));
  margin-inline: auto;
}

.pima-commerce-shell {
  padding: 52px 0 90px;
}

.pima-content--commerce {
  padding-bottom: 90px;
}

.woocommerce {
  color: var(--pima-ink);
}

.woocommerce h1,
.woocommerce h2,
.woocommerce h3,
.woocommerce .woocommerce-order-details__title,
.woocommerce .woocommerce-column__title {
  color: var(--pima-ink);
  font-family: var(--pima-font-display);
}

/* Store headings sit inside panels and columns, not at page level. The theme's
   editorial scale (up to 58px for an h2) overflowed them: "Indirizzo di
   fatturazione" ran straight over the neighbouring column. The page title in
   the hero above is untouched, it lives outside .woocommerce. */
.woocommerce h2,
.woocommerce .woocommerce-order-details__title,
.woocommerce .woocommerce-column__title {
  margin: 0 0 12px;
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1.15;
}

.woocommerce h3 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.2;
}

.woocommerce a {
  color: var(--pima-rose);
}

.woocommerce small,
.woocommerce .product-name dl.variation,
.woocommerce .woocommerce-order-overview,
.woocommerce .woocommerce-customer-details address {
  color: var(--pima-muted);
}

.woocommerce-notices-wrapper,
.woocommerce-form-coupon-toggle,
.woocommerce-form-login-toggle {
  margin-bottom: 18px;
}

.woocommerce-error,
.woocommerce-info,
.woocommerce-message {
  margin: 0 0 18px !important;
  padding: 15px 18px 15px 50px !important;
  border: 1px solid var(--pima-line);
  border-top: 1px solid var(--pima-line) !important;
  border-radius: 6px;
  color: var(--pima-ink);
  background: rgba(21, 18, 24, 0.96);
}

.woocommerce-message {
  border-color: rgba(91, 184, 121, 0.38);
}

.woocommerce-info {
  border-color: rgba(126, 135, 144, 0.48);
}

.woocommerce-error {
  border-color: rgba(255, 92, 113, 0.54);
}

.woocommerce-error::before,
.woocommerce-info::before,
.woocommerce-message::before {
  color: var(--pima-rose) !important;
  top: 15px !important;
}

.woocommerce table.shop_table,
.woocommerce table.shop_table_responsive,
.woocommerce table.woocommerce-table,
.woocommerce .woocommerce-customer-details address {
  overflow: hidden;
  border: 1px solid var(--pima-line) !important;
  border-collapse: separate;
  border-radius: 8px;
  color: var(--pima-ink);
  background: rgba(17, 15, 20, 0.9);
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td,
.woocommerce table.woocommerce-table th,
.woocommerce table.woocommerce-table td {
  padding: 16px !important;
  border-color: var(--pima-line) !important;
}

.woocommerce table.shop_table th,
.woocommerce table.woocommerce-table th {
  color: #d9ced2;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* The configurable hilt is one technical product with no catalogue image, so
   the thumbnail column only ever rendered a broken-image placeholder. */
.woocommerce-cart-form__cart-item .product-thumbnail,
.woocommerce-cart table.shop_table th.product-thumbnail {
  display: none;
}

/* The chosen components are a compact spec list, not a second product
   description: label on the left, piece and price on one line. */
.woocommerce .product-name .variation,
.woocommerce .wc-item-meta {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  gap: 6px 16px;
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--pima-line);
  border-left: 2px solid rgba(211, 58, 119, 0.5);
  border-radius: 6px;
  background: rgba(12, 11, 15, 0.5);
}

.woocommerce .product-name .variation dt,
.woocommerce .wc-item-meta-label {
  float: none !important;
  margin: 0 !important;
  color: var(--pima-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.woocommerce .product-name .variation dd,
.woocommerce .wc-item-meta li {
  float: none !important;
  margin: 0 !important;
  color: var(--pima-ink);
  font-size: 12px;
}

.woocommerce .product-name .variation dd p,
.woocommerce .wc-item-meta li p {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
}

.pima-line__name {
  font-weight: 600;
}

.pima-line__price {
  margin-left: auto;
  color: var(--pima-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pima-line__detail {
  flex-basis: 100%;
  color: var(--pima-muted);
  font-size: 11px;
}

/* The checkout summary column is too narrow for a label beside the value. */
.woocommerce-checkout #order_review .product-name .variation {
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

.woocommerce-checkout #order_review .product-name .variation dt {
  margin-top: 6px !important;
}

/* Order and e-mail meta arrive as a flat list, without the grid's two columns. */
.woocommerce .wc-item-meta {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.woocommerce .wc-item-meta li {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  gap: 10px;
}

.pima-cart-code {
  display: block;
  margin-top: 5px;
  color: var(--pima-muted);
  font-family: var(--pima-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.woocommerce .quantity .qty,
.woocommerce input.input-text,
.woocommerce textarea,
.woocommerce select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  min-height: 44px;
  border: 1px solid var(--pima-line) !important;
  border-radius: 4px !important;
  color: var(--pima-ink) !important;
  background: #0c0b0f !important;
  box-shadow: none !important;
}

.woocommerce textarea {
  min-height: 110px;
  padding: 12px;
}

.woocommerce input.input-text,
.woocommerce select {
  padding: 0 12px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--pima-ink) !important;
  line-height: 42px !important;
}

.select2-dropdown,
.select2-results__option {
  color: var(--pima-ink);
  border-color: var(--pima-line) !important;
  background: #121016;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--pima-pink) !important;
}

.woocommerce form .form-row label {
  color: #d9ced2;
  font-size: 12px;
  font-weight: 700;
}

.woocommerce form .form-row .required {
  color: var(--pima-rose);
}

/* WooCommerce buttons come with line-height: 1, so a 12px line box sat at the
   top of a 46px min-height box with no vertical padding: every label looked
   clipped against the upper edge. Centring the content and giving the label
   real vertical padding fixes it for buttons, links and inputs alike, and lets
   a long label wrap inside the button instead of being cut. */
.woocommerce button.button,
.woocommerce a.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce #payment #place_order,
.woocommerce .checkout-button,
.woocommerce a.woocommerce-button,
.woocommerce button.woocommerce-button,
.woocommerce-MyAccount-content a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #fff !important;
  background: var(--pima-accent) !important;
  font-family: var(--pima-font-body);
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  letter-spacing: 0.01em;
  text-align: center;
  transition: background 160ms ease;
}

.woocommerce button.button:hover,
.woocommerce a.button:hover,
.woocommerce #payment #place_order:hover,
.woocommerce .checkout-button:hover {
  background: var(--pima-accent-hover) !important;
}

/* An input is a replaced element and ignores flex, but it centres its own
   value once the vertical padding is there. */
.woocommerce input.button,
.woocommerce #respond input#submit {
  display: inline-block;
  line-height: normal !important;
}

.woocommerce button.button:disabled,
.woocommerce button.button:disabled[disabled] {
  opacity: 0.5;
}

.woocommerce .cart-collaterals .cart_totals,
.woocommerce-checkout-review-order,
.woocommerce form.checkout_coupon,
.woocommerce form.login,
.woocommerce form.register,
.woocommerce-MyAccount-content,
.woocommerce-order-details,
.woocommerce-customer-details {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--pima-line);
  border-radius: 8px;
  background: rgba(21, 18, 24, 0.78);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

/* The totals used to sit inside a full-width panel that was mostly empty
   space. The panel is the totals box itself now, aligned to the right under
   the cart it summarises. */
.woocommerce .cart-collaterals {
  display: flow-root;
  margin-top: 24px;
}

.woocommerce .cart-collaterals .cart_totals {
  float: none;
  width: min(100%, 420px);
  margin-left: auto;
}

.woocommerce .cart-collaterals .cart_totals h2 {
  margin: 0 0 14px;
  color: var(--pima-muted);
  font-family: var(--pima-font-body);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.woocommerce .cart_totals table.shop_table {
  border: 0 !important;
  background: transparent;
}

.woocommerce .cart_totals table.shop_table th,
.woocommerce .cart_totals table.shop_table td {
  padding: 10px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--pima-line) !important;
  vertical-align: baseline;
}

.woocommerce .cart_totals table.shop_table td {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.woocommerce .cart_totals .order-total th,
.woocommerce .cart_totals .order-total td {
  border-bottom: 0 !important;
  color: var(--pima-ink);
  font-size: 15px;
}

.woocommerce .cart_totals .woocommerce-shipping-destination,
.woocommerce .cart_totals .shipping-calculator-button {
  font-size: 12px;
}

.woocommerce .cart_totals .wc-proceed-to-checkout {
  padding: 16px 0 0;
}

.woocommerce .cart_totals .wc-proceed-to-checkout a.checkout-button {
  display: flex;
  width: 100%;
}

/* Cart actions: one primary action per screen. Applying a coupon and
   refreshing quantities are secondary next to proceeding to checkout. */
.woocommerce .actions .coupon {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.woocommerce .actions .coupon .input-text#coupon_code {
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0;
}

.woocommerce .actions .button[name="apply_coupon"],
.woocommerce .actions .button[name="update_cart"] {
  flex: 0 0 auto;
  color: var(--pima-ink) !important;
  border: 1px solid var(--pima-line) !important;
  background: rgba(12, 11, 15, 0.8) !important;
}

.woocommerce .actions .button[name="apply_coupon"]:hover,
.woocommerce .actions .button[name="update_cart"]:hover {
  border-color: rgba(211, 58, 119, 0.5) !important;
}

/* "Applica codice promozionale" is a long label in a narrow slot and was
   breaking across three lines inside the button. The row wraps before the
   label does: a button on its own line reads fine, a shredded label does not. */
.woocommerce .button[name="apply_coupon"],
.woocommerce .button[name="update_cart"] {
  white-space: nowrap;
}

/* The checkout coupon form ships as floated halves, which left the button in
   a column too narrow for its own label. */
.woocommerce form.checkout_coupon .form-row {
  float: none;
  width: auto;
  margin: 0;
  padding: 0;
}

.woocommerce form.checkout_coupon {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.woocommerce form.checkout_coupon p:not(.form-row) {
  flex-basis: 100%;
  margin: 0;
}

.woocommerce form.checkout_coupon .form-row-first {
  flex: 1 1 200px;
  min-width: 0;
}

.woocommerce-checkout .col2-set,
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout #order_review {
  width: 100%;
}

/* Two explicit rows. Without them the heading and the summary each landed in
   an implicit row sized by the billing column, which pushed the summary down
   by the full height of the form and left a screen of empty space above it. */
.woocommerce-checkout form.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  grid-template-rows: auto 1fr;
  gap: 14px 26px;
  align-items: start;
}

.woocommerce-checkout #customer_details {
  grid-column: 1;
  grid-row: 1 / 3;
}

.woocommerce-checkout #order_review_heading {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  color: var(--pima-muted);
  font-family: var(--pima-font-body);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.woocommerce-checkout #order_review {
  grid-column: 2;
  grid-row: 2;
}

.woocommerce-checkout #order_review table.shop_table {
  border: 0 !important;
  background: transparent;
}

.woocommerce-checkout #order_review table.shop_table th,
.woocommerce-checkout #order_review table.shop_table td {
  padding: 12px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--pima-line) !important;
}

.woocommerce-checkout #order_review table.shop_table td.product-total,
.woocommerce-checkout #order_review table.shop_table .order-total td {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.woocommerce-checkout #order_review table.shop_table .order-total th,
.woocommerce-checkout #order_review table.shop_table .order-total td {
  border-bottom: 0 !important;
  font-size: 15px;
}

.woocommerce-checkout .col2-set .col-1,
.woocommerce-checkout .col2-set .col-2 {
  float: none;
  width: 100%;
  padding: 22px;
  border: 1px solid var(--pima-line);
  border-radius: 8px;
  background: rgba(21, 18, 24, 0.72);
}

.woocommerce-checkout .col2-set .col-2 {
  margin-top: 18px;
}

.woocommerce-checkout #payment {
  color: var(--pima-ink);
  background: #0f0d12 !important;
}

.woocommerce-checkout #payment ul.payment_methods,
.woocommerce-checkout #payment div.form-row {
  border-color: var(--pima-line) !important;
}

.woocommerce-checkout #payment div.payment_box {
  color: var(--pima-muted) !important;
  background: #1b171f !important;
}

.woocommerce-checkout #payment div.payment_box::before {
  border-bottom-color: #1b171f !important;
}

.pima-sandbox-notice {
  padding: 12px;
  border: 1px solid rgba(211, 58, 119, 0.32);
  border-radius: 4px;
  background: rgba(211, 58, 119, 0.07);
}

.pima-sandbox-notice p {
  margin: 5px 0 10px;
}

/* The addresses page ships as floated 48% columns with the edit link floated
   inside the heading, so the link landed on top of the title. Grid and a flex
   header instead, and the pair collapses to one column when it no longer fits. */
.woocommerce .woocommerce-Addresses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
}

/* WooCommerce clears its floated columns with ::before and ::after set to
   display: table. Once the container is a grid those two become grid items of
   their own, taking the first and last cell and pushing the two cards onto a
   diagonal. They have no job left here. */
.woocommerce .woocommerce-Addresses::before,
.woocommerce .woocommerce-Addresses::after {
  display: none;
}

.woocommerce .woocommerce-Addresses .woocommerce-Address {
  float: none;
  width: auto;
  padding: 20px;
  border: 1px solid var(--pima-line);
  border-radius: 8px;
  background: rgba(12, 11, 15, 0.5);
}

.woocommerce .woocommerce-Address-title {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
  margin-bottom: 14px;
}

/* These titles sit in cards barely 280px wide. Sharing the row with the edit
   link left them no room and they broke over two lines, so the title takes the
   row and the link sits under it. */
.woocommerce .woocommerce-Address-title h2,
.woocommerce .woocommerce-Address-title h3 {
  flex: 1 1 100%;
  margin: 0;
  font-size: 19px;
  text-wrap: balance;
}

.woocommerce .woocommerce-Address-title .edit {
  float: none;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
}

.woocommerce .woocommerce-Address address {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-style: normal;
  line-height: 1.7;
}

.woocommerce-MyAccount-navigation {
  float: left;
  width: 25%;
}

.woocommerce-MyAccount-navigation ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.woocommerce-MyAccount-navigation a {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--pima-line);
  border-radius: 4px;
  color: var(--pima-muted);
  background: rgba(12, 11, 15, 0.76);
}

.woocommerce-MyAccount-navigation .is-active a {
  color: #fff;
  border-color: rgba(211, 58, 119, 0.56);
  background: rgba(211, 58, 119, 0.1);
}

.woocommerce-MyAccount-content {
  float: right;
  width: 72%;
}

.woocommerce ul.order_details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
  padding: 0;
}

.woocommerce ul.order_details li {
  float: none;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--pima-line);
  color: var(--pima-muted);
  background: rgba(21, 18, 24, 0.74);
}

.woocommerce ul.order_details li strong {
  color: var(--pima-ink);
}

@media (max-width: 1040px) {

  .woocommerce-checkout form.checkout {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .woocommerce-checkout #customer_details,
  .woocommerce-checkout #order_review_heading,
  .woocommerce-checkout #order_review {
    grid-column: 1;
    grid-row: auto;
  }

  .woocommerce-checkout #order_review_heading {
    margin-top: 10px;
  }
}

@media (max-width: 760px) {
  .woocommerce table.shop_table_responsive tr td::before {
    color: var(--pima-muted);
  }

  .woocommerce .woocommerce-cart-form table.shop_table_responsive tr {
    display: grid;
    gap: 0;
    margin-bottom: 16px;
    border: 1px solid var(--pima-line);
    border-radius: 7px;
    background: rgba(21, 18, 24, 0.88);
  }

  .woocommerce .woocommerce-cart-form table.shop_table_responsive tr td {
    border: 0 !important;
    border-bottom: 1px solid var(--pima-line) !important;
  }

  .woocommerce .woocommerce-cart-form table.shop_table_responsive tr td:last-child {
    border-bottom: 0 !important;
  }

  .woocommerce-MyAccount-navigation,
  .woocommerce-MyAccount-content {
    float: none;
    width: 100%;
  }

  .woocommerce-MyAccount-content {
    margin-top: 18px;
  }

  .woocommerce ul.order_details {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .woocommerce ul.order_details {
    grid-template-columns: 1fr;
  }
}
