/* =========================================================
   Arabian Mills — Premium Product Details
   Brand: green #37835c / #2f8156 / #1b412e | gold #b79f3c
   ========================================================= */

:root {
  --am-green: #37835c;
  --am-green-dark: #2f8156;
  --am-green-deep: #1b412e;
  --am-gold: #b79f3c;
  --am-gold-soft: #decd96;
  --am-cream: #f7f4eb;
  --am-border: rgba(55, 131, 92, 0.12);
  --am-shadow: 0 10px 36px rgba(27, 65, 46, 0.08);
  --am-shadow-hover: 0 16px 44px rgba(27, 65, 46, 0.14);
  --am-radius: 16px;
  --am-radius-sm: 12px;
  --am-transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Page shell ---------- */
.am-product-page {
  background:
    radial-gradient(ellipse at top left, rgba(222, 205, 150, 0.14) 0%, transparent 42%),
    radial-gradient(ellipse at bottom right, rgba(55, 131, 92, 0.05) 0%, transparent 48%),
    #fff;
  padding-bottom: 40px;
}

.am-product-page:has(.am-related) {
  padding-bottom: 0;
}

.am-product-page .pg_inner_wrapper {
  background: transparent;
}

.am-product-hero {
  padding: 28px 0 8px;
}

.am-product-page .breadcrumbs_main_wrapper {
  background: transparent;
  padding-top: 8px;
  padding-bottom: 0;
  margin-bottom: 8px;
}

.am-product-page .bd_crumbs_list {
  margin-bottom: 0;
}

/* ---------- Sticky image card ---------- */
.am-hero-image-col {
  margin-bottom: 24px;
}

.am-product-image-card {
  position: sticky;
  top: 120px;
  background: #fff;
  border-radius: var(--am-radius);
  padding: 32px 24px;
  box-shadow: var(--am-shadow);
  border: 1px solid var(--am-border);
  text-align: center;
  overflow: hidden;
  transition: box-shadow var(--am-transition), transform var(--am-transition);
  height: auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.am-product-image-card:hover {
  box-shadow: var(--am-shadow-hover);
}

.am-product-page .prod_img_prev {
  background: transparent !important;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  position: static;
  border: none;
}

.am-product-image-link {
  display: block;
  cursor: zoom-in;
  overflow: hidden;
  border-radius: var(--am-radius-sm);
  outline: none;
}

.am-product-image-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(55, 131, 92, 0.35);
}

.am-product-image {
  display: block;
  width: 100%;
  max-width: 409px; /* ~10% less than previous 454px */
  margin: 0 auto;
  transition: transform var(--am-transition);
  will-change: transform;
}

.am-product-image-card:hover .am-product-image {
  transform: scale(1.05);
}

/* ---------- Hero content ---------- */
.am-hero-content {
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  height: auto;
}

@media (min-width: 992px) {
  .am-hero-content {
    padding-left: 20px;
  }

  [dir="rtl"] .am-hero-content {
    padding-left: 0;
    padding-right: 20px;
  }

  /* Keep image card size fixed; only right content grows */
  .am-product-page .prod_details_main_wrapper > .row {
    align-items: flex-start;
  }

  .am-hero-image-col,
  .am-product-page .prod_details_main_wrapper > .row > .col-lg-7 {
    display: block;
  }

  .am-hero-image-col .prod_img_prev {
    height: auto;
  }

  .am-product-image-card {
    flex-shrink: 0;
  }

  .am-product-tabs {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }

  .am-product-tabs .tab-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
  }

  .am-product-tabs .tab-pane.show.active {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
  }

  .am-product-tabs .tab-pane.show.active .am-tab-body,
  .am-product-tabs .tab-pane.show.active .am-nutrition-card {
    flex: 0 0 auto;
  }
}

.am-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  flex-shrink: 0;
}

.am-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  margin: 0 0 12px;
}

.am-title-row .am-product-title {
  margin: 0;
  padding-bottom: 0;
  flex: 0 1 auto;
}

.am-title-row .am-product-title::after {
  display: none;
}

.am-category-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(55, 131, 92, 0.1);
  color: var(--am-green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 0;
  min-height: 34px;
  line-height: 1;
}

.am-weight-badge {
  background: rgba(183, 159, 60, 0.14);
  color: #8a7520;
}

.am-product-title {
  font-size: clamp(1.85rem, 3vw, 2.55rem);
  font-weight: 700;
  color: var(--am-green-deep);
  line-height: 1.2;
  margin: 0 0 10px;
  padding-bottom: 10px;
  position: relative;
}

