/*
 * TV Ekipman Modern UI 5.0 — site-wide mobile/tablet responsiveness.
 * Loaded AFTER the approved v4 look. No changes >= 992px.
 * The page itself must fit the viewport; truly wide tables scroll INSIDE their region.
 * Does not block user pinch zoom or replace the original typography.
 */
@media screen and (max-width: 991.98px) {
  body.tvemui-v4 { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body.tvemui-v4, body.tvemui-v4 *, body.tvemui-v4 *::before, body.tvemui-v4 *::after { box-sizing: border-box; }

  /* Fluid layout: columns, content wrappers and page builders must be allowed to shrink. */
  body.tvemui-v4 :is(#page, .site, .site-content, #content, #primary, #secondary,
      .content-area, .site-main, .woocommerce, .woocommerce-page,
      .entry-content, .page-content, .elementor, .elementor-section-wrap,
      .elementor-container, .elementor-column, .elementor-widget-wrap,
      .wp-block-group, .wp-block-columns, .wp-block-column) {
    min-width: 0; max-width: 100%;
  }
  body.tvemui-v4 .site-content :is(.container, .container-fluid, .woocommerce,
      .page-content, .entry-content, .tab-content, .electro-description) {
    min-width: 0; max-width: 100%;
  }
  body.tvemui-v4 .site-content .row { min-width: 0; }
  body.tvemui-v4 :is(.content-area, .site-main, .woocommerce, .entry-content,
      .wp-block-column, .elementor-widget-container) > * { min-width: 0; }
  body.tvemui-v4 .site-content :is(img, svg, video, canvas, picture, object, embed) {
    max-width: 100% !important;
  }
  body.tvemui-v4 .site-content :is(img, video) { height: auto; }
  body.tvemui-v4 .site-content :is(iframe, embed) { max-width: 100% !important; }
  body.tvemui-v4 .site-content :is(.wp-block-image, .wp-caption, figure, .gallery,
      .wp-block-gallery, .wp-block-cover, .alignwide, .alignfull) {
    max-width: 100%; min-width: 0; height: auto; margin-left: auto; margin-right: auto;
  }
  body.tvemui-v4 :is(.entry-content, .page-content, .tab-content,
      .woocommerce-product-details__short-description) :is(img, iframe, video, figure) {
    max-width: 100% !important;
  }
  body.tvemui-v4 :is(.entry-content, .page-content, .tab-content,
      .woocommerce-product-details__short-description) [style*="min-width"] {
    min-width: 0 !important;
  }
  body.tvemui-v4 :is(.entry-content, .page-content, .tab-content,
      .woocommerce-product-details__short-description) [style*="width:"] {
    max-width: 100% !important;
  }

  /* Inline content: protect long links, technical identifiers and formatted code. */
  body.tvemui-v4 :is(.entry-content, .page-content, .tab-content,
      .woocommerce-product-details__short-description, .product_title,
      .woocommerce-MyAccount-content) {
    overflow-wrap: anywhere; word-break: normal;
  }
  body.tvemui-v4 :is(.entry-content, .page-content, .tab-content,
      .woocommerce-product-details__short-description) :is(pre, code, kbd, samp) {
    max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere;
  }
  body.tvemui-v4 :is(.entry-content, .page-content, .tab-content) :is(h1,h2,h3,h4,h5,h6) {
    line-height: 1.34; overflow-wrap: anywhere;
  }
  body.tvemui-v4 .site-content :is(.wp-block-embed__wrapper, .video-container,
      .video-wrapper, .fluid-width-video-wrapper, .embed-responsive) {
    position: relative; width: 100%; max-width: 100%; min-width: 0;
  }
  body.tvemui-v4 .site-content :is(.wp-block-embed, .embed-responsive) iframe {
    display: block; width: 100% !important; height: auto !important;
    max-width: 100% !important; aspect-ratio: 16 / 9;
  }
  body.tvemui-v4 .site-content iframe[src*="youtube"],
  body.tvemui-v4 .site-content iframe[src*="vimeo"],
  body.tvemui-v4 .site-content iframe[src*="youtu.be"] {
    display: block; width: 100% !important; max-width: 100% !important;
    aspect-ratio: 16 / 9; height: auto !important;
  }

  /* Single product: theme variations can add extra wrappers beyond the three from v4. */
  body.tvemui-v4.single-product :is(.product, .product-type-simple,
      .product-type-variable, .single-product-wrapper, .product-images-wrapper,
      .woocommerce-product-gallery, .electro-wc-product-gallery,
      .summary, .entry-summary, .product-actions-wrapper, .product-actions,
      .electro-tabs, .electro-tab, .electro-tab .container,
      .electro-tab .tab-content) {
    min-width: 0 !important; max-width: 100% !important;
  }
  body.tvemui-v4.single-product .single-product-wrapper.row {
    display: flex !important; flex-direction: column !important;
    align-items: stretch !important; width: 100% !important;
    margin-inline: 0 !important; padding-inline: 0 !important;
  }
  body.tvemui-v4.single-product .single-product-wrapper.row > * {
    float: none !important; flex: 0 0 100% !important;
    width: 100% !important; max-width: 100% !important; min-width: 0 !important;
    margin-inline: 0 !important;
  }
  body.tvemui-v4.single-product :is(.product-images-wrapper, .summary, .entry-summary,
      .product-actions-wrapper) { padding-inline: 0 !important; }
  body.tvemui-v4.single-product :is(.product-images-wrapper, .woocommerce-product-gallery,
      .electro-wc-product-gallery, .flex-viewport) {
    width: 100%; max-width: 100%; min-width: 0;
  }
  body.tvemui-v4.single-product :is(.woocommerce-product-gallery, .electro-wc-product-gallery) img {
    display: block; width: auto !important; max-width: 100% !important;
    height: auto !important; max-height: min(75vw, 420px); object-fit: contain;
    margin-left: auto; margin-right: auto;
  }
  body.tvemui-v4.single-product :is(.flex-control-thumbs, .flex-control-nav,
      .electro-wc-product-gallery__thumbs) { max-width: 100%; min-width: 0; }
  body.tvemui-v4.single-product .product_title {
    font-size: clamp(21px, 5.2vw, 27px); line-height: 1.38; max-width: 100%;
    overflow-wrap: anywhere; margin-bottom: 14px;
  }
  body.tvemui-v4.single-product :is(.summary, .entry-summary, .product-actions) .price {
    max-width: 100%; font-size: clamp(20px, 5.5vw, 28px);
    line-height: 1.45; overflow-wrap: break-word;
  }
  body.tvemui-v4.single-product .woocommerce-product-details__short-description {
    width: 100%; max-width: 100%; font-size: 15.5px;
    line-height: 1.76; color: #405264;
  }
  body.tvemui-v4.single-product .woocommerce-product-details__short-description p { margin-bottom: 13px; }
  body.tvemui-v4.single-product :is(.electro-tabs, .electro-tabs-wrapper, .wc-tabs-wrapper) {
    position: relative !important; left: auto !important; right: auto !important;
    margin-left: 0 !important; margin-right: 0 !important;
    width: 100% !important; max-width: 100% !important;
    padding: 0 !important; background: transparent;
  }
  body.tvemui-v4.single-product .electro-tab > .container,
  body.tvemui-v4.single-product .electro-tab > .container > .tab-content {
    width: 100% !important; min-width: 0 !important; max-width: 100% !important;
    margin: 0 !important;
  }
  body.tvemui-v4.single-product .electro-tab > .container { padding: 0 !important; }
  body.tvemui-v4.single-product .electro-tab .tab-content {
    overflow: visible !important; padding: clamp(12px, 3.2vw, 18px) !important;
    font-size: 15px; line-height: 1.75;
  }
  body.tvemui-v4.single-product .electro-tab .tab-content :is(h1,h2,h3,h4) {
    max-width: 100%; margin: 1.1em 0 .65em;
    font-size: clamp(18px,4.6vw,23px); line-height: 1.3;
  }
  body.tvemui-v4.single-product #tab-description :is(p,li,dd,dt),
  body.tvemui-v4.single-product #tab-description .tab-content {
    color: #33465a; font-size: 15px; line-height: 1.75;
  }
  body.tvemui-v4.single-product #tab-description p { margin-bottom: 1.05em; }
  body.tvemui-v4.single-product .electro-tab .tab-content :is(ul,ol) {
    padding-inline-start: 22px; margin-inline: 0;
  }
  /* Electro shifts promotional description images up to 100px sideways. */
  body.tvemui-v4.single-product #tab-description .electro-description .layout {
    width: 100% !important; max-width: 100%; min-width: 0; margin-bottom: 20px !important;
  }
  body.tvemui-v4.single-product #tab-description .electro-description .layout img {
    position: static !important; left: auto !important; right: auto !important;
    transform: none !important; width: auto !important; max-width: 100% !important;
  }
  /* Theme tab menus should scroll on their OWN axis, not widen the document. */
  body.tvemui-v4.single-product .electro-tab .ec-tabs {
    display: flex; flex-wrap: nowrap; gap: 6px;
    overflow-x: auto; overflow-y: hidden; max-width: 100%; min-width: 0;
    margin: 0 0 14px; padding: 4px 0 10px;
    -webkit-overflow-scrolling: touch;
  }
  body.tvemui-v4.single-product .electro-tab .ec-tabs > li { flex: 0 0 auto; white-space: nowrap; }
  body.tvemui-v4.single-product .electro-tab .ec-tabs > li > a {
    display: block; font-size: 14px; padding: 10px 13px; white-space: nowrap;
  }
  /* Wide product data is scrollable INSIDE the tab. No clipping of description. */
  body.tvemui-v4 .tvemui-table-scroller {
    display: block; width: 100%; max-width: 100%; min-width: 0;
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 7px; margin: 12px 0 18px;
  }
  body.tvemui-v4 .tvemui-table-scroller > table {
    border-collapse: collapse; width: max-content; min-width: 100%; max-width: none;
    margin: 0; table-layout: auto;
  }
  body.tvemui-v4 .tvemui-table-scroller > table :is(td, th) {
    white-space: normal; overflow-wrap: break-word; min-width: 90px;
  }
  body.tvemui-v4.single-product table.shop_attributes {
    width: 100%; max-width: 100%; min-width: 0;
  }

  /* Buttons, inputs and choice controls: no iOS focus zoom and no off-screen form edges. */
  body.tvemui-v4 :is(.woocommerce, .entry-content, .site-content) :is(
      input[type="text"], input[type="email"], input[type="search"], input[type="tel"],
      input[type="url"], input[type="password"], input[type="number"], input[type="date"],
      textarea, select) {
    max-width: 100%; min-width: 0; font-size: 16px;
  }
  body.tvemui-v4 .woocommerce :is(.form-row, .form-row-wide, .form-row-first,
      .form-row-last, .woocommerce-input-wrapper, .select2-container,
      .select2-selection, .woocommerce-form-row) {
    max-width: 100%; min-width: 0;
  }
  body.tvemui-v4 .woocommerce .select2-container { width: 100% !important; }
  body.tvemui-v4 :is(.woocommerce, .entry-content) :is(.button, button, input[type="submit"]) {
    max-width: 100%; white-space: normal; overflow-wrap: break-word;
  }
  body.tvemui-v4 .woocommerce-error, body.tvemui-v4 .woocommerce-info,
  body.tvemui-v4 .woocommerce-message {
    max-width: 100%; min-width: 0; overflow-wrap: anywhere;
  }
  body.tvemui-v4 .woocommerce-message :is(.button, a) { max-width: 100%; }

  /* Checkout including PayTR and WooCommerce payment blocks. Preserve their JS and markup. */
  body.tvemui-v4.woocommerce-checkout :is(.woocommerce-checkout, #customer_details,
      #order_review, #order_review_heading, .woocommerce-checkout-review-order,
      .woocommerce-billing-fields, .woocommerce-shipping-fields,
      .woocommerce-additional-fields, .wc_payment_methods, .payment_box) {
    min-width: 0; max-width: 100%; width: 100%;
  }
  body.tvemui-v4.woocommerce-checkout :is(.col2-set, .woocommerce-columns,
      .woocommerce-checkout-payment, #payment) {
    min-width: 0 !important; max-width: 100% !important;
  }
  body.tvemui-v4.woocommerce-checkout .col2-set { width: 100% !important; }
  body.tvemui-v4.woocommerce-checkout .col2-set > :is(.col-1,.col-2) {
    min-width: 0 !important; max-width: 100% !important;
  }
  body.tvemui-v4.woocommerce-checkout #payment :is(li, label, .payment_box) {
    max-width: 100%; min-width: 0; overflow-wrap: anywhere;
  }
  body.tvemui-v4 :is(.woocommerce-cart-form, .cart-collaterals,
      .woocommerce-checkout-review-order, .woocommerce-MyAccount-content,
      .woocommerce-MyAccount-navigation) { min-width: 0; max-width: 100%; }
  body.tvemui-v4 .woocommerce-cart-form,
  body.tvemui-v4 .woocommerce-checkout-review-order-table-wrap,
  body.tvemui-v4 .woocommerce-MyAccount-content {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  body.tvemui-v4.woocommerce-cart .cart-collaterals {
    display: block !important; clear: both !important; float: none !important;
    width: 100% !important; max-width: 100% !important; min-width: 0 !important;
    margin-left: 0 !important; margin-right: 0 !important;
  }
  body.tvemui-v4 .cart-collaterals :is(.cart_totals, .cross-sells) {
    float: none !important; width: 100% !important;
    max-width: 100% !important; min-width: 0 !important;
    margin-left: 0 !important; margin-right: 0 !important;
  }
  body.tvemui-v4 .woocommerce-MyAccount-navigation ul { padding-left: 0; }
  body.tvemui-v4 .woocommerce-MyAccount-navigation li a { display: block; min-height: 40px; }
  body.tvemui-v4 .woocommerce-checkout #payment .payment_box iframe {
    max-width: 100% !important;
  }

  /* Banner, language dropdown, sliders, trust badges and page widgets. */
  body.tvemui-v4 :is(.electro-navbar, .header-v1, .mobile-header-v1,
      .mobile-header-v2, .handheld-header, .handheld-header-v2,
      .top-bar, .site-footer, .widget-area, .footer-widgets,
      .homepage-section, .home-v1-slider, .home-v2-slider,
      .rev_slider_wrapper, .slider, .slick-list, .owl-stage-outer) {
    max-width: 100%; min-width: 0;
  }
  body.tvemui-v4 .site-content :is(.banner, .banners, .banner-ad, .banner-content,
      .banner-image, .widget, .widget-content, .section-title) {
    max-width: 100%; min-width: 0;
  }
  body.tvemui-v4 .site-content :is(.owl-carousel, .slick-slider) { max-width: 100%; min-width: 0; }
  body.tvemui-v4 .site-content .owl-stage-outer { overflow: hidden; }
  body.tvemui-v4 .site-content :is(.wc-block-grid, .wc-block-grid__products,
      .wc-block-components-product-list, .wp-block-woocommerce-product-collection) {
    min-width: 0; max-width: 100%;
  }
  body.tvemui-v4 :is(.site-content, .site-footer) :is(a, button) { overflow-wrap: break-word; }
}

