/*
Theme Name: Blocksy Child
Template: blocksy
Version: 1.0.0
Description: EnigmaHub child theme with unified typography, spacing and responsive WooCommerce styling.
Text Domain: enigmahub

 * EnigmaHub — unified layout and typography
 * Draft only. No brand colours, theme palette, logo or header design are changed.
 */

/* Global reading rhythm */
body {
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

p,
.entry-content li,
.woocommerce-product-details__short-description {
  line-height: 1.65;
}

h1,
h2,
h3,
h4,
h5,
h6,
.elementor-heading-title {
  line-height: 1.25;
  text-wrap: balance;
}

h1,
.elementor-widget-heading h1.elementor-heading-title {
  font-size: clamp(2rem, 3.2vw, 2.5rem);
  line-height: 1.18;
}

h2,
.elementor-widget-heading h2.elementor-heading-title {
  font-size: clamp(1.65rem, 2.6vw, 2.1rem);
  line-height: 1.22;
}

h3,
.elementor-widget-heading h3.elementor-heading-title {
  font-size: clamp(1.3rem, 2vw, 1.65rem);
  line-height: 1.25;
}

h4,
h5,
h6 {
  line-height: 1.3;
}

/* Consistent text rhythm inside Elementor content without changing section colours */
.elementor-widget-text-editor p:last-child {
  margin-bottom: 0;
}

.elementor-widget-heading .elementor-heading-title {
  margin-block: 0;
}

/* WooCommerce product listing */
.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.8vw, 24px);
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
  display: none;
}

.woocommerce ul.products li.product {
  display: flex;
  flex-direction: column;
  float: none;
  width: auto;
  min-width: 0;
  margin: 0;
}

.woocommerce ul.products li.product .ct-media-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0 !important;
}

.woocommerce ul.products li.product .ct-media-container img {
  object-fit: contain;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.7em;
  margin-block: 2px 3px;
}

.woocommerce ul.products li.product .price {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  margin-block: 0 16px;
}

.woocommerce ul.products li.product .ct-woo-card-actions .button {
  width: calc(100% - 12px);
  min-width: 0;
  max-width: 100%;
  align-self: center;
  min-height: 42px;
  padding: 10px 16px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
}

/* Individual product pages */
.single-product .product-entry-wrapper {
  column-gap: clamp(28px, 4vw, 56px);
}

.single-product .product_title {
  font-size: clamp(1.75rem, 2.7vw, 2.2rem);
  line-height: 1.2;
}

.single-product .summary .price {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  line-height: 1.25;
}

.single-product .woocommerce-tabs {
  margin-top: clamp(32px, 4vw, 56px);
}

/* Consistent control sizing; existing theme colours and borders remain in control */
button,
.button,
.wp-element-button,
.elementor-button,
input[type="submit"],
input[type="button"],
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  min-height: 44px;
  line-height: 1.2;
  font-weight: 600;
  transition: none;
  transform: none;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
select,
textarea {
  min-height: 44px;
  padding: 10px 13px;
  font: inherit;
  line-height: 1.4;
}

/* Keep product imagery still: no hover zoom or card movement */
.woocommerce ul.products li.product,
.woocommerce ul.products li.product:hover {
  transform: none;
}

.woocommerce ul.products li.product .ct-media-container img,
.woocommerce ul.products li.product:hover .ct-media-container img {
  transform: none;
  transition: none;
}

/* Tablet */
@media (max-width: 999px) {
  .woocommerce ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .single-product .product-entry-wrapper {
    column-gap: 28px;
  }
}

/* Mobile — retain the requested three-column product grid */
@media (max-width: 600px) {
  body {
    font-size: 15px;
    line-height: 1.6;
  }

  h1,
  .elementor-widget-heading h1.elementor-heading-title {
    font-size: clamp(1.75rem, 7vw, 2rem);
  }

  h2,
  .elementor-widget-heading h2.elementor-heading-title {
    font-size: clamp(1.45rem, 5.8vw, 1.7rem);
  }

  h3,
  .elementor-widget-heading h3.elementor-heading-title {
    font-size: clamp(1.2rem, 4.8vw, 1.4rem);
  }

  .woocommerce ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 12.5px;
    line-height: 1.3;
    min-height: 2.6em;
    margin-block: 2px 3px;
  }

  .woocommerce ul.products li.product .price {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
  }

  .woocommerce ul.products li.product .ct-woo-card-actions .button {
    width: calc(100% - 8px);
    min-height: 38px;
    padding: 8px 10px;
    font-size: 10px;
    line-height: 1.1;
  }

  .single-product .product_title {
    font-size: 1.65rem;
  }

  .single-product .summary .price {
    font-size: 1.4rem;
  }
}

