/**
 * Irish Drone responsive layout fixes.
 * Scope: Loobek child theme + WooCommerce/Elementor layout behavior only.
 * This does not remove content, metadata, schema, product descriptions, or WooCommerce hooks.
 */

:root {
  --id-mobile-header-height: 58px;
  --id-page-gutter: clamp(16px, 4vw, 30px);
  --id-card-gap: 14px;
}

html {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  max-width: 100%;
  overflow-x: hidden;
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
picture,
video,
canvas,
svg,
iframe,
table {
  max-width: 100%;
}

img,
picture,
video,
canvas,
svg {
  height: auto;
}

iframe {
  display: block;
}

.site,
.site-content,
#page,
#content,
#main,
#main-content,
.main-content,
.page-container,
.ts-container,
.container,
.woocommerce,
.woocommerce-page,
.elementor,
.elementor-section,
.elementor-container,
.elementor-column,
.elementor-widget-wrap,
.elementor-widget-container {
  max-width: 100%;
  min-width: 0;
}

a,
p,
li,
td,
th,
.elementor-heading-title,
.elementor-widget-text-editor,
.woocommerce-loop-product__title,
.products .product-name,
.products .price {
  overflow-wrap: break-word;
}

.button,
button,
input[type="submit"],
.elementor-button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
}

.grecaptcha-badge {
  right: 0 !important;
  left: auto !important;
  max-width: min(256px, 100vw);
  z-index: 999 !important;
}

.ts-floating-sidebar,
.ts-sidebar-content,
.cart-dropdown-form,
.dropdown-container {
  max-width: 100vw;
}

.ts-sidebar-content {
  width: min(500px, 100vw) !important;
}

@media (max-width: 767px) {
  .grecaptcha-badge {
    bottom: 6px !important;
    transform: scale(0.72);
    transform-origin: 100% 100%;
  }

  .elementor-section,
  .elementor-top-section,
  .elementor-widget-container {
    overflow-x: hidden;
  }

  .elementor-widget-button .elementor-button,
  .elementor-button-wrapper .elementor-button {
    width: min(100%, 320px);
    text-align: center;
  }

  .woocommerce-cart-form,
  .woocommerce table.shop_table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .woocommerce form .form-row,
  .woocommerce form .form-row-first,
  .woocommerce form .form-row-last,
  .wpcf7 form p,
  .wpcf7-form-control-wrap,
  .elementor-form .elementor-field-group {
    width: 100% !important;
    float: none !important;
    max-width: 100%;
  }

  .wpcf7 input:not([type="checkbox"]):not([type="radio"]),
  .wpcf7 textarea,
  .wpcf7 select,
  .elementor-form input:not([type="checkbox"]):not([type="radio"]),
  .elementor-form textarea,
  .elementor-form select,
  .woocommerce form input:not([type="checkbox"]):not([type="radio"]),
  .woocommerce form textarea,
  .woocommerce form select {
    width: 100%;
    max-width: 100%;
  }
}

