/*
Theme Name:   Vineta Child Theme
Description:  Write here a brief description about your child-theme
Author:       Themesflat
Author URL:   https://themesflat.co/fashion-vineta/
Template:     vineta
Version:      1.0.4
Tested up to: 5.8.1
Requires PHP: 5.6
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  vineta-child-theme
*/

/* ─── Product Card Images ─── */
/* 8:9 nearly-square portrait with cover — minimal crop, consistent cards. */
body .card-product .card-product-wrapper {
  aspect-ratio: 8 / 9 !important;
}

body .card-product .card-product-wrapper .product-img img {
  object-fit: cover !important;
  width: 100%;
  height: 100%;
}

/* ─── Subcategory Grid (replaces Swiper carousel) ─── */
.tfwc-subcat-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1199px) {
  .tfwc-subcat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .tfwc-subcat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* Category card images: contain for brand logos/product shots */
.tfwc-subcat-grid .image img {
  object-fit: contain;
}

/* ─── WooCommerce Heading Spacing ─── */
.woocommerce-product-content h1,
.woocommerce-product-content h2,
.woocommerce-product-content h3,
.woocommerce-product-content h4,
.woocommerce-product-content h5,
.woocommerce-product-content h6,
.woocommerce-Tabs-panel h1,
.woocommerce-Tabs-panel h2,
.woocommerce-Tabs-panel h3,
.woocommerce-Tabs-panel h4,
.woocommerce-Tabs-panel h5,
.woocommerce-Tabs-panel h6,
.tf-product-des-shortdescription h1,
.tf-product-des-shortdescription h2,
.tf-product-des-shortdescription h3,
.tf-product-des-shortdescription h4,
.tf-product-des-shortdescription h5,
.tf-product-des-shortdescription h6 {
  margin-top: clamp(0.75em, 1vw + 0.5em, 1.25em);
  margin-bottom: clamp(0.15em, 0.5vw + 0.1em, 0.35em);
}

/* ─── WooCommerce Shipping Spacing ─── */
.woocommerce-shipping-methods li {
  margin-top: 20px;
}

.woocommerce-shipping-methods li label > small {
  font-size: .85em;
}

/* ─── WooCommerce Form Validation ─── */
.validate-required.woocommerce-invalid label,
.validate-required.woocommerce-invalid input,
.validate-required.woocommerce-invalid select {
  color: #d63638 !important;
  border-color: #d63638 !important;
}

.woocommerce-privacy-policy-text {
  margin-bottom: 2rem;
}

/* Fix for Always Visible Add to Cart Button */
.card-product .trotibike-btn-always-visible {
    position: relative !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    margin-top: 15px !important;
    z-index: 10;
}
.card-product .trotibike-btn-always-visible a.button {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    display: flex !important;
    width: 100% !important;
    margin: 0 !important;
    background-color: #000 !important;
    color: #fff !important;
}
.card-product .trotibike-btn-always-visible a.button:hover {
    background-color: #333 !important;
}

/* Minimal checkout Select2 sizing fix for Cargus fields */
.woocommerce-checkout .select2-container {
  width: 100% !important;
}

.woocommerce-checkout .select2-container--default .select2-selection--single {
  min-height: 58px;
}

.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 1.2;
  padding-top: 25px;
  padding-left: 20px;
  padding-right: 38px;
}

.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 58px;
  right: 10px;
}

/* Hide duplicate WooCommerce address line 1; Cargus street + number fields fill it for order data. */
.woocommerce-checkout #billing_address_1_field,
.woocommerce-checkout #shipping_address_1_field,
.woocommerce-checkout fieldset.tf-field:has(#billing_address_1),
.woocommerce-checkout fieldset.tf-field:has(#shipping_address_1) {
  display: none !important;
}

.woocommerce-checkout .tf-select .trotibike-checkout-select-label {
  position: absolute;
  top: 13px;
  left: 20px;
  z-index: 2;
  pointer-events: none;
  color: #8b93a7;
  font-size: 13px;
  line-height: 1.2;
}

.woocommerce-checkout .tf-select:has(#billing_state),
.woocommerce-checkout .tf-select:has(#shipping_state) {
  position: relative;
}

.woocommerce-checkout .tf-select #billing_state,
.woocommerce-checkout .tf-select #shipping_state {
  height: 58px;
  padding-top: 24px !important;
  padding-left: 20px !important;
  padding-bottom: 7px !important;
  line-height: 1.2 !important;
}

.woocommerce-checkout .trotibike-checkout-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: help;
}

.woocommerce-checkout .trotibike-checkout-help::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  display: none;
  width: min(280px, 70vw);
  padding: 8px 10px;
  border-radius: 4px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}

.woocommerce-checkout .trotibike-checkout-help:hover::after,
.woocommerce-checkout .trotibike-checkout-help:focus::after {
  display: block;
}

.woocommerce-checkout .trotibike-cargus-extra-services input:disabled + span {
  color: #9ca3af;
}

.woocommerce-checkout .trotibike-checkout-unavailable {
  display: block;
  margin-left: 22px;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
}

/* Product cards for compatible parts and recommended accessories. */
.trotibike-compatible-products .tf-grid-layout,
.trotibike-accessories-section .tf-grid-layout {
  align-items: stretch;
}

.trotibike-product-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: #fff;
}

.trotibike-product-card__image {
  display: block;
  flex: 0 0 auto;
  aspect-ratio: 1 / 1;
  background: #f7f7f7;
}

.trotibike-product-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trotibike-product-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 215px;
  padding: 16px;
}

.trotibike-product-card__brand {
  color: #767676;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trotibike-product-card__title {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.trotibike-product-card__title a {
  color: inherit;
  text-decoration: none;
}

.trotibike-product-card__title a:hover {
  text-decoration: underline;
}

.trotibike-product-card__price {
  margin-top: auto;
  font-weight: 700;
}

.trotibike-product-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
}

.trotibike-view-all,
.trotibike-loadmore-wrap {
  margin-top: 24px;
  text-align: center;
}

.trotibike-loadmore-btn {
  min-width: 200px;
}
