/*
Theme Name: Tupya Gift Child
Template: tupya-gift
Version: 1.0.1
Text Domain: tupya-gift-child
*/

/* Filter-free catalog: product content + retained cart panel. */
.post-type-archive-product .shop-layout,
.tax-product_cat .shop-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 280px !important;
  gap: 24px !important;
  align-items: start !important;
}

.tax-product_cat .shop-main-content,
.post-type-archive-product .shop-main-content {
  min-width: 0 !important;
}

@media (max-width: 1024px) {
  .post-type-archive-product .shop-layout,
  .tax-product_cat .shop-layout {
    grid-template-columns: 1fr !important;
  }
  .shop-aside {
    display: none !important;
  }
}

/* Homepage-aligned shop: loaded after parent commerce polish. */
body.post-type-archive-product .woocommerce-shop-main .container.shop-shell,
body.tax-product_cat .woocommerce-shop-main .container.shop-shell {
  width: min(1240px, calc(100% - 32px)) !important;
  max-width: none !important;
  margin-inline: auto !important;
  padding-inline: 0 !important;
}
body.post-type-archive-product .woocommerce-shop-main .shop-layout,
body.tax-product_cat .woocommerce-shop-main .shop-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 280px !important;
  gap: 24px !important;
  align-items: start !important;
}
body.post-type-archive-product .woocommerce-shop-main .shop-aside,
body.tax-product_cat .woocommerce-shop-main .shop-aside {
  display: flex !important;
  width: auto !important;
}
body.post-type-archive-product .woocommerce-shop-main ul.products,
body.tax-product_cat .woocommerce-shop-main ul.products {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
body.post-type-archive-product .woocommerce-shop-main ul.products li.tupya-product-card,
body.tax-product_cat .woocommerce-shop-main ul.products li.tupya-product-card {
  border: 0 !important;
  border-radius: 7px !important;
  box-shadow: none !important;
}
body.post-type-archive-product .woocommerce-shop-main .product-card-inner,
body.tax-product_cat .woocommerce-shop-main .product-card-inner {
  border: 0 !important;
  border-radius: 7px !important;
  box-shadow: none !important;
}
@media (max-width: 1024px) {
  body.post-type-archive-product .woocommerce-shop-main .shop-layout,
  body.tax-product_cat .woocommerce-shop-main .shop-layout { grid-template-columns: 1fr !important; }
  body.post-type-archive-product .woocommerce-shop-main .shop-aside,
  body.tax-product_cat .woocommerce-shop-main .shop-aside { display: none !important; }
}
@media (max-width: 560px) {
  body.post-type-archive-product .woocommerce-shop-main .container.shop-shell,
  body.tax-product_cat .woocommerce-shop-main .container.shop-shell { width: min(100% - 20px, 1240px) !important; }
  body.post-type-archive-product .woocommerce-shop-main ul.products,
  body.tax-product_cat .woocommerce-shop-main ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Mobile containment: final layer over accumulated parent-theme commerce rules. */
@media (max-width: 767px) {
  html, body { max-width: 100%; overflow-x: clip; }
  .site-header, #site-header { height: auto !important; min-height: 0 !important; }
  .site-header .container, .page-main > .container, .archive-main > .container, .single-main > .container, .cart-main > .container, .checkout-main > .container, .my-account-main > .container { width: 100% !important; max-width: none !important; min-width: 0 !important; box-sizing: border-box !important; padding-left: 12px !important; padding-right: 12px !important; }
  .single-product-inner, .cart-layout, .checkout-layout, .tupya-myaccount-layout, .tg-checkout-grid, .tg-delivery-grid, .tupya-ref-cart-layout { grid-template-columns: minmax(0,1fr) !important; width: 100% !important; max-width: none !important; min-width: 0 !important; }
  .single-product-gallery, .tg-order-card, .tg-delivery-summary, .tupya-ref-cart-right { position: static !important; width: 100% !important; max-width: none !important; min-width: 0 !important; }
  .woocommerce-product-gallery, .summary.entry-summary, .woocommerce-tabs, .woocommerce-cart-form, .cart-collaterals, .woocommerce-checkout-review-order, .woocommerce-account .woocommerce-MyAccount-content, .woocommerce-account .woocommerce-MyAccount-navigation { min-width: 0 !important; max-width: 100% !important; box-sizing: border-box !important; }
  .woocommerce table.shop_table, .woocommerce table.woocommerce-table--order-details { display: block !important; width: 100% !important; max-width: 100% !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .woocommerce-account .woocommerce-MyAccount-navigation ul { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  .header-quick-nav { display: none !important; }
  .header-search-launcher { order: 3; flex: 1 0 100% !important; min-width: 0 !important; max-width: none !important; margin: 8px 0 0 !important; }
  .site-header .container { flex-wrap: wrap !important; }
  .tg-delivery-row, body.woocommerce-checkout .tg-checkout-card .woocommerce-billing-fields__field-wrapper { grid-template-columns: minmax(0,1fr) !important; }
  .tg-delivery-item, .tupya-ref-cart-item { min-width: 0 !important; }
  .tg-delivery-item img { width:64px !important; height:64px !important; }
  .tg-delivery-item strong, .tupya-ref-item-title, .woocommerce-loop-product__title { overflow-wrap:anywhere !important; }
}

/* Fotoğraflı Kupalar archive: mobile-first containment and compact discovery. */
@media (max-width: 767px) {
  body.tax-product_cat.term-fotografli-kupalar .woocommerce-shop-main { margin-top: 0 !important; padding-top: 16px !important; }
  body.tax-product_cat.term-fotografli-kupalar .product-category-hero { margin-top: 58px !important; padding: 22px 18px !important; min-height: 0 !important; }
  body.tax-product_cat.term-fotografli-kupalar .category-hero-copy { min-width: 0 !important; }
  body.tax-product_cat.term-fotografli-kupalar .category-eyebrow { margin-bottom: 6px !important; }
  body.tax-product_cat.term-fotografli-kupalar .product-category-hero .page-title { font-size: 30px !important; }
  body.tax-product_cat.term-fotografli-kupalar .category-description-wrap { margin-top: 8px !important; font-size: 14px !important; line-height: 1.55 !important; text-align: left !important; }
  body.tax-product_cat.term-fotografli-kupalar .category-description-wrap p { margin: 0 !important; }
  body.tax-product_cat.term-fotografli-kupalar .category-description-wrap p + p { margin-top: 10px !important; }
  body.tax-product_cat.term-fotografli-kupalar .category-hero-badges { justify-content: flex-start !important; gap: 7px !important; margin-top: 14px !important; }
  body.tax-product_cat.term-fotografli-kupalar .category-hero-badges span { height: 32px !important; padding: 0 10px !important; font-size: 11px !important; }
  body.tax-product_cat.term-fotografli-kupalar .tg-market-chips { display: flex !important; flex-wrap: nowrap !important; gap: 8px !important; overflow-x: auto !important; overscroll-behavior-x: contain !important; padding: 10px 12px !important; margin: 12px -12px !important; scrollbar-width: none; }
  body.tax-product_cat.term-fotografli-kupalar .tg-market-chips::-webkit-scrollbar { display: none; }
  body.tax-product_cat.term-fotografli-kupalar .tg-market-chips a { flex: 0 0 auto !important; min-height: 38px !important; padding: 0 13px !important; white-space: nowrap !important; }
  body.tax-product_cat.term-fotografli-kupalar .shop-toolbar { display: grid !important; grid-template-columns: 1fr !important; gap: 10px !important; align-items: start !important; padding: 14px !important; margin: 14px 0 !important; }
  body.tax-product_cat.term-fotografli-kupalar .woocommerce-result-count { width: 100% !important; font-size: 13px !important; }
  body.tax-product_cat.term-fotografli-kupalar .woocommerce-ordering, body.tax-product_cat.term-fotografli-kupalar .woocommerce-ordering select { width: 100% !important; margin: 0 !important; }
  body.tax-product_cat.term-fotografli-kupalar .woocommerce-ordering select { min-height: 44px !important; }
}

/* Product gallery feature ribbon: avoid uneven 3+1 mobile wrap. */
@media (max-width: 767px) {
  .single-product .tupya-cs-feature-ribbon { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; padding: 12px !important; }
  .single-product .tupya-cs-feature-ribbon > span { width: auto !important; min-width: 0 !important; margin: 0 !important; padding: 10px 8px !important; text-align: center !important; font-size: 12px !important; line-height: 1.25 !important; }
}

/* Static-page sidebar: native accessible mobile disclosure. */
.tupya-mobile-page-nav { display: none; }
.tupya-side-title { cursor: pointer; list-style: none; }
.tupya-side-title::-webkit-details-marker { display: none; }
@media (max-width: 767px) {
  .tupya-page-left { display: none !important; }
  .tupya-mobile-page-nav { display: block; position: relative; order: -1; }
  .tupya-mobile-page-nav > summary { display: flex; align-items: center; gap: 5px; min-height: 42px; padding: 0 8px; color: #302238; font-size: 14px; font-weight: 750; cursor: pointer; list-style: none; }
  .tupya-mobile-page-nav > summary::-webkit-details-marker { display: none; }
  .tupya-mobile-page-nav > nav { position: absolute; z-index: 1200; top: calc(100% + 7px); left: 0; width: min(300px, calc(100vw - 24px)); padding: 8px; border: 1px solid #e7dbef; border-radius: 14px; background: #fff; box-shadow: 0 16px 36px rgba(43,21,79,.18); }
  .tupya-mobile-page-nav > nav a { display: block; padding: 11px 12px; border-radius: 9px; color: #302238; font-size: 14px; font-weight: 650; text-decoration: none; }
  .tupya-mobile-page-nav > nav a:active, .tupya-mobile-page-nav > nav a:focus-visible { background: #f5effa; outline: none; }

  /* Cart personalization: full-width row beneath the product. */
  body.woocommerce-cart .tupya-ref-cart-item { grid-template-columns: 92px minmax(0,1fr) !important; }
  body.woocommerce-cart .tupya-ref-item-main { display: contents !important; }
  body.woocommerce-cart .tupya-ref-item-thumb { grid-column: 1 !important; grid-row: 1 / 3 !important; }
  body.woocommerce-cart .tupya-ref-item-name { grid-column: 2 !important; grid-row: 1 !important; min-width: 0 !important; }
  body.woocommerce-cart .tupya-ref-delivery { grid-column: 2 !important; grid-row: 2 !important; }
  body.woocommerce-cart .tupya-pers-box { grid-column: 1 / -1 !important; grid-row: 3 !important; width: 100% !important; box-sizing: border-box !important; margin: 4px 0 0 !important; padding: 11px 12px !important; border: 1px solid #e2e8f0 !important; border-radius: 10px !important; background: #f8fafc !important; }
  body.woocommerce-cart .tupya-pers-display { display: block !important; position: relative !important; padding-top: 27px !important; }
  body.woocommerce-cart .tupya-pers-edit-toggle { position: absolute !important; top: 0 !important; right: 0 !important; padding: 3px 0 !important; border: 0 !important; background: transparent !important; color: #6d28d9 !important; font-size: 12px !important; }
  body.woocommerce-cart .tupya-pers-list { gap: 4px !important; }
  body.woocommerce-cart .tupya-pers-list li { display: grid !important; grid-template-columns: max-content minmax(0, 1fr) !important; gap: 6px !important; align-items: start !important; }
  body.woocommerce-cart .tupya-pers-label { color: #777083 !important; font-size: 11px !important; font-weight: 600 !important; }
  body.woocommerce-cart .tupya-pers-val { min-width: 0 !important; color: #302238 !important; font-size: 12px !important; font-weight: 600 !important; word-break: normal !important; overflow-wrap: break-word !important; }
  body.woocommerce-cart .tupya-ref-qty-row { grid-column: 1 / -1 !important; grid-row: 4 !important; }
  body.woocommerce-cart .tupya-ref-item-side { grid-row: 5 !important; }

  .tupya-side-card > .tupya-side-title { min-height: 48px !important; margin: 0 !important; padding: 0 14px !important; display: flex !important; align-items: center !important; justify-content: space-between !important; }
  .tupya-side-card > .tupya-side-title::after { content: '+'; font-size: 23px; font-weight: 400; line-height: 1; }
  .tupya-side-card[open] > .tupya-side-title::after { content: '−'; }
  .tupya-side-card > .tupya-side-nav { padding: 0 12px 12px !important; }
}