/* Mobile menu drawer */
@media (max-width: 767px) {
  body.id-mobile-menu-open {
    overflow: hidden !important;
    touch-action: none;
  }

  body.id-mobile-menu-open .ts-header,
  body.id-mobile-menu-open .header-template,
  body.id-mobile-menu-open .header-middle {
    position: relative;
    z-index: 10020;
  }

  body.id-mobile-menu-open #group-icon-header.active {
    top: var(--id-mobile-header-height) !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100dvh - var(--id-mobile-header-height)) !important;
    max-height: calc(100dvh - var(--id-mobile-header-height)) !important;
    overflow: visible !important;
    transform: none !important;
    z-index: 10010 !important;
  }

  body.id-mobile-menu-open #group-icon-header.active .ts-sidebar-content,
  body.id-mobile-menu-open #group-icon-header.active .sidebar-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    padding-top: 0 !important;
    overflow: visible !important;
  }

  body.id-mobile-menu-open .mobile-menu-wrapper.ts-menu {
    position: fixed !important;
    top: var(--id-mobile-header-height) !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 10010 !important;
    width: 100vw !important;
    height: calc(100dvh - var(--id-mobile-header-height)) !important;
    max-height: calc(100dvh - var(--id-mobile-header-height)) !important;
    padding: 12px var(--id-page-gutter) max(34px, env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: #fff;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.16);
    -webkit-overflow-scrolling: touch;
  }

  body.id-mobile-menu-open .mobile-menu-wrapper.ts-menu ul.menu,
  body.id-mobile-menu-open .mobile-menu-wrapper.ts-menu ul.sub-menu {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding-left: 0;
  }

  body.id-mobile-menu-open .mobile-menu-wrapper.ts-menu ul.sub-menu {
    padding-left: 14px;
  }

  body.id-mobile-menu-open .mobile-menu-wrapper.ts-menu li {
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  body.id-mobile-menu-open .mobile-menu-wrapper.ts-menu a {
    display: flex;
    align-items: center;
    min-height: 50px;
    padding: 0;
    color: #111;
    font-size: 18px;
    line-height: 1.25;
    text-decoration: none;
    white-space: normal;
  }

  body.id-mobile-menu-open .mobile-menu-wrapper.ts-menu .ts-menu-drop-icon {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin-left: auto;
  }
}

/* Mobile product filter/category area */
@media (max-width: 767px) {
  body.tax-product_cat #main-content,
  body.post-type-archive-product #main-content {
    width: 100%;
    max-width: 100%;
  }

  body.tax-product_cat #main-content:not(.active) aside,
  body.post-type-archive-product #main-content:not(.active) aside {
    display: none !important;
  }

  body.tax-product_cat #main-content.active aside,
  body.post-type-archive-product #main-content.active aside {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 0 16px !important;
    padding: 14px 16px !important;
    overflow: visible !important;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
  }

  body.tax-product_cat .filter-widget-area-button,
  body.post-type-archive-product .filter-widget-area-button {
    min-height: 44px;
    margin: 4px 0 16px;
  }

  body.tax-product_cat .filter-widget-area-button:focus-visible,
  body.post-type-archive-product .filter-widget-area-button:focus-visible {
    outline: 2px solid #0e3a3d;
    outline-offset: 3px;
  }

  body.tax-product_cat .ts-product-categories-widget ul,
  body.post-type-archive-product .ts-product-categories-widget ul {
    display: grid;
    gap: 4px;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  body.tax-product_cat .ts-product-categories-widget li,
  body.post-type-archive-product .ts-product-categories-widget li {
    width: 100%;
    margin: 0;
  }

  body.tax-product_cat .ts-product-categories-widget a,
  body.post-type-archive-product .ts-product-categories-widget a {
    display: block;
    padding: 7px 0;
    white-space: normal;
  }
}

/* WooCommerce product grid: 2 columns on mobile */
@media (max-width: 599px) {
  body.woocommerce.archive .products,
  body.woocommerce-page.archive .products,
  body.tax-product_cat .products,
  body.post-type-archive-product .products,
  .woocommerce ul.products,
  .woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.woocommerce.archive .products > .product,
  body.woocommerce-page.archive .products > .product,
  body.tax-product_cat .products > .product,
  body.post-type-archive-product .products > .product,
  .woocommerce ul.products li.product,
  .woocommerce-page ul.products li.product {
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
    flex: none !important;
  }

  body.woocommerce.archive .products .product-wrapper,
  body.tax-product_cat .products .product-wrapper,
  body.post-type-archive-product .products .product-wrapper,
  .woocommerce ul.products li.product .product-wrapper {
    width: 100%;
    max-width: 100%;
  }

  body.woocommerce.archive .products .thumbnail-wrapper,
  body.tax-product_cat .products .thumbnail-wrapper,
  body.post-type-archive-product .products .thumbnail-wrapper,
  .woocommerce ul.products li.product .thumbnail-wrapper {
    width: 100%;
    max-width: 100%;
  }

  .woocommerce ul.products li.product .woocommerce-loop-product__title,
  .woocommerce-page ul.products li.product .woocommerce-loop-product__title,
  .products .product .product-name {
    font-size: 13px !important;
    line-height: 1.35 !important;
  }

  .woocommerce ul.products li.product .price,
  .woocommerce-page ul.products li.product .price,
  .products .product .price {
    font-size: 13px !important;
    line-height: 1.35 !important;
  }

  .woocommerce ul.products li.product .button,
  .woocommerce-page ul.products li.product .button,
  .woocommerce ul.products li.product .add_to_cart_button,
  .woocommerce-page ul.products li.product .add_to_cart_button,
  .products .product .button,
  .products .product .add_to_cart_button {
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px 8px !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    text-align: center !important;
    white-space: normal !important;
  }
}

/* WooCommerce product grid: 3 columns on tablet */
@media (min-width: 600px) and (max-width: 1024px) {
  body.woocommerce.archive .products,
  body.woocommerce-page.archive .products,
  body.tax-product_cat .products,
  body.post-type-archive-product .products,
  .woocommerce ul.products,
  .woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.woocommerce.archive .products > .product,
  body.woocommerce-page.archive .products > .product,
  body.tax-product_cat .products > .product,
  body.post-type-archive-product .products > .product,
  .woocommerce ul.products li.product,
  .woocommerce-page ul.products li.product {
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
    flex: none !important;
  }
}

