/*
 * Aynazi responsive correction layer
 * Loaded last by functions.php so these rules remain authoritative.
 */

html {
  max-width: 100%;
  overflow-x: clip;
}

body,
.site-main,
.site-main > section,
.aynazi-container,
.wp-content-card,
.home-hero__stage-inner,
.category-content,
.product-summary,
.blog-single-main-column {
  min-width: 0;
}

img,
picture,
video,
iframe,
svg,
canvas {
  max-width: 100%;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

.wp-editor-content,
.blog-single-content,
.product-tab-panel,
.about-intro-card__content,
.about-choice-card,
.faq-item,
.site-footer__phones {
  overflow-wrap: anywhere;
}

.wp-editor-content iframe,
.blog-single-content iframe,
.wp-editor-content video,
.blog-single-content video {
  width: 100%;
}

.wp-editor-content table,
.blog-single-content table {
  max-width: 100%;
}

/* Medium desktop / small laptop */
@media (min-width: 992px) and (max-width: 1279.98px) {
  .aynazi-container,
  .section-block > .aynazi-container,
  .single-product-section > .aynazi-container,
  .product-story-section > .aynazi-container,
  .product-tabs-section > .aynazi-container,
  .category-main-section > .aynazi-container,
  .eshop-page .shop-section > .aynazi-container {
    width: min(100% - 40px, 1480px);
  }

  .home-header__inner {
    grid-template-columns: 176px minmax(0, 1fr) 176px;
  }

  .home-header__actions {
    gap: 22px;
  }

  .home-hero__stage-inner {
    grid-template-columns: minmax(430px, 54%) minmax(330px, 41%) minmax(48px, 5%);
  }

  .home-hero__title {
    font-size: clamp(38px, 4.2vw, 54px);
  }

  .home-hero__description {
    font-size: clamp(16px, 1.45vw, 19px);
  }

  .category-layout {
    grid-template-columns: 242px minmax(0, 1fr);
  }

  .category-products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Tablet and mobile: fixed header/app bar, safe widths and touch targets */
@media (max-width: 991.98px) {
  :root {
    --mobile-header-core-height: 72px;
    --mobile-header-height: calc(var(--mobile-header-core-height) + env(safe-area-inset-top, 0px));
    --mobile-app-bar-height: 74px;
  }

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip !important;
  }

  body {
    padding-top: var(--mobile-header-height) !important;
    padding-bottom: calc(var(--mobile-app-bar-height) + env(safe-area-inset-bottom, 0px)) !important;
  }

  .home-header,
  .home-header.is-sticky {
    min-height: var(--mobile-header-height);
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    padding-bottom: 10px;
  }

  body.admin-bar .home-header,
  body.admin-bar .home-header.is-sticky {
    top: 32px !important;
  }

  .home-header__inner {
    width: 100%;
  }

  .home-header__actions {
    width: 100% !important;
    min-height: calc(var(--mobile-app-bar-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .home-header__actions .header-icon,
  .home-header__actions .mini-cart-trigger {
    min-height: 54px;
    touch-action: manipulation;
  }

  .mobile-menu__panel {
    width: 100% !important;
    height: 100dvh !important;
    padding-top: calc(92px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .mobile-menu__panel > a,
  .mobile-menu__item > summary,
  .mobile-menu__submenu a {
    height: auto !important;
  }

  .mini-cart-panel {
    max-height: min(88dvh, 760px);
  }

  .mini-cart-panel__body {
    min-height: 0;
    overflow-y: auto;
  }

  .aynazi-container,
  .section-block > .aynazi-container,
  .single-product-section > .aynazi-container,
  .product-story-section > .aynazi-container,
  .product-tabs-section > .aynazi-container,
  .category-main-section > .aynazi-container,
  .eshop-page .shop-section > .aynazi-container,
  .blog-single-page .aynazi-container {
    width: min(100% - 32px, 1480px);
  }

  .section-heading,
  .container-title {
    min-width: 0;
  }

  .section-heading__title,
  .section-heading h2,
  .container-title h2 {
    overflow-wrap: anywhere;
  }

  /* Home hero: content must remain above the image. */
  .home-hero,
  .home-hero__stage,
  .home-hero__stage-inner {
    height: auto !important;
    min-height: 0 !important;
  }

  .home-hero {
    overflow: visible !important;
  }

  .home-hero__stage {
    overflow: visible !important;
  }

  .home-hero__stage-inner {
    position: relative !important;
    display: flex !important;
    flex-direction: column;
    overflow: visible !important;
  }

  .home-hero__content {
    position: relative !important;
    z-index: 5 !important;
    width: 100%;
    max-width: 100%;
  }

  .home-hero__slide-content {
    position: relative !important;
    z-index: 5;
  }

  .home-hero__visual {
    position: relative !important;
    z-index: 1 !important;
    flex: 0 0 auto;
  }

  .home-hero__cta {
    position: relative !important;
    inset: auto !important;
    display: inline-flex !important;
    width: min(100%, 248px);
    min-width: 0;
    min-height: 50px;
    margin-top: 16px;
    padding-inline: 20px;
    transform: none !important;
  }

  .home-hero__image {
    max-width: 100%;
  }

  .latest-products .product-card__body,
  .latest-products__cards .product-card__body {
    min-height: 0;
  }

  .latest-products__cards,
  .popular-products-grid,
  .blog-posts-grid,
  .product-gallery__thumbs,
  .product-tabs__nav,
  .faq-category-grid {
    scrollbar-width: none;
  }

  .latest-products__cards::-webkit-scrollbar,
  .popular-products-grid::-webkit-scrollbar,
  .blog-posts-grid::-webkit-scrollbar,
  .product-gallery__thumbs::-webkit-scrollbar,
  .product-tabs__nav::-webkit-scrollbar,
  .faq-category-grid::-webkit-scrollbar {
    display: none;
  }

  .style-card,
  .product-card,
  .popular-card,
  .blog-card {
    min-width: 0;
  }

  .product-card__title,
  .popular-card__body h3,
  .blog-card h3 {
    overflow-wrap: anywhere;
  }

  /* Product archive/filter drawer */
  .category-toolbar,
  .category-toolbar__actions,
  .category-result-count {
    min-width: 0;
  }

  .category-result-count {
    overflow-wrap: anywhere;
  }

  .category-sidebar {
    overscroll-behavior: contain;
  }

  .category-filter-form,
  .filter-group,
  .filter-category-tree {
    min-width: 0;
  }

  /* Single product */
  .single-product-section .product-gallery__image {
    width: 100%;
    height: 100%;
  }

  .product-spec strong,
  .product-spec small {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .product-option__colors,
  .product-option__sizes {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .product-tabs__body,
  .product-tab-panel,
  .product-tab-panel__copy {
    min-width: 0;
  }

  /* Inner pages */
  .aynazi-hero__content {
    max-width: 100%;
  }

  .about-intro-card,
  .about-choice-grid,
  .about-values-grid {
    min-width: 0;
  }

  .about-choice-card--image img {
    width: 100%;
    object-position: center top;
  }

  .blog-single-content img,
  .wp-editor-content img {
    width: auto;
    height: auto;
  }

  .blog-single-content pre,
  .wp-editor-content pre {
    max-width: 100%;
    overflow-x: auto;
  }

  /* Footer */
  .site-footer__grid > *,
  .site-footer__phones,
  .site-footer__phones a,
  .site-footer__phones span {
    min-width: 0;
    max-width: 100%;
  }

  .site-footer__phones a,
  .site-footer__phones span {
    justify-content: center;
    white-space: normal;
    text-align: center;
  }

  .footer-nav a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  /* WooCommerce cart/checkout is printed inside the generic content card. */
  .woocommerce-cart .wp-content-card,
  .woocommerce-checkout .wp-content-card {
    padding: 20px;
  }

  .aynazi-commerce,
  .aynazi-commerce__layout,
  .aynazi-checkout__layout,
  .aynazi-commerce__main,
  .aynazi-commerce__aside,
  .aynazi-checkout__fields,
  .aynazi-checkout__review,
  .aynazi-cart-item__content,
  .aynazi-cart-item__top > div {
    min-width: 0;
  }

  .aynazi-checkout input.input-text,
  .aynazi-checkout textarea,
  .aynazi-checkout select,
  .select2-container,
  .select2-container .select2-selection--single {
    width: 100% !important;
    max-width: 100%;
  }

  .aynazi-checkout-review-order-table {
    table-layout: fixed;
  }

  .aynazi-checkout-review-order-table th,
  .aynazi-checkout-review-order-table td {
    overflow-wrap: anywhere;
  }

  /* Account forms */
  .my-account-page .woocommerce,
  .my-account-page form,
  .my-account-page .form-row,
  .my-account-page input,
  .my-account-page select,
  .my-account-page textarea {
    max-width: 100%;
  }
}

@media (max-width: 782px) {
  body.admin-bar .home-header,
  body.admin-bar .home-header.is-sticky {
    top: 46px !important;
  }
}

/* Phones */
@media (max-width: 767.98px) {
  .aynazi-container,
  .section-block > .aynazi-container,
  .single-product-section > .aynazi-container,
  .product-story-section > .aynazi-container,
  .product-tabs-section > .aynazi-container,
  .category-main-section > .aynazi-container,
  .eshop-page .shop-section > .aynazi-container,
  .blog-single-page .aynazi-container {
    width: min(100% - 28px, 1480px);
  }

  .section-block,
  .collections-section,
  .brand-process-section,
  .popular-products-section,
  .blog-posts-section,
  .service-bar-section,
  .newsletter-section {
    padding-block: 34px;
  }

  /* Homepage hero: button is in normal flow and can never sit behind image. */
  .home-hero__content {
    padding: 18px 0 0 !important;
    text-align: center;
  }

  .home-hero__eyebrow {
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.6;
  }

  .home-hero__title {
    max-width: 100%;
    font-size: clamp(27px, 8vw, 34px);
    line-height: 1.3;
    white-space: normal !important;
  }

  .home-hero__description {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.8;
  }

  .home-hero__cta {
    min-height: 48px;
    margin-top: 12px;
    border-radius: 12px;
    font-size: 14px;
    box-shadow: 0 12px 28px rgba(17, 24, 39, .14);
  }

  .home-hero__visual {
    width: 100%;
    height: clamp(390px, 116vw, 520px) !important;
    min-height: 0 !important;
    margin-top: 12px;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden !important;
  }

  .home-hero__image,
  .home-hero__image.is-changing {
    width: auto;
    max-width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    object-position: center bottom;
    transform: none !important;
  }

  .home-hero__mobile-slider {
    right: 50% !important;
    bottom: 12px !important;
    transform: translateX(50%) !important;
  }

  .latest-products .latest-products__cards,
  .popular-products-grid,
  .blog-posts-grid {
    grid-auto-columns: min(72vw, 270px);
  }

  .latest-products__cards .product-card__media,
  .product-card__media,
  .popular-card__media {
    height: auto;
    aspect-ratio: 3 / 4;
  }

  .latest-products__cards .product-card__body,
  .latest-products .product-card__body,
  .popular-card__body {
    min-height: 0;
    padding: 14px 12px 16px;
  }

  .latest-products__cards .product-card__description {
    min-height: 0;
  }

  .suggested-styles__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .suggested-styles .style-card__media {
    height: auto;
    min-height: 0;
    aspect-ratio: 3 / 4;
  }

  .suggested-styles .style-card__button {
    white-space: normal;
    line-height: 1.35;
    text-align: center;
  }

  .collections-grid {
    grid-template-columns: 1fr;
  }

  .collection-card {
    height: auto;
    min-height: 220px;
    aspect-ratio: 16 / 10;
  }

  .service-bar {
    grid-template-columns: 1fr;
  }

  .service-item {
    padding: 10px 8px;
  }

  .newsletter-card__media {
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .newsletter-form {
    grid-template-columns: minmax(0, 1fr) 104px;
  }

  .newsletter-form input {
    min-width: 0;
  }

  /* Shop/category */
  .eshop-page .shop-categories-section > .aynazi-container {
    width: min(100% - 28px, 1480px);
  }

  .eshop-page .shop-categories-section .shop-categories-grid,
  .category-products-grid.is-grid-view,
  .category-products-grid:not(.is-list-view) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .category-toolbar__actions {
    flex-wrap: nowrap;
  }

  .category-sort-menu {
    right: auto !important;
    left: 0 !important;
    max-width: calc(100vw - 28px);
  }

  .category-products-grid.is-list-view .category-product-card.popular-card {
    max-height: none;
  }

  /* Single product */
  .single-product-section .single-product-card {
    padding: 10px;
  }

  .single-product-section .product-summary {
    padding: 16px 8px 8px;
  }

  .single-product-section .product-gallery__main {
    aspect-ratio: 1 / 1;
  }

  .product-mini-related__items {
    max-width: 100%;
  }

  /* Inner heroes and editorial pages */
  .aynazi-hero-section {
    padding-bottom: 28px;
  }

  .aynazi-hero-container {
    width: min(100% - 28px, 1480px);
  }

  .aynazi-hero,
  .aynazi-hero__content {
    height: auto;
    min-height: 250px;
  }

  .aynazi-hero__content {
    padding: 24px 16px;
  }

  .aynazi-hero__title {
    font-size: clamp(28px, 9vw, 35px);
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  .aynazi-hero__actions {
    width: 100%;
  }

  .aynazi-hero__actions > * {
    max-width: 100%;
  }

  .about-intro-card__content,
  .about-choice-card--text,
  .about-choice-card--note,
  .about-value-card {
    padding: 20px 18px;
  }

  .about-intro-card__media img,
  .about-choice-card--image img {
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .faq-category-grid {
    padding-inline: 2px;
  }

  .faq-item summary {
    padding-inline: 0 44px;
  }

  .blog-single-content figure,
  .wp-editor-content figure {
    max-width: 100%;
    margin-inline: 0;
  }

  .blog-single-content table,
  .wp-editor-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Cart / checkout */
  .woocommerce-cart .wp-content-card,
  .woocommerce-checkout .wp-content-card {
    padding: 14px;
    border-radius: 18px;
  }

  .aynazi-commerce {
    padding: 20px 0 32px;
  }

  .aynazi-commerce__heading {
    margin-bottom: 20px;
  }

  .aynazi-cart-item {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
  }

  .aynazi-cart-item__top,
  .aynazi-cart-item__bottom {
    min-width: 0;
    gap: 8px;
  }

  .aynazi-cart-item h2 {
    font-size: 15px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .aynazi-cart-item .variation {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 8px;
  }

  .aynazi-cart-item .variation dd {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .aynazi-coupon,
  .aynazi-cart__actions {
    min-width: 0;
  }

  .aynazi-coupon input,
  .aynazi-coupon button,
  .aynazi-cart__actions > button {
    width: 100%;
  }

  .aynazi-summary-row {
    min-width: 0;
  }

  .aynazi-summary-row > * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .woocommerce-message .button,
  .woocommerce-info .button {
    float: none;
    display: flex;
    width: 100%;
    margin: 10px 0 0;
  }

  .aynazi-empty-state > div,
  .aynazi-thankyou__card {
    width: 100%;
    padding: 28px 18px;
  }

  /* Footer */
  .site-footer {
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  }

  .site-footer__grid {
    gap: 10px;
  }

  .site-footer__brand {
    padding-block: 20px;
  }

  .footer-nav {
    gap: 8px 14px;
  }

  .site-footer__bottom {
    padding-top: 14px;
  }
}

/* Narrow phones */
@media (max-width: 399.98px) {
  .home-header .aynazi-container {
    width: calc(100% - 20px);
  }

  .home-header__inner {
    grid-template-columns: 42px minmax(0, 1fr) 92px;
  }

  .home-header__logo img,
  .home-header.is-sticky .home-header__logo img {
    width: 88px;
  }

  .home-header__actions .mobile-nav-label {
    font-size: 9px;
  }

  .home-hero__title {
    font-size: clamp(25px, 7.7vw, 30px);
  }

  .home-hero__visual {
    height: clamp(360px, 120vw, 460px) !important;
  }

  .latest-products .latest-products__cards,
  .popular-products-grid,
  .blog-posts-grid {
    grid-auto-columns: min(78vw, 258px);
  }

  .newsletter-form {
    grid-template-columns: 1fr;
  }

  .newsletter-form button {
    width: 100%;
  }

  .category-toolbar {
    grid-template-columns: 1fr;
  }

  .category-toolbar__actions {
    justify-content: space-between;
    width: 100%;
  }

  .category-products-grid.is-grid-view,
  .category-products-grid:not(.is-list-view),
  .eshop-page .shop-categories-section .shop-categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap-inline: 10px;
  }

  .category-products-grid.is-list-view .category-product-card.popular-card {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .category-products-grid.is-list-view .category-product-card.popular-card .popular-card__media,
  .category-products-grid.is-list-view .category-product-card.popular-card .popular-card__image-link {
    width: 104px;
  }

  .single-product-section .product-summary__actions {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .aynazi-cart-item {
    grid-template-columns: 80px minmax(0, 1fr);
    padding: 10px;
  }

  .aynazi-cart-item__image img {
    width: 80px;
    height: 108px;
  }

  .aynazi-cart-item__bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer__trust {
    grid-template-columns: repeat(var(--trust-badge-count, 1), minmax(0, 82px));
  }

  .site-footer__trust-item {
    width: 82px;
    height: 82px;
  }
}

/* Short landscape devices: avoid a forced portrait-sized hero. */
@media (max-width: 991.98px) and (orientation: landscape) and (max-height: 600px) {
  .home-hero__content {
    padding-top: 12px !important;
  }

  .home-hero__eyebrow {
    margin-bottom: 6px;
  }

  .home-hero__title {
    font-size: clamp(24px, 4.8vw, 32px);
  }

  .home-hero__description {
    margin-top: 6px;
  }

  .home-hero__cta {
    min-height: 44px;
    margin-top: 8px;
  }

  .home-hero__visual {
    height: min(72vh, 390px) !important;
    min-height: 260px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero__image,
  .mobile-menu__panel,
  .mini-cart-panel,
  .category-sidebar,
  .category-filter-overlay {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Patch 16: last stylesheet guard for the homepage Hero.
 * responsive-fix.css is enqueued after main/responsive, so this also neutralizes
 * stale cached blur/filter animation declarations without changing layout.
 */
.home-hero__image,
.home-hero__image.is-changing,
.home-hero__slide-content,
.home-hero__slide-content.is-active,
.home-hero__slide-content.is-active.is-transitioning {
  filter: none !important;
}

.home-hero__slide-content,
.home-hero__slide-content.is-active,
.home-hero__slide-content.is-active.is-transitioning {
  animation: none !important;
}


