/*
Theme Name: Astra Child
Theme URI: https://wpastra.com/
Template: astra
Author: Brainstorm Force
Author URI: https://wpastra.com/about/?utm_source=theme_preview&utm_medium=author_link&utm_campaign=astra_theme
Description: Astra child theme for Micron KSA store customizations.
Version: 1.0.0
*/

/* Micron: shared WooCommerce visual identity */
.woocommerce-shop .site-content,
.post-type-archive-product .site-content,
.tax-product_cat .site-content,
.single-product .site-content,
.page-id-5 .site-content {
  background: linear-gradient(180deg, #eaf7ff 0%, #f8fcff 48%, #eaf7ff 100%);
}

/* Micron: store navigation */
.micron-store-nav {
  max-width: 1240px;
  margin: 24px auto 0;
  padding: 0 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  align-items: center;
  direction: rtl;
  clear: both;
}

.micron-store-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #0f172a;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.micron-store-nav a:hover {
  background: #2563eb;
  color: #fff;
}

.micron-store-nav span {
  font-size: 18px;
  line-height: 1;
}

/* Micron: shop and category headers */
.woocommerce-shop .woocommerce-products-header,
.post-type-archive-product .woocommerce-products-header,
.tax-product_cat .woocommerce-products-header,
.page-id-5 .entry-header {
  max-width: 1240px;
  margin: 28px auto 34px;
  padding: 34px 28px;
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  text-align: right;
}

.woocommerce-shop .woocommerce-products-header__title.page-title,
.post-type-archive-product .woocommerce-products-header__title.page-title,
.tax-product_cat .woocommerce-products-header__title.page-title,
.page-id-5 .entry-title {
  font-size: 44px;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 12px;
}

.woocommerce-shop .woocommerce-products-header::after,
.post-type-archive-product .woocommerce-products-header::after,
.tax-product_cat .woocommerce-products-header::after,
.page-id-5 .entry-header::after {
  content: "أدوات رقمية وتجارب ذكية مختارة بعناية";
  display: block;
  color: #475569;
  font-size: 18px;
  line-height: 1.8;
}

.term-description {
  max-width: 720px;
  color: #475569;
  font-size: 18px;
  line-height: 1.8;
}

/* Micron: product archive layout */
.woocommerce-shop .ast-woocommerce-container,
.post-type-archive-product .ast-woocommerce-container,
.tax-product_cat .ast-woocommerce-container,
.page-id-5 .entry-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px 56px;
}

.woocommerce .woocommerce-result-count,
.woocommerce-page .woocommerce-result-count {
  color: #475569;
  font-size: 15px;
}

.woocommerce .woocommerce-ordering select {
  border: 1px solid #dbeafe;
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  color: #334155;
}

/* Micron: product cards */
.woocommerce ul.products {
  gap: 28px !important;
}

.woocommerce ul.products li.product {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  transition: 0.2s ease;
}