@media (max-width: 430px) {
  .products .product,
  .products .product * {
    min-width: 0;
  }

  .products .product .product-categories,
  .products .product .product-name,
  .products .product .price,
  .products .product .meta-wrapper {
    width: 100%;
    max-width: 100%;
  }

  .products .product .product-name,
  .woocommerce-loop-product__title {
    line-height: 1.35;
  }
}

/* Single product main price containment */
@media (max-width: 767px) {
  body.single-product .summary,
  body.single-product .entry-summary,
  body.single-product .woocommerce-product-details__short-description {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body.single-product .summary > .price,
  body.single-product .entry-summary > .price,
  body.single-product .summary p.price,
  body.single-product .entry-summary p.price,
  body.single-product .summary span.price,
  body.single-product .entry-summary span.price {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    line-height: 1.35 !important;
    font-size: clamp(20px, 5.6vw, 26px) !important;
  }

  body.single-product .summary > .price .amount,
  body.single-product .entry-summary > .price .amount,
  body.single-product .summary > .price .woocommerce-Price-amount,
  body.single-product .entry-summary > .price .woocommerce-Price-amount {
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    line-height: 1.35 !important;
  }

  body.single-product .summary > .price del,
  body.single-product .summary > .price ins,
  body.single-product .entry-summary > .price del,
  body.single-product .entry-summary > .price ins {
    display: inline-block !important;
    max-width: 100% !important;
    white-space: normal !important;
  }

  body.single-product form.cart,
  body.single-product .cart,
  body.single-product .single_variation_wrap,
  body.single-product .woocommerce-variation-price,
  body.single-product .yith-wapo-container,
  body.single-product .yith-wapo-block,
  body.single-product .yith-wapo-addon,
  body.single-product .yith-wapo-option,
  body.single-product .product-add-on,
  body.single-product .product-addon {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-wrap: normal !important;
  }

  body.single-product .yith-wapo-option,
  body.single-product .yith-wapo-addon,
  body.single-product .yith-wapo-container label,
  body.single-product .yith-wapo-container span,
  body.single-product .yith-wapo-container .price,
  body.single-product .option-price {
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
}

/* Single product related products fix */
@media (max-width: 767px) {
  body.single-product .related,
  body.single-product .upsells,
  body.single-product .cross-sells {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  body.single-product .related h2,
  body.single-product .upsells h2,
  body.single-product .cross-sells h2 {
    font-size: clamp(28px, 8vw, 38px) !important;
    line-height: 1.15 !important;
    margin-bottom: 24px !important;
  }

  body.single-product .related ul.products,
  body.single-product .upsells ul.products,
  body.single-product .cross-sells ul.products,
  body.single-product .related .products,
  body.single-product .upsells .products,
  body.single-product .cross-sells .products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body.single-product .related ul.products li.product,
  body.single-product .upsells ul.products li.product,
  body.single-product .cross-sells ul.products li.product,
  body.single-product .related .products > .product,
  body.single-product .upsells .products > .product,
  body.single-product .cross-sells .products > .product {
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
    flex: none !important;
    display: block !important;
  }

  body.single-product .related .product-wrapper,
  body.single-product .upsells .product-wrapper,
  body.single-product .cross-sells .product-wrapper,
  body.single-product .related .thumbnail-wrapper,
  body.single-product .upsells .thumbnail-wrapper,
  body.single-product .cross-sells .thumbnail-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body.single-product .related img,
  body.single-product .upsells img,
  body.single-product .cross-sells img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }

  body.single-product .related .product-name,
  body.single-product .upsells .product-name,
  body.single-product .cross-sells .product-name,
  body.single-product .related .woocommerce-loop-product__title,
  body.single-product .upsells .woocommerce-loop-product__title,
  body.single-product .cross-sells .woocommerce-loop-product__title {
    font-size: 13px !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  body.single-product .related .price,
  body.single-product .upsells .price,
  body.single-product .cross-sells .price,
  body.single-product .related .price .amount,
  body.single-product .upsells .price .amount,
  body.single-product .cross-sells .price .amount,
  body.single-product .related .woocommerce-Price-amount,
  body.single-product .upsells .woocommerce-Price-amount,
  body.single-product .cross-sells .woocommerce-Price-amount {
    font-size: 13px !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  body.single-product .related .button,
  body.single-product .upsells .button,
  body.single-product .cross-sells .button,
  body.single-product .related .add_to_cart_button,
  body.single-product .upsells .add_to_cart_button,
  body.single-product .cross-sells .add_to_cart_button {
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px 8px !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    text-align: center !important;
    white-space: normal !important;
  }
}

/* Footer mobile containment */
@media (max-width: 599px) {
  .footer-container,
  footer,
  footer .elementor-section,
  footer .elementor-container,
  footer .elementor-column,
  footer .widget,
  footer .menu {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
  }

  footer a,
  footer p,
  footer li {
    overflow-wrap: anywhere;
  }
}