.am-product-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--am-green), var(--am-gold));
}

[dir="rtl"] .am-product-title::after {
  left: auto;
  right: 0;
}

.am-product-page .promain_title.border_line::after,
.am-product-page .promain_title.border_line::before {
  display: none !important;
}

.am-product-summary {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #4a4a4a;
  margin: 0 0 20px;
  max-width: 40rem;
}

.am-weight-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--am-cream);
  border: 1px solid var(--am-border);
  color: var(--am-green-deep);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

/* ---------- Quick fact cards ---------- */
.am-facts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}

.am-fact-card {
  background: #fff;
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius-sm);
  padding: 16px 14px;
  box-shadow: 0 4px 16px rgba(27, 65, 46, 0.04);
  transition: transform var(--am-transition), box-shadow var(--am-transition);
  min-width: 0;
}

.am-fact-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--am-shadow);
}

.am-fact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(55, 131, 92, 0.1);
  color: var(--am-green);
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.am-fact-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--am-gold);
  margin-bottom: 4px;
}

.am-fact-value {
  display: block;
  font-size: 1rem;
  font-weight: 650;
  color: var(--am-green-deep);
  line-height: 1.35;
  word-break: break-word;
}

/* Reset legacy meta styles if present */
.am-product-page .pro_metas_wrtapper,
.am-product-page .pro_cate_box {
  padding: 0;
  margin: 0;
}

.am-product-page .pro_cate_box span,
.am-product-page .pro_cate_box span:first-child {
  padding: 0;
  line-height: inherit;
  color: inherit;
  font-size: inherit;
}

/* ---------- Hero CTAs ---------- */
.am-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 0;
}

.am-hero-actions:empty {
  display: none;
}

.am-download-btn,
.am-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 12px 18px;
  border-radius: var(--am-radius-sm);
  text-decoration: none !important;
  transition: transform var(--am-transition), box-shadow var(--am-transition), background var(--am-transition), color var(--am-transition);
  border: none;
  min-height: 46px;
}

.am-download-btn {
  background: linear-gradient(135deg, var(--am-green), var(--am-green-dark));
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(55, 131, 92, 0.25);
}

.am-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(55, 131, 92, 0.32);
  color: #fff !important;
}

.am-cta-btn {
  background: #fff;
  color: var(--am-green) !important;
  border: 1.5px solid var(--am-green);
}

.am-cta-btn:hover {
  background: var(--am-green);
  color: #fff !important;
  transform: translateY(-2px);
}

.am-download-btn svg,
.am-cta-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---------- Tabs (desktop) ---------- */
.am-product-tabs {
  margin-top: 14px;
  background: #fff;
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  box-shadow: 0 6px 24px rgba(27, 65, 46, 0.04);
  overflow: hidden;
}

.am-product-tabs .nav-tabs {
  border-bottom: 1px solid rgba(183, 159, 60, 0.28);
  padding: 6px 8px 0;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, rgba(247, 244, 235, 0.85) 0%, #fff 100%);
}

.am-product-tabs .nav-tabs .nav-link {
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  color: var(--am-gold);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 14px;
  white-space: nowrap;
  background: transparent;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  line-height: 1.2;
  min-height: 36px;
}

.am-product-tabs .nav-tabs .nav-link:hover {
  color: var(--am-green);
  border-color: rgba(55, 131, 92, 0.18);
  background: rgba(55, 131, 92, 0.06);
}

.am-product-tabs .nav-tabs .nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--am-green) 0%, var(--am-green-dark) 100%);
  border-color: var(--am-green);
  box-shadow: 0 4px 12px rgba(55, 131, 92, 0.22);
}

.am-product-tabs .tab-content {
  padding: 16px 18px 18px;
}

.am-product-tabs .tab-pane.fade {
  transition: opacity 0.25s ease;
}

.am-tab-panel-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--am-green-deep);
  margin: 0 0 4px;
}

.am-tab-panel-title span[aria-hidden="true"] {
  display: none;
}

.am-tab-panel-title--spaced {
  margin-top: 28px;
}

.am-tab-body,
.am-product-page .prodDesc {
  font-size: 1.02rem;
  line-height: 1.75;
  color: #333;
  margin: 0;
  padding-top: 0 !important;
  font-weight: 400;
}

.am-tab-empty {
  color: #777;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.65;
}

/* ---------- Accordion (mobile) ---------- */
.am-product-accordion {
  margin-top: 12px;
}