@media screen and (max-width: 767.98px) {
  /* Bootstrap desktop columns and two-column blocks must stack, including tablet-sized phones. */
  body.tvemui-v4 :is(.woocommerce .col2-set, .woocommerce-columns,
      .site-content .wp-block-columns, .site-content .elementor-container) {
    display: flex; flex-direction: column; max-width: 100%; min-width: 0;
  }
  body.tvemui-v4 :is(.woocommerce .col2-set > *, .woocommerce-columns > *,
      .wp-block-columns > .wp-block-column, .elementor-container > .elementor-column) {
    width: 100% !important; flex: 0 0 100% !important;
    max-width: 100% !important; min-width: 0 !important;
    margin-left: 0 !important; margin-right: 0 !important;
  }
  body.tvemui-v4 .site-content :is(#primary, #secondary,
      .content-area, .widget-area.sidebar) {
    float: none; width: 100%; max-width: 100%; min-width: 0;
  }
  body.tvemui-v4.single-product #tab-description .electro-description .layout {
    display: block; width: 100% !important;
  }
  body.tvemui-v4.single-product #tab-description .electro-description .layout :is(tbody,tr,td,th) {
    display: block; width: 100% !important; max-width: 100% !important;
    padding: 5px 0; margin: 0; border: 0;
  }
  body.tvemui-v4.single-product #tab-description .electro-description .layout td img {
    max-width: 100% !important; height: auto !important;
  }
  body.tvemui-v4.single-product .woocommerce-tabs #tab-description { padding: 0; }
  body.tvemui-v4 :is(.woocommerce-checkout .form-row-first,
      .woocommerce-checkout .form-row-last, .woocommerce-account .form-row-first,
      .woocommerce-account .form-row-last) { width: 100%; float: none; }
  body.tvemui-v4 .woocommerce :is(.coupon input, .coupon button) { max-width: 100%; }
  body.tvemui-v4 .woocommerce #coupon_code { min-width: 0; width: 100%; }
  body.tvemui-v4 .woocommerce-cart .coupon { width: 100%; max-width: 100%; }
}

@media screen and (max-width: 639.98px) {
  body.tvemui-v4.single-product .woocommerce-product-gallery { padding: 8px !important; }
  body.tvemui-v4.single-product .single-product-wrapper.row { gap: 12px; }
  body.tvemui-v4.single-product .woocommerce-product-details__short-description,
  body.tvemui-v4.single-product .electro-tab .tab-content { font-size: 15px; }
  body.tvemui-v4.single-product .electro-tab .tab-content :is(p,li) { font-size: 15px; }
  body.tvemui-v4.single-product :is(.price, .woocommerce-Price-amount) {
    overflow-wrap: normal; word-break: normal;
  }
  body.tvemui-v4.single-product .product-actions :is(.button, button),
  body.tvemui-v4.single-product form.cart .single_add_to_cart_button {
    min-height: 46px;
  }
  body.tvemui-v4.single-product table.shop_attributes :is(th,td) {
    padding: 8px 10px; width: auto;
  }
  body.tvemui-v4 .tvemui-footer-links { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