.woocommerce ul.products li.product:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap {
  aspect-ratio: 1 / 1;
  width: 100%;
  min-height: 240px;
  max-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 16px;
  padding: 14px;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap a {
  width: 100%;
  height: 100%;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap img.attachment-woocommerce_thumbnail {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  object-position: center;
  display: block;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap img.emoji {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  display: inline-block !important;
  vertical-align: -2px;
}

.woocommerce ul.products li.product .astra-shop-summary-wrap {
  flex: 1;
  padding-top: 10px;
}

.woocommerce ul.products li.product .ast-woo-product-category {
  color: #64748b;
  font-size: 13px;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  min-height: 48px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
  color: #0f172a;
}

.woocommerce ul.products li.product > a[style*="background:#2563eb"] {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-radius: 14px !important;
  padding: 13px 16px !important;
  font-size: 16px !important;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
  transition: 0.2s ease;
}

.woocommerce ul.products li.product > a[style*="background:#2563eb"]:hover {
  transform: translateY(-2px);
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap div[style*="linear-gradient"] {
  top: 12px !important;
  left: 12px !important;
  padding: 6px 10px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  transform: scale(0.9);
  transform-origin: top left;
}

/* Micron: single product */
.single-product div.product {
  max-width: 1180px;
  margin: 34px auto 56px;
  padding: 32px;
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.single-product .woocommerce-product-gallery {
  max-width: 430px !important;
  width: 42% !important;
}

.single-product .woocommerce-product-gallery .flex-viewport,
.single-product .woocommerce-product-gallery .woocommerce-product-gallery__wrapper,
.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image,
.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image a {
  height: 520px !important;
  max-height: 520px !important;
}

.single-product .woocommerce-product-gallery .flex-viewport {
  overflow: hidden !important;
}

.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image img {
  height: 100% !important;
  width: auto !important;
  max-width: 100% !important;
  object-fit: contain !important;
  margin: 0 auto !important;
}

.single-product .flex-control-thumbs {
  margin-top: 16px !important;
}

.single-product div.product .summary {
  padding: 20px 10px !important;
}

.single-product .product_title {
  font-size: 30px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 14px;
}

.single-product .woocommerce-product-details__short-description {
  font-size: 18px;
  line-height: 1.8;
  color: #334155;
}

.single-product .single_add_to_cart_button {
  background: #2563eb !important;
  color: #fff !important;
  border-radius: 12px !important;
  padding: 14px 28px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
}

.single-product .related.products {
  max-width: 1180px;
  margin: 36px auto 56px;
}

.single-product .related.products > h2 {
  font-size: 28px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 22px;
}

/* Micron: home page */
.home .site-content,
.home.ast-plain-container {
  background: #e7f6ff !important;
}

.home .entry-content {
  direction: rtl;
}

.home .entry-content > .wp-block-cover:first-child {
  min-height: 560px !important;
  padding-top: 90px !important;
  padding-bottom: 70px !important;
}

.home .entry-content > .wp-block-cover:first-child .wp-block-cover__inner-container {
  max-width: 1200px;
  margin: 0 auto;
}

.home .entry-content > .wp-block-cover:first-child .wp-block-media-text {
  align-items: center;
  gap: 48px;
}

.home .entry-content > .wp-block-cover:first-child .wp-block-media-text__content {
  padding: 0 !important;
}

.home .entry-content > .wp-block-cover:first-child h1 {
  max-width: 620px;
  margin: 0 0 18px;
  color: #fff !important;
  font-size: 42px;
  font-weight: 900;
  line-height: 1.35;
  text-align: right !important;
}

.home .entry-content > .wp-block-cover:first-child p {
  color: #fff !important;
  font-size: 17px;
  line-height: 1.9;
  text-align: right;
}

.home .entry-content > .wp-block-cover:first-child .wp-block-separator {
  max-width: 620px;
  margin: 22px 0;
  opacity: 0.65;
}

.home .entry-content > .wp-block-cover:first-child .wp-block-buttons {
  justify-content: flex-start;
}

.home .entry-content > .wp-block-cover:first-child .wp-block-button__link,
.home #contact .wp-block-button__link {
  background: #fff !important;
  color: #160b4f !important;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.home .entry-content > .wp-block-cover:first-child .wp-block-media-text__media img {
  max-height: 360px;
  width: auto;
  object-fit: contain;
}

/* Micron: home feature strip */
.home .entry-content > .wp-block-group:nth-of-type(1) {
  padding-top: 38px !important;
  padding-bottom: 38px !important;
}

.home .entry-content > .wp-block-group:nth-of-type(1) .wp-block-columns {
  gap: 18px !important;
  align-items: stretch !important;
}

.home .entry-content > .wp-block-group:nth-of-type(1) .wp-block-column {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #dbeafe;
  border-radius: 18px;
  padding: 22px 18px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
  text-align: center;
}

.home .entry-content > .wp-block-group:nth-of-type(1) figure {
  margin-bottom: 12px;
}

.home .entry-content > .wp-block-group:nth-of-type(1) img {
  width: 46px !important;
  height: 46px !important;
  object-fit: contain;
}

.home .entry-content > .wp-block-group:nth-of-type(1) h4 {
  margin-top: 8px !important;
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.35;
  text-align: center !important;
  color: #0f172a;
}

.home .entry-content > .wp-block-group:nth-of-type(1) p {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.8;
  text-align: center !important;
  color: #475569;
}

/* Micron: home sections */
.home #services,
.home #about,
.home #whyus {
  padding-top: 58px !important;
  padding-bottom: 90px !important;
}

.home #services h2,
.home #whyus h2 {
  font-size: 36px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 34px;
}

.home #services .wp-block-column,
.home #whyus .wp-block-column {
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.home #services img {
  border-radius: 16px;
}

.home #about .wp-block-media-text {
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.home #about .wp-block-media-text__content,
.home #about h2,
.home #about p {
  max-width: 560px;
}

.home #about .wp-block-group,
.home #about h2 {
  padding-right: 0 !important;
}

.home #about h2 {
  margin-bottom: 18px;
  font-size: 32px !important;
  font-weight: 900;
  line-height: 1.45 !important;
  text-align: right !important;
}

.home #about p {
  font-size: 17px !important;
}

.home #about img {
  border-radius: 18px;
}

/* Micron: home statement */
.home #reviews {
  padding: 70px 20px !important;
}

.home #reviews figure {
  margin-bottom: 26px;
}