.am-product-accordion .accordion-item {
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius-sm) !important;
  margin-bottom: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 14px rgba(27, 65, 46, 0.04);
}

.am-product-accordion .accordion-button {
  font-weight: 700;
  color: var(--am-gold);
  background: #fff;
  box-shadow: none;
  padding: 12px 14px;
  font-size: 0.95rem;
}

.am-product-accordion .accordion-button:not(.collapsed) {
  color: #fff;
  background: linear-gradient(135deg, var(--am-green) 0%, var(--am-green-dark) 100%);
  box-shadow: none;
}

.am-product-accordion .accordion-button:focus {
  box-shadow: none;
  border-color: var(--am-border);
}

.am-product-accordion .accordion-button::after {
  filter: none;
}

.am-product-accordion .accordion-button:not(.collapsed)::after {
  filter: brightness(0) invert(1);
}

.am-product-accordion .accordion-body {
  padding: 10px 14px 14px;
  font-size: 0.98rem;
  line-height: 1.75;
  color: #333;
}

/* ---------- Nutrition table ---------- */
.am-nutrition-card {
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius-sm);
  overflow: hidden;
  background: #fff;
}

.am-nutrition-card .table-responsive {
  margin: 0;
  max-height: none;
  overflow: visible;
}

.am-nutrition-table {
  margin: 0;
  width: 100%;
  table-layout: fixed;
}

.am-nutrition-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--am-green);
  color: #fff;
  font-weight: 400;
  font-size: 1.02rem;
  padding: 10px 14px;
  border: none;
  text-align: left;
}

[dir="rtl"] .am-nutrition-table thead th {
  text-align: right;
}

.am-nutrition-table thead th:first-child,
.am-nutrition-table tbody td:first-child {
  width: 40%;
}

.am-nutrition-table thead th:last-child,
.am-nutrition-table tbody td:last-child {
  width: 60%;
}

/* Override legacy .details_table_wrapper .table td { font-size: 18px } */
.am-product-page .details_table_wrapper.am-nutrition-card .table.am-nutrition-table tbody td,
.am-product-page .am-nutrition-table tbody td {
  padding: 10px 14px;
  font-size: 14px !important;
  font-weight: 400 !important;
  color: #333 !important;
  border-color: rgba(55, 131, 92, 0.08);
  vertical-align: middle;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.am-nutrition-table tbody tr:nth-child(odd) {
  background: #fff;
}

.am-nutrition-table tbody tr:nth-child(even) {
  background: var(--am-cream);
}

.am-product-page .details_table_wrapper.am-nutrition-card .table.am-nutrition-table tbody td:first-child,
.am-product-page .am-nutrition-table tbody td:first-child {
  font-weight: 400 !important;
  color: #333 !important;
  text-align: left;
}

.am-product-page .details_table_wrapper.am-nutrition-card .table.am-nutrition-table tbody td:last-child,
.am-product-page .am-nutrition-table tbody td:last-child {
  font-weight: 400 !important;
  color: #333 !important;
  text-align: left !important;
  white-space: normal;
}

[dir="rtl"] .am-product-page .details_table_wrapper.am-nutrition-card .table.am-nutrition-table tbody td:first-child,
[dir="rtl"] .am-product-page .am-nutrition-table tbody td:first-child,
[dir="rtl"] .am-product-page .details_table_wrapper.am-nutrition-card .table.am-nutrition-table tbody td:last-child,
[dir="rtl"] .am-product-page .am-nutrition-table tbody td:last-child {
  text-align: right !important;
}

.am-product-page .details_table_wrapper {
  padding-top: 0;
}

.am-product-page .details_table_wrapper .table-responsive {
  box-shadow: none;
  border-radius: 0;
  background: transparent;
}

.am-product-page .table_title {
  display: none;
}

/* ---------- Related products (listing-style grid) ---------- */
.am-related {
  margin-top: 56px;
  padding-top: 40px;
  padding-bottom: 48px;
  border-top: 1px solid rgba(55, 131, 92, 0.1);
}

.am-related__header {
  text-align: center;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.am-related__title {
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  font-weight: 700;
  color: var(--am-green-deep);
  margin: 0;
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}

.am-related__title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--am-green), var(--am-gold));
}