/* Homepage content alignment: keep the hero slider full-width, align the sections below it */
@supports selector(.elementor:has(*)) {
  /* Sections with Elementor's boxed inner wrapper */
  .elementor .e-con.e-parent:not(:has(.n2-ss-slider)) > .e-con-inner {
    box-sizing: border-box;
    width: min(100% - 40px, 1400px);
    max-width: 1400px;
    margin-inline: auto;
  }

  /* Full-width sections without an inner wrapper: preserve the section background,
     but inset the content to the same 1200px reading width. */
  .elementor .e-con.e-parent:not(:has(.n2-ss-slider)):not(:has(> .e-con-inner)) {
    box-sizing: border-box;
    padding-inline: max(14px, calc((100% - 1400px) / 2));
  }
}

/* Give Elementor call-to-action buttons room instead of clustering them */
.elementor .elementor-widget-button {
  margin: 8px 10px 8px 0;
}

.elementor .elementor-widget-button .elementor-button {
  min-width: 112px;
  padding-inline: 20px;
}

/* Keep adjacent button widgets visually separated */
.elementor .elementor-widget-button + .elementor-widget-button {
  margin-inline-start: 10px;
}

/* Accessibility: preserve a visible keyboard focus indicator */
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Keep product titles close to their images for a tighter, consistent card layout. */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  margin-block: 3px 4px;
}

.woocommerce ul.products li.product .price {
  margin-block: 0 16px;
}

.woocommerce ul.products li.product .ct-woo-card-actions {
  margin-top: 4px;
}

/* Individual product page: separate key product information and purchase controls */
.single-product .summary .product_title {
  margin-bottom: 18px;
}

.single-product .summary .price {
  display: block;
  margin-block: 0 20px;
}

.single-product .summary .woocommerce-product-details__short-description {
  margin-block: 0 22px;
}

.single-product .summary form.cart {
  margin-block: 22px 26px;
}

.single-product .summary .product_meta {
  margin-top: 24px;
  line-height: 1.8;
}

/* Wider, consistent content width for legacy Elementor sections such as Latest Media */
.elementor .e-flexbox-base.e-default-div {
  box-sizing: border-box;
  width: min(100% - 40px, 1400px);
  max-width: 1400px;
  margin-inline: auto;
}

/* Keep homepage forms readable instead of stretching across the page */
.elementor #wpforms-form-439,
.elementor #wpforms-form-437 {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
}

/* Keep brand/logo carousel content aligned to the wider main content column */
.elementor .elementor-widget-image-carousel,
.elementor .elementor-widget-media-carousel,
.elementor .elementor-widget-image-gallery {
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
}

@media (max-width: 600px) {
  .elementor .e-con.e-parent:not(:has(.n2-ss-slider)) > .e-con-inner {
    width: calc(100% - 28px);
  }

  .elementor .e-flexbox-base.e-default-div {
    width: calc(100% - 28px);
  }

  .elementor #wpforms-form-439,
  .elementor #wpforms-form-437 {
    max-width: 100%;
  }

  .elementor .elementor-widget-button {
    margin: 7px 6px 7px 0;
  }

  .elementor .elementor-widget-button + .elementor-widget-button {
    margin-inline-start: 6px;
  }

  .elementor .elementor-widget-button .elementor-button {
    min-width: 104px;
    padding-inline: 16px;
  }
}

/* Do not impose a global width on every Elementor flexbox container.
   Individual homepage sections are constrained by their own targeted rules. */