.home #reviews img {
  max-width: 140px !important;
  height: auto !important;
}

.home #reviews p:first-of-type {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  font-size: 22px !important;
  line-height: 1.9 !important;
}

.home #reviews p:last-child {
  margin-top: 26px;
  font-size: 20px !important;
  letter-spacing: 0;
  color: #0f172a;
  text-align: center !important;
}

/* Micron: justified text rhythm on home */
.home .entry-content p,
.home .entry-content li {
  max-width: 760px;
  line-height: 1.95 !important;
  word-spacing: 1px;
}

.home .entry-content p:not(.has-text-align-center),
.home .entry-content li {
  text-align: justify !important;
  text-align-last: right;
}

.home .entry-content p.has-text-align-center {
  margin-left: auto;
  margin-right: auto;
  text-align: justify !important;
  text-align-last: center;
}

.home h1,
.home h2,
.home h3,
.home h4,
.home nav,
.home .main-header-menu,
.home .wp-block-button__link {
  text-align: initial !important;
  word-spacing: normal;
}

/* Micron: home CTA */
.home #contact {
  padding-top: 80px !important;
  padding-bottom: 80px !important;
}

/* Micron: mobile */
@media (max-width: 768px) {
  .micron-store-nav {
    margin-top: 14px;
    padding: 0 14px;
    overflow-x: auto;
  }

  .micron-store-nav a {
    white-space: nowrap;
    padding: 9px 12px;
  }

  .woocommerce-shop .woocommerce-products-header,
  .post-type-archive-product .woocommerce-products-header,
  .tax-product_cat .woocommerce-products-header,
  .page-id-5 .entry-header {
    margin: 16px 14px 24px;
    padding: 24px 18px;
    border-radius: 18px;
  }

  .woocommerce-shop .woocommerce-products-header__title.page-title,
  .post-type-archive-product .woocommerce-products-header__title.page-title,
  .tax-product_cat .woocommerce-products-header__title.page-title,
  .page-id-5 .entry-title {
    font-size: 32px;
  }

  .woocommerce-shop .ast-woocommerce-container,
  .post-type-archive-product .ast-woocommerce-container,
  .tax-product_cat .ast-woocommerce-container,
  .page-id-5 .entry-content {
    padding: 0 14px 42px;
  }

  .woocommerce ul.products li.product .astra-shop-thumbnail-wrap {
    min-height: 190px;
    max-height: 220px;
    padding: 10px;
  }

  .woocommerce ul.products li.product .woocommerce-loop-product__title {
    min-height: auto;
    font-size: 16px;
  }

  .single-product div.product {
    margin: 16px 14px 42px;
    padding: 18px;
    border-radius: 18px;
  }

  .single-product .woocommerce-product-gallery {
    width: 100% !important;
    max-width: 100% !important;
  }

  .single-product .woocommerce-product-gallery .flex-viewport,
  .single-product .woocommerce-product-gallery .woocommerce-product-gallery__wrapper,
  .single-product .woocommerce-product-gallery .woocommerce-product-gallery__image,
  .single-product .woocommerce-product-gallery .woocommerce-product-gallery__image a {
    height: 420px !important;
    max-height: 420px !important;
  }

  .single-product .product_title {
    font-size: 24px;
  }

  .home .entry-content > .wp-block-cover:first-child {
    min-height: auto !important;
    padding-top: 120px !important;
    padding-bottom: 60px !important;
  }

  .home .entry-content > .wp-block-cover:first-child h1,
  .home .entry-content > .wp-block-cover:first-child p {
    text-align: center !important;
  }

  .home .entry-content > .wp-block-cover:first-child .wp-block-buttons {
    justify-content: center;
  }

  .home .entry-content > .wp-block-cover:first-child .wp-block-media-text__media img {
    max-height: 260px;
  }

  .home .entry-content > .wp-block-group:nth-of-type(1),
  .home #services,
  .home #about,
  .home #whyus {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }

  .home #services h2,
  .home #whyus h2,
  .home #about h2 {
    font-size: 26px !important;
  }

  .home #about .wp-block-media-text {
    padding: 18px;
  }

  .home #reviews p:first-of-type {
    font-size: 18px !important;
  }

  /* التعديل الجديد لتنسيق الكروت تحت بعضها وحجم الأزرار على الجوال */
  .woocommerce ul.products[class*="columns-"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
  }
  .woocommerce ul.products li.product {
    width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .woocommerce ul.products li.product > a[style*="background:#2563eb"] {
    padding: 10px 14px !important;
    font-size: 15px !important;
    width: auto !important;
    align-self: center !important;
    min-width: 180px;
    text-align: center !important;
  }
}