.am-related__nav {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.am-related__arrow {
  width: 40px;
  height: 40px;
  border: 1px solid var(--am-green);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--am-green) 0%, var(--am-green-dark) 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(55, 131, 92, 0.22);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.am-related__arrow svg {
  width: 18px;
  height: 18px;
  display: block;
}

.am-related__arrow:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--am-green-dark) 0%, var(--am-green-deep) 100%);
  color: #fff;
  border-color: var(--am-green-dark);
  box-shadow: 0 6px 16px rgba(55, 131, 92, 0.3);
}

.am-related__arrow:disabled,
.am-related__arrow.swiper-button-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

[dir="rtl"] .am-related__arrow svg {
  transform: scaleX(-1);
}

.am-related-swiper {
  width: 100%;
  overflow: hidden;
}

.am-related-swiper .swiper-slide {
  height: auto;
}

.am-related .pro_listing_inner_wrapper {
  max-width: 100%;
  width: 100%;
  margin: 0;
}

/* Desktop/tablet: 5-up grid via Swiper breakpoints handled in JS;
   fallback layout if Swiper not ready */
.am-related-swiper .swiper-wrapper {
  display: flex;
}

.am-related .am-related-col,
.am-related-swiper .swiper-slide {
  padding-left: 8px;
  padding-right: 8px;
}

.am-related .card-image-wrapper {
  height: 320px;
}

.am-related .weight-badge {
  font-size: 0.72rem;
  padding: 4px 10px;
}

.am-related .btn-view-details {
  font-size: 0.82rem;
  padding: 8px 14px;
}

/* ---------- Lightbox ---------- */
.am-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(27, 65, 46, 0.72);
  backdrop-filter: blur(4px);
}

.am-lightbox.is-open {
  display: flex;
}

.am-lightbox__inner {
  position: relative;
  max-width: min(720px, 92vw);
  max-height: 88vh;
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: amLightboxIn 0.28s ease;
}

.am-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: calc(88vh - 56px);
  margin: 0 auto;
}

.am-lightbox__close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--am-green);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

[dir="rtl"] .am-lightbox__close {
  right: auto;
  left: -12px;
}

@keyframes amLightboxIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

body.am-lightbox-open {
  overflow: hidden;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .am-product-image-card {
    position: static;
    min-height: 0;
    height: auto;
    padding: 24px 18px;
  }

  .am-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .am-related .card-image-wrapper {
    height: 280px;
  }
}

@media (max-width: 767px) {
  .am-product-page {
    padding-bottom: 24px;
  }

  /* Side spacing for overall content */
  .am-product-page .am-product-hero.container,
  .am-product-page .container.am-product-hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  .am-product-hero {
    padding-top: 16px;
  }

  .am-hero-actions {
    flex-direction: column;
  }

  .am-download-btn,
  .am-cta-btn {
    width: 100%;
  }

  /* Mobile tabs: same desktop style, both on one line */
  .am-product-tabs .nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: hidden;
    gap: 4px;
    padding: 6px 6px 0;
  }

  .am-product-tabs .nav-tabs .nav-item {
    flex: 1 1 0;
    min-width: 0;
  }

  .am-product-tabs .nav-tabs .nav-link {
    width: 100%;
    text-align: center;
    padding: 10px 8px;
    font-size: 0.86rem;
    min-height: 40px;
  }

  .am-product-tabs .tab-content {
    padding: 14px 12px 16px;
  }

  .am-related {
    margin-top: 40px;
    padding-top: 28px;
    padding-bottom: 32px;
  }

  .am-related__header {
    margin-bottom: 18px;
    gap: 12px;
  }

  .am-related__nav {
    display: flex;
  }

  .am-related-swiper {
    overflow: visible;
    margin: 0 auto;
    max-width: 100%;
  }

  .am-related-swiper .swiper-wrapper {
    align-items: stretch;
  }

  .am-related-swiper .swiper-slide {
    padding-left: 0;
    padding-right: 0;
    height: auto;
    display: flex;
  }

  .am-related-swiper .modern-product-card {
    width: 100%;
  }

  .am-related .card-image-wrapper {
    height: 220px;
  }

  .am-related .card-title {
    font-size: 0.85rem;
  }

  .am-related .btn-view-details {
    font-size: 0.75rem;
    padding: 6px 10px;
  }
}

@media (max-width: 575px) {
  .am-product-page .am-product-hero.container,
  .am-product-page .container.am-product-hero {
    padding-left: 14px;
    padding-right: 14px;
  }

  .am-product-tabs .nav-tabs .nav-link {
    padding: 10px 6px;
    font-size: 0.82rem;
  }

  .am-related .card-image-wrapper {
    height: 200px;
  }
}
