/* FIX 17.2 — Jerarquía visual de producto, carrito, checkout y mini carrito */

/* -----------------------------
   Producto individual
------------------------------ */
body.tc-wc-single-product .tc-wc-global-container {
  width:min(1400px,calc(100% - 48px));
  padding-top:56px;
  padding-bottom:88px;
}

body.tc-wc-single-product div.product {
  width:100%;
  max-width:none;
  margin:0;
  padding:0;
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(390px,.95fr);
  column-gap:clamp(36px,5vw,72px);
  row-gap:48px;
  align-items:start;
}

body.tc-wc-single-product div.product::before,
body.tc-wc-single-product div.product::after {
  content:none!important;
  display:none!important;
}

body.tc-wc-single-product div.product div.images,
body.tc-wc-single-product div.product div.summary {
  float:none!important;
  width:100%!important;
  max-width:none!important;
  min-width:0;
  margin:0!important;
}

body.tc-wc-single-product div.product div.images {
  position:relative!important;
  top:auto!important;
  align-self:start;
  z-index:1;
  overflow:visible;
}

body.tc-wc-single-product .woocommerce-product-gallery__wrapper {
  width:100%;
  margin:0;
}

body.tc-wc-single-product .woocommerce-product-gallery__image,
body.tc-wc-single-product .woocommerce-product-gallery__image a {
  width:100%;
  min-width:0;
}

body.tc-wc-single-product .woocommerce-product-gallery__image a {
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:clamp(360px,42vw,620px);
  background:#fff;
}

body.tc-wc-single-product .woocommerce-product-gallery__image img {
  display:block;
  width:100%!important;
  max-width:100%;
  height:auto!important;
  max-height:620px;
  margin:auto;
  object-fit:contain;
  object-position:center;
}

body.tc-wc-single-product div.product div.summary {
  align-self:start;
  padding:clamp(4px,1vw,14px) 0 0;
}

body.tc-wc-single-product div.product .woocommerce-tabs,
body.tc-wc-single-product div.product .related,
body.tc-wc-single-product div.product .upsells {
  grid-column:1 / -1;
  clear:both;
  width:100%!important;
  max-width:none;
  min-width:0;
  margin-left:0;
  margin-right:0;
}

body.tc-wc-single-product div.product .woocommerce-tabs {
  margin-top:8px;
}

body.tc-wc-single-product .woocommerce-Tabs-panel,
body.tc-wc-single-product .woocommerce-Tabs-panel table,
body.tc-wc-single-product .woocommerce-product-attributes {
  width:100%;
  max-width:100%;
}

body.tc-wc-single-product .woocommerce-product-attributes {
  table-layout:fixed;
}

body.tc-wc-single-product .woocommerce-product-attributes th {
  width:28%;
  min-width:170px;
}

body.tc-wc-single-product .related ul.products,
body.tc-wc-single-product .upsells ul.products {
  width:100%;
}

/* -----------------------------
   Carrito clásico
------------------------------ */
.tc-wc-cart-page .tc-wc-page-container,
.tc-wc-checkout-page .tc-wc-page-container,
.tc-wc-order-received .tc-wc-page-container {
  width:min(var(--tc-cc-max,1400px),calc(100% - 48px));
  max-width:1400px;
  padding-top:56px;
  padding-bottom:80px;
}

.tc-wc-cart-page .tc-wc-page-content > .woocommerce {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(360px,430px);
  gap:32px;
  align-items:start;
}

.tc-wc-cart-page .tc-checkout-progress,
.tc-wc-cart-page .woocommerce-notices-wrapper,
.tc-wc-cart-page .woocommerce-message,
.tc-wc-cart-page .woocommerce-info,
.tc-wc-cart-page .woocommerce-error,
.tc-wc-cart-page .cart-empty,
.tc-wc-cart-page .return-to-shop,
.tc-wc-cart-page .tc-cart-empty-copy {
  grid-column:1 / -1;
}

.tc-wc-cart-page .woocommerce-cart-form {
  grid-column:1;
  min-width:0;
  margin:0!important;
  padding:clamp(20px,2.4vw,32px);
}

.tc-wc-cart-page .cart-collaterals {
  grid-column:2;
  width:100%!important;
  min-width:0;
  margin:0!important;
  padding:0;
  background:transparent;
  border:0;
}

.tc-wc-cart-page .cart_totals {
  float:none!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:clamp(22px,2.4vw,30px);
  background:var(--tc-cc-panel);
  border:1px solid var(--tc-cc-border);
  border-radius:var(--tc-cc-radius);
  position:sticky;
  top:170px;
}

.tc-wc-cart-page .cart_totals h2 {
  margin:0 0 20px;
  font-size:clamp(22px,2vw,28px);
}

.tc-wc-cart-page table.shop_table {
  width:100%;
  table-layout:auto;
  margin:0;
}

