/*
 * Elite Print Store V12 hotfix
 * Compact header and strict single-product layout fixes.
 */

body.eps-theme {
  --eps-header-height: 76px;
  --eps-nav-height: 46px;
  --eps-logo-width: 210px;
  --eps-logo-height: 72px;
  --eps-logo-max-height: 64px;
  --eps-search-width: 460px;
}

.eps-commerce-topbar,
.eps-top-features {
  min-height: 0;
}

.eps-commerce-topbar-inner,
.eps-top-features-inner {
  min-height: 34px;
  padding-top: 6px;
  padding-bottom: 6px;
  line-height: 1.35;
}

.eps-announcement {
  padding: 6px 12px !important;
  min-height: 34px;
  display: flex;
  align-items: center;
}

.eps-header {
  position: sticky;
  top: 0;
  z-index: 80;
}

.eps-header-inner {
  min-height: 76px !important;
  padding: 8px 0 !important;
  grid-template-columns: minmax(150px, 220px) minmax(260px, 1fr) auto !important;
  gap: 14px !important;
}

.eps-logo {
  width: 210px !important;
  height: 64px !important;
  max-height: 64px !important;
  overflow: hidden;
}

.eps-logo img,
.eps-logo .custom-logo {
  width: auto !important;
  max-width: 210px !important;
  height: auto !important;
  max-height: 60px !important;
  object-fit: contain !important;
}

.eps-search {
  width: min(460px, 100%) !important;
}

.eps-search form {
  height: 42px !important;
}

.eps-search input[type=search] {
  height: 40px !important;
}

.eps-header-actions {
  gap: 8px !important;
}

.eps-action {
  min-height: 40px !important;
  padding: 8px 12px !important;
  border-radius: 12px !important;
}

.eps-nav .eps-container {
  min-height: 46px !important;
  border-radius: 12px !important;
}

.eps-nav ul,
.eps-nav a {
  min-height: 46px !important;
}

.eps-nav a {
  padding: 0 16px !important;
}

.eps-header-cats .eps-container {
  padding-top: 7px !important;
  padding-bottom: 7px !important;
}

.eps-header-cats a {
  padding: 5px 10px !important;
  font-size: 12px !important;
}

body.single-product .woocommerce-notices-wrapper,
body.single-product .woocommerce-message,
body.single-product .woocommerce-error,
body.single-product .woocommerce-info {
  width: min(1180px, 94vw) !important;
  max-width: 1180px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

body.single-product .woocommerce div.product,
body.single-product div.product.product {
  width: min(1180px, 94vw) !important;
  max-width: 1180px !important;
  margin: 24px auto !important;
  padding: 18px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 50%) minmax(0, 50%) !important;
  gap: 24px !important;
  align-items: start !important;
  direction: rtl !important;
  clear: both !important;
  float: none !important;
  overflow: visible !important;
  border: 1px solid #e7edf5 !important;
  border-radius: 20px !important;
  background: #fff !important;
  box-shadow: 0 16px 42px rgba(15, 23, 42, .07) !important;
}

body.single-product .woocommerce div.product::before,
body.single-product .woocommerce div.product::after,
body.single-product div.product.product::before,
body.single-product div.product.product::after {
  content: none !important;
  display: none !important;
}

body.single-product div.product div.images,
body.single-product div.product div.summary,
body.single-product .woocommerce div.product div.images,
body.single-product .woocommerce div.product div.summary {
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  clear: none !important;
}

body.single-product div.product div.images {
  grid-column: 1 !important;
  position: static !important;
  direction: rtl !important;
}

body.single-product div.product div.summary {
  grid-column: 2 !important;
  direction: rtl !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.single-product div.product div.images .woocommerce-product-gallery,
body.single-product div.product div.images .woocommerce-product-gallery__wrapper {
  width: 100% !important;
  max-width: 100% !important;
}

body.single-product div.product div.images .flex-viewport,
body.single-product div.product .woocommerce-product-gallery__image:first-child {
  height: auto !important;
  min-height: 0 !important;
  border: 1px solid #e7edf5 !important;
  border-radius: 18px !important;
  background: #f8fafc !important;
  overflow: hidden !important;
}

body.single-product div.product div.images img,
body.single-product div.product .woocommerce-product-gallery__image a img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-height: 500px !important;
  min-height: 0 !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: contain !important;
  object-position: center !important;
  padding: 14px !important;
  background: #f8fafc !important;
  border: 0 !important;
  border-radius: 18px !important;
  box-shadow: none !important;
}

body.single-product div.product div.images .flex-control-thumbs {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin: 10px 0 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

body.single-product div.product div.images .flex-control-thumbs li {
  width: auto !important;
  float: none !important;
  margin: 0 !important;
  list-style: none !important;
}

body.single-product div.product div.images .flex-control-thumbs img {
  width: 100% !important;
  height: 76px !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  padding: 6px !important;
  border: 1px solid #e7edf5 !important;
  border-radius: 12px !important;
  background: #fff !important;
}

body.single-product .product_title {
  font-size: clamp(24px, 2.4vw, 34px) !important;
  line-height: 1.35 !important;
  margin: 0 0 10px !important;
  color: var(--eps-primary) !important;
}

body.single-product .summary .price {
  margin: 8px 0 14px !important;
  font-size: 22px !important;
}

body.single-product .woocommerce-product-details__short-description,
body.single-product .summary .product_meta {
  clear: both !important;
}

body.single-product form.cart {
  width: 100% !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  align-items: stretch !important;
  border-top: 1px solid #edf2f7 !important;
  padding-top: 14px !important;
}

body.single-product form.cart .quantity {
  float: none !important;
  margin: 0 !important;
}

body.single-product form.cart .quantity .qty {
  width: 90px !important;
  height: 48px !important;
}

body.single-product .single_add_to_cart_button {
  flex: 1 1 220px !important;
  min-height: 48px !important;
  margin: 0 !important;
}

.eps-product-custom-fields {
  flex: 0 0 100% !important;
  width: 100% !important;
  margin: 14px 0 0 !important;
}

.eps-print-options-note,
.eps-vat-product-note,
.eps-product-trust,
.eps-whatsapp-product {
  width: 100% !important;
  box-sizing: border-box !important;
}

.woocommerce-tabs,
.related.products,
.upsells.products {
  width: min(1180px, 94vw) !important;
  max-width: 1180px !important;
}

@media (max-width: 980px) {
  .eps-header-inner {
    grid-template-columns: 1fr !important;
    justify-items: stretch !important;
    min-height: 0 !important;
  }

  .eps-logo {
    justify-content: center !important;
    justify-self: center !important;
  }

  .eps-search {
    width: 100% !important;
    justify-self: stretch !important;
  }

  .eps-header-actions {
    justify-content: center !important;
    flex-wrap: wrap !important;
  }

  body.single-product .woocommerce div.product,
  body.single-product div.product.product {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    padding: 14px !important;
  }

  body.single-product div.product div.images,
  body.single-product div.product div.summary {
    grid-column: auto !important;
  }

  body.single-product div.product div.images img,
  body.single-product div.product .woocommerce-product-gallery__image a img {
    max-height: 430px !important;
  }
}

@media (max-width: 560px) {
  .eps-commerce-topbar-inner,
  .eps-top-features-inner {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  .eps-action {
    font-size: 12px !important;
    padding: 8px 10px !important;
  }

  body.single-product div.product div.images .flex-control-thumbs {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  body.single-product div.product div.images img,
  body.single-product div.product .woocommerce-product-gallery__image a img {
    max-height: 330px !important;
    padding: 10px !important;
  }
}