/* Keep the contact section and its forms inside the standard content column */
.elementor .e-con:has(#wpforms-form-439),
.elementor .e-con:has(#wpforms-form-437),
.elementor .e-flexbox-base:has(#wpforms-form-439),
.elementor .e-flexbox-base:has(#wpforms-form-437) {
  padding-inline: max(14px, calc((100% - 1400px) / 2));
}

.elementor #wpforms-form-439,
.elementor #wpforms-form-437 {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
}



@media (max-width: 600px) {
  .elementor .e-con:has(#wpforms-form-439),
  .elementor .e-con:has(#wpforms-form-437),
  .elementor .e-flexbox-base:has(#wpforms-form-439),
  .elementor .e-flexbox-base:has(#wpforms-form-437) {
    padding-inline: 0;
  }

  .elementor #wpforms-form-439,
  .elementor #wpforms-form-437 {
    max-width: 100%;
  }
}

/* Target the actual Elementor 4 flexbox elements used on this homepage.
   The earlier rules targeted legacy wrappers that these sections do not use. */
.elementor .elementor-element-e96dd27 {
  box-sizing: border-box;
  width: min(100% - 40px, 1400px) !important;
  max-width: 1400px !important;
  margin-inline: auto !important;
}
.elementor .elementor-element-79c896c {
  width: 100% !important;
  max-width: 900px !important;
  margin-inline: auto !important;
}
.elementor .elementor-element-3130827 {
  box-sizing: border-box;
  width: 100% !important;
  max-width: 900px !important;
  margin-inline: auto !important;
}
.elementor .elementor-element-f26ea99 {
  box-sizing: border-box;
  width: min(100% - 40px, 1400px) !important;
  max-width: 1400px !important;
  margin-inline: auto !important;
}
/* Keep Swiper's own slide widths and spacing intact; only standardise logo sizing. */
.elementor .elementor-element-d68ba3c .swiper-slide-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  margin: 0;
}
.elementor .elementor-element-d68ba3c .swiper-slide-image {
  display: block;
  width: auto;
  max-width: min(130px, 90%);
  max-height: 54px;
  object-fit: contain;
}

/* Latest Media: four evenly sized YouTube tiles on desktop. */
.elementor .elementor-element-a31bb9c {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  align-items: start;
  gap: 22px;
  width: min(100% - 40px, 1400px) !important;
  max-width: 1400px !important;
  margin-inline: auto !important;
}
.elementor .elementor-element-a31bb9c > .e-flexbox-base {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  margin: 0 !important;
}
.elementor .elementor-element-a31bb9c .e-youtube-base {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.elementor .elementor-element-a31bb9c .e-youtube-base iframe {
  display: block;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 16 / 9;
}

/* Latest Media section: constrain its real Elementor 4 parent, not the heading alone. */
@media (max-width: 1024px) {
  .elementor .elementor-element-a31bb9c {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px;
    width: calc(100% - 32px) !important;
  }
}
@media (max-width: 600px) {
  .elementor .elementor-element-a31bb9c {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px;
    width: calc(100% - 28px) !important;
  }
}
.elementor .e-con:has(.elementor-element-7658406),
.elementor .e-flexbox-base:has(.elementor-element-7658406) {
  box-sizing: border-box;
  width: min(100% - 40px, 1400px) !important;
  max-width: 1400px !important;
  margin-inline: auto !important;
}

@media (max-width: 600px) {
  .elementor .elementor-element-e96dd27,
  .elementor .elementor-element-f26ea99,
  .elementor .e-con:has(.elementor-element-7658406),
  .elementor .e-flexbox-base:has(.elementor-element-7658406) {
    width: calc(100% - 28px) !important;
  }
  .elementor .elementor-element-79c896c,
  .elementor .elementor-element-3130827 {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Remove the unwanted gap between the site header and the homepage hero slider. */
.elementor .elementor-element-0533853 {
  margin-block-start: 0 !important;
  padding-block-start: 0 !important;
}
.elementor .elementor-element-0533853 > .elementor-widget-shortcode,
.elementor .elementor-element-0533853 .elementor-shortcode,
.elementor .elementor-element-0533853 .n2-section-smartslider,
.elementor .elementor-element-0533853 #n2-ss-3-align,
.elementor .elementor-element-0533853 .n2-padding {
  margin-block-start: 0 !important;
  padding-block-start: 0 !important;
}

/* Homepage product grid spacing — scoped to the actual homepage WooCommerce list. */
body.home ul.products.columns-4 {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  column-gap: 32px !important;
  row-gap: 84px !important;
  align-items: stretch;
  margin-inline: 0 !important;
}

body.home ul.products.columns-4 > li.product {
  box-sizing: border-box;
  float: none !important;
  width: auto !important;
  min-width: 0;
  margin: 0 !important;
  padding: 0 0 8px !important;
}

@media (max-width: 999px) {
  body.home ul.products.columns-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    column-gap: 20px !important;
    row-gap: 70px !important;
  }
}

@media (max-width: 600px) {
  body.home ul.products.columns-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    column-gap: 14px !important;
    row-gap: 60px !important;
  }
  body.home ul.products.columns-4 > li.product {
    padding-bottom: 6px !important;
  }
}

/* Unified tighter mobile homepage product rows. Keep the same three-column
   layout and card internals, with a consistent 24px row gap. */
@media (max-width: 600px) {
  body.home ul.products.columns-4 {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    column-gap: 14px !important;
    row-gap: 24px !important;
  }

  body.home ul.products.columns-4 > li.product {
    padding-bottom: 0 !important;
    align-items: center !important;
    text-align: center !important;
  }

  body.home ul.products.columns-4 > li.product .woocommerce-loop-product__title,
  body.home ul.products.columns-4 > li.product .price {
    width: 100%;
    text-align: center !important;
  }

  body.home ul.products.columns-4 > li.product .ct-woo-card-actions {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  body.home ul.products.columns-4 > li.product > figure {
    display: block;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.home ul.products.columns-4 > li.product > figure .ct-media-container {
    display: flex;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.home ul.products.columns-4 > li.product .woocommerce-loop-product__title {
    margin-block: 1px 3px !important;
  }
}

/* Single-product title: preserve the established desktop and mobile font sizes.
   Only control wrapping and width so the complete product name remains visible. */
.single-product .product-entry-wrapper .summary .product_title {
  display: block;
  box-sizing: border-box;
  width: 100% !important;
  max-width: 100% !important;
  text-wrap: pretty;
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Single-product title: always show the complete product name.
   Explicitly remove any height, line-clamp, or overflow restriction. */
.single-product .product-entry-wrapper .summary.entry-summary .product_title.entry-title {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  white-space: normal !important;
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: initial !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

.single-product .product-entry-wrapper .summary.entry-summary {
  min-width: 0 !important;
}