.tc-wc-cart-page table.cart th,
.tc-wc-cart-page table.cart td {
  padding:18px 12px;
  vertical-align:middle;
}

.tc-wc-cart-page table.cart .product-thumbnail {
  width:112px;
}

.tc-wc-cart-page table.cart .product-price,
.tc-wc-cart-page table.cart .product-quantity,
.tc-wc-cart-page table.cart .product-subtotal {
  white-space:nowrap;
}

.tc-wc-cart-page table.cart td.actions {
  padding-top:24px;
  padding-bottom:4px;
}

.tc-wc-cart-page table.cart td.actions .coupon {
  display:flex;
  gap:10px;
  align-items:center;
  max-width:520px;
}

.tc-wc-cart-page table.cart td.actions .coupon .input-text {
  width:min(250px,100%)!important;
  min-width:0;
}

.tc-wc-cart-page .wc-proceed-to-checkout {
  padding:20px 0 0!important;
}

.tc-wc-cart-page .wc-proceed-to-checkout a.checkout-button {
  display:flex!important;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:56px;
  margin:0!important;
  font-size:15px!important;
}

/* -----------------------------
   Checkout clásico
------------------------------ */
.tc-wc-checkout-page .tc-wc-page-content > .woocommerce {
  width:100%;
}

.tc-wc-checkout-page form.checkout {
  width:100%;
  max-width:none;
  display:grid!important;
  grid-template-columns:minmax(0,1.15fr) minmax(390px,.85fr);
  column-gap:clamp(32px,4vw,56px);
  row-gap:22px;
  align-items:start;
}

.tc-wc-checkout-page form.checkout::before,
.tc-wc-checkout-page form.checkout::after {
  content:none!important;
  display:none!important;
}

.tc-wc-checkout-page #customer_details,
.tc-wc-checkout-page #order_review_heading,
.tc-wc-checkout-page #order_review {
  float:none!important;
  width:100%!important;
  max-width:none!important;
  min-width:0;
  margin-left:0!important;
  margin-right:0!important;
}

.tc-wc-checkout-page #customer_details {
  grid-column:1;
  grid-row:1 / span 2;
  display:grid;
  gap:24px;
}

.tc-wc-checkout-page #customer_details .col-1,
.tc-wc-checkout-page #customer_details .col-2 {
  float:none!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
}

.tc-wc-checkout-page #order_review_heading {
  grid-column:2;
  grid-row:1;
  align-self:end;
  margin:0!important;
  padding:0 2px;
  font-size:clamp(23px,2vw,29px);
}

.tc-wc-checkout-page #order_review {
  grid-column:2;
  grid-row:2;
  padding:clamp(22px,2.5vw,30px);
  overflow:visible;
}

.tc-wc-checkout-page #order_review table.shop_table {
  width:100%;
  table-layout:auto;
  margin:0 0 22px;
}

.tc-wc-checkout-page #order_review table.shop_table th,
.tc-wc-checkout-page #order_review table.shop_table td {
  padding:14px 8px;
  vertical-align:top;
}

.tc-wc-checkout-page .woocommerce-billing-fields,
.tc-wc-checkout-page .woocommerce-shipping-fields,
.tc-wc-checkout-page .woocommerce-additional-fields {
  width:100%;
  min-width:0;
  padding:clamp(22px,2.5vw,30px);
}

.tc-wc-checkout-page .form-row-first,
.tc-wc-checkout-page .form-row-last {
  width:calc(50% - 8px)!important;
}

.tc-wc-checkout-page .form-row-wide {
  width:100%!important;
}

.tc-wc-checkout-page .woocommerce-checkout-payment {
  margin-top:10px;
  overflow:hidden;
}

.tc-wc-checkout-page #place_order {
  width:100%;
  min-height:56px;
  margin-top:12px;
  font-size:15px;
}

/* -----------------------------
   Cart / Checkout Blocks
------------------------------ */
.tc-wc-page-content .wc-block-cart,
.tc-wc-page-content .wc-block-checkout {
  width:100%;
  max-width:none;
}

.tc-wc-page-content .wc-block-components-sidebar-layout {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(360px,430px);
  gap:32px!important;
  align-items:start;
}

.tc-wc-page-content .wc-block-components-sidebar-layout .wc-block-components-main,
.tc-wc-page-content .wc-block-components-sidebar-layout .wc-block-components-sidebar {
  width:100%!important;
  max-width:none!important;
  min-width:0;
  margin:0!important;
}

.tc-wc-page-content .wc-block-components-sidebar-layout .wc-block-components-sidebar {
  position:sticky;
  top:170px;
}

/* -----------------------------
   Mini carrito
------------------------------ */
.tc-mini-cart-drawer {
  max-width:100%;
}

.tc-mini-cart-content {
  display:flex;
  flex-direction:column;
  min-height:0;
}

