/* Ferretería Juan Pablo — WooCommerce overrides (CSS-first over Storefront) */

.fjp-theme .woocommerce-products-header__title,
.fjp-theme .woocommerce .products .woocommerce-loop-product__title,
.fjp-theme h1, .fjp-theme h2, .fjp-theme h3 {
  font-family: var(--font-display), "Outfit", system-ui, sans-serif;
}

/* Hide Storefront leftover chrome if parent CSS still paints */
.fjp-theme .storefront-primary-navigation,
.fjp-theme .site-header .site-branding,
.fjp-theme .site-search,
.fjp-theme .site-header-cart,
.fjp-theme .col-full > .site-search {
  /* kept for safety if mixed templates */
}

/* Shop / archive product grid */
.fjp-theme ul.products {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
}
@media (min-width: 700px) {
  .fjp-theme ul.products { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1000px) {
  .fjp-theme ul.products.columns-4 { grid-template-columns: repeat(4, 1fr); }
}

.fjp-theme ul.products::before,
.fjp-theme ul.products::after { display: none !important; content: none !important; }

.fjp-theme ul.products li.product {
  width: 100% !important;
  margin: 0 !important;
  float: none !important;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
  display: flex;
  flex-direction: column;
  padding: 0 !important;
}
.fjp-theme ul.products li.product:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.fjp-theme ul.products li.product a img {
  margin: 0 !important;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-bottom: 1px solid var(--line-soft);
}

.fjp-theme ul.products li.product .woocommerce-loop-product__title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 0.85rem 1rem 0.25rem;
  color: var(--charcoal);
}

.fjp-theme ul.products li.product .price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--green);
  padding: 0 1rem 0.75rem;
  margin: 0;
}
.fjp-theme ul.products li.product .price del {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
  opacity: 0.85;
}

/* Buttons — map Woo to FJP system */
.fjp-theme .button,
.fjp-theme button.button,
.fjp-theme input.button,
.fjp-theme a.button,
.fjp-theme .woocommerce a.button,
.fjp-theme .woocommerce button.button,
.fjp-theme .woocommerce input.button,
.fjp-theme .woocommerce #respond input#submit,
.fjp-theme .woocommerce a.added_to_cart {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-sizing: border-box;
  min-height: 44px;
  padding: 0.7rem 1.35rem !important;
  font-family: var(--font) !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  line-height: 1.2;
  border-radius: 999px !important;
  border: 1.5px solid transparent !important;
  letter-spacing: -0.01em;
  text-decoration: none !important;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.fjp-theme .woocommerce a.button,
.fjp-theme .woocommerce button.button,
.fjp-theme .woocommerce input.button,
.fjp-theme .woocommerce #respond input#submit,
.fjp-theme .woocommerce a.button.alt,
.fjp-theme .woocommerce button.button.alt,
.fjp-theme .woocommerce input.button.alt,
.fjp-theme .single_add_to_cart_button {
  background: var(--green) !important;
  border-color: var(--green) !important;
  color: #fff !important;
}
.fjp-theme .woocommerce a.button:hover,
.fjp-theme .woocommerce button.button:hover,
.fjp-theme .woocommerce input.button:hover,
.fjp-theme .woocommerce a.button.alt:hover,
.fjp-theme .woocommerce button.button.alt:hover,
.fjp-theme .single_add_to_cart_button:hover {
  background: var(--green-hover) !important;
  border-color: var(--green-hover) !important;
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(11, 110, 79, 0.28);
}

.fjp-theme ul.products li.product .button {
  margin: auto 1rem 1rem !important;
  width: calc(100% - 2rem);
}

/* Sale badge */
.fjp-theme span.onsale {
  background: var(--lime) !important;
  color: var(--charcoal) !important;
  font-weight: 700 !important;
  border-radius: 999px !important;
  min-height: auto !important;
  line-height: 1.2 !important;
  padding: 0.35rem 0.65rem !important;
}

/* Single product */
.fjp-theme .product .summary .price {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.03em;
}

.fjp-theme .woocommerce-tabs ul.tabs {
  padding: 0 !important;
  margin: 0 0 1rem !important;
  border-bottom: 1px solid var(--line);
}
.fjp-theme .woocommerce-tabs ul.tabs li {
  border: none !important;
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
}
.fjp-theme .woocommerce-tabs ul.tabs li a {
  font-weight: 600;
  color: var(--muted);
  padding: 0.75rem 1rem !important;
  border-radius: 8px 8px 0 0;
}
.fjp-theme .woocommerce-tabs ul.tabs li.active a {
  color: var(--green);
  box-shadow: inset 0 -2px 0 var(--green);
}

/* Cart / checkout */
.fjp-theme .woocommerce-cart-form,
.fjp-theme .cart-collaterals .cart_totals,
.fjp-theme .woocommerce-checkout #customer_details,
.fjp-theme .woocommerce-checkout-review-order {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.fjp-theme .checkout-button,
.fjp-theme .wc-proceed-to-checkout a.checkout-button {
  background: var(--green) !important;
  border-color: var(--green) !important;
  width: 100%;
}

/* Quantity */
.fjp-theme .quantity .qty {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 0.4rem 0.6rem;
}

/* Messages */
.fjp-theme .woocommerce-message,
.fjp-theme .woocommerce-info {
  border-top-color: var(--green);
  background: var(--green-soft);
}
.fjp-theme .woocommerce-error {
  border-top-color: var(--danger);
}

/* Breadcrumb */
.fjp-theme .woocommerce-breadcrumb {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.fjp-theme .woocommerce-breadcrumb a { color: var(--green); }

/* Container alignment with mockup */
.fjp-theme .col-full,
.fjp-theme .woocommerce-page .col-full {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Soften Storefront defaults */
.fjp-theme .site-content,
.fjp-theme .content-area {
  background: transparent;
  margin: 0;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}

.fjp-theme.home .content-area {
  padding: 0;
}

/* FJP WA quote button next to add-to-cart (injected via JS optional) */
.fjp-buy-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.75rem;
}
.fjp-buy-box .btn-wa-outline {
  min-height: 44px;
}

/* —— Pedido por WhatsApp / Generar orden —— */
.fjp-theme.fjp-wa-orders .woocommerce-checkout #place_order,
.fjp-theme .woocommerce #payment #place_order {
  background: var(--green, #0B6E4F) !important;
  border-color: var(--green, #0B6E4F) !important;
  color: #fff !important;
  min-height: 48px;
  border-radius: 999px !important;
  font-weight: 700;
}

.fjp-theme .fjp-order-wa__cta:hover {
  filter: brightness(0.95);
}

.fjp-theme .woocommerce-order-overview {
  margin-top: 0.5rem;
}

.fjp-theme ul.payment_methods li.payment_method_fjp_whatsapp label {
  font-weight: 700;
}