.tc-mini-cart-content .woocommerce-mini-cart {
  flex:1 1 auto;
}

.tc-mini-cart-content .woocommerce-mini-cart__total,
.tc-mini-cart-content .woocommerce-mini-cart__buttons {
  flex:0 0 auto;
}

.tc-mini-cart-content .buttons .button {
  min-height:48px;
  display:flex!important;
  align-items:center;
  justify-content:center;
}

/* -----------------------------
   Responsive
------------------------------ */
@media (max-width:1100px) {
  body.tc-wc-single-product div.product {
    grid-template-columns:minmax(0,1fr) minmax(340px,.9fr);
    column-gap:32px;
  }

  .tc-wc-cart-page .tc-wc-page-content > .woocommerce,
  .tc-wc-checkout-page form.checkout,
  .tc-wc-page-content .wc-block-components-sidebar-layout {
    grid-template-columns:minmax(0,1fr) minmax(330px,380px);
    gap:26px;
  }
}

@media (max-width:900px) {
  body.tc-wc-single-product div.product {
    grid-template-columns:1fr;
    row-gap:34px;
  }

  body.tc-wc-single-product div.product div.images,
  body.tc-wc-single-product div.product div.summary,
  body.tc-wc-single-product div.product .woocommerce-tabs,
  body.tc-wc-single-product div.product .related,
  body.tc-wc-single-product div.product .upsells {
    grid-column:1;
  }

  body.tc-wc-single-product div.product div.summary {
    padding-top:0;
  }

  body.tc-wc-single-product .woocommerce-product-gallery__image a {
    min-height:0;
  }

  .tc-wc-cart-page .tc-wc-page-content > .woocommerce,
  .tc-wc-checkout-page form.checkout,
  .tc-wc-page-content .wc-block-components-sidebar-layout {
    grid-template-columns:1fr!important;
  }

  .tc-wc-cart-page .woocommerce-cart-form,
  .tc-wc-cart-page .cart-collaterals,
  .tc-wc-checkout-page #customer_details,
  .tc-wc-checkout-page #order_review_heading,
  .tc-wc-checkout-page #order_review {
    grid-column:1!important;
    grid-row:auto!important;
  }

  .tc-wc-cart-page .cart_totals,
  .tc-wc-page-content .wc-block-components-sidebar-layout .wc-block-components-sidebar,
  .tc-wc-checkout-page #order_review {
    position:static!important;
    top:auto!important;
  }
}

@media (max-width:767px) {
  body.tc-wc-single-product .tc-wc-global-container,
  .tc-wc-cart-page .tc-wc-page-container,
  .tc-wc-checkout-page .tc-wc-page-container,
  .tc-wc-order-received .tc-wc-page-container {
    width:calc(100% - 24px);
    padding-top:32px;
    padding-bottom:52px;
  }

  body.tc-wc-single-product div.product {
    width:100%;
    padding:0;
  }

  body.tc-wc-single-product div.product div.images {
    padding:14px;
  }

  body.tc-wc-single-product .woocommerce-product-attributes,
  body.tc-wc-single-product .woocommerce-product-attributes tbody,
  body.tc-wc-single-product .woocommerce-product-attributes tr,
  body.tc-wc-single-product .woocommerce-product-attributes th,
  body.tc-wc-single-product .woocommerce-product-attributes td {
    display:block;
    width:100%!important;
    min-width:0;
  }

  body.tc-wc-single-product .woocommerce-product-attributes th {
    padding-bottom:4px;
  }

  .tc-wc-cart-page .woocommerce-cart-form,
  .tc-wc-cart-page .cart_totals,
  .tc-wc-checkout-page .woocommerce-billing-fields,
  .tc-wc-checkout-page .woocommerce-shipping-fields,
  .tc-wc-checkout-page .woocommerce-additional-fields,
  .tc-wc-checkout-page #order_review,
  .tc-wc-page-content .wc-block-components-sidebar-layout .wc-block-components-main,
  .tc-wc-page-content .wc-block-components-sidebar-layout .wc-block-components-sidebar {
    padding:16px!important;
  }

  .tc-wc-cart-page table.shop_table_responsive tr {
    padding:16px 0;
  }

  .tc-wc-cart-page table.cart td.actions .coupon {
    display:grid;
    grid-template-columns:1fr;
    max-width:none;
  }

  .tc-wc-cart-page table.cart td.actions .coupon .input-text,
  .tc-wc-cart-page table.cart td.actions .coupon .button,
  .tc-wc-cart-page table.cart td.actions > .button {
    width:100%!important;
  }

  .tc-wc-checkout-page .form-row-first,
  .tc-wc-checkout-page .form-row-last {
    float:none!important;
    width:100%!important;
  }

  .tc-mini-cart-content .buttons {
    grid-template-columns:1fr;
  }
}
