/* ===============================
   Funkenwelt Shop Page Styles (Rose-Gold Glow Edition)
   + Layout fixes (footer + product grid)
   + Enhancements: aspect-ratio, focus styles, "New" badge
   =============================== */

/* -------------------------
   Layout fixes (must be first)
   ------------------------- */

/* Ensure html/body full height */
html, body {
  height: 100%;
}

/* Ensure body & main layout won't push footer into middle of page */
body.woocommerce-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-attachment: fixed;
  font-family: 'Inter', sans-serif;
  color: var(--cream, #FFF8EC);
}

/* Make main content flexible so footer is pushed to bottom naturally.
   Include many common wrapper names to support different themes. */
#page, .site, .site-wrapper, .site-container, .site-inner, .wrapper,
main#main, main.site-main, main#content, .site-main, .site-content, .content-area, #primary {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  z-index: 1;
  width: 100%;
}

/* Ensure footer participates in normal flow and sits above background */
/* Ensure footer participates in normal flow and sits above background */
.site-footer,
footer.site-footer,
.footer {
  position: relative !important;
  z-index: 3 !important;
  /* Allow flexbox to push footer to the bottom when content is short */
  margin-top: auto !important;
  background: rgba(20,10,8,0.6);
  color: rgba(255,248,236,0.85);
  border-top: 1px solid rgba(255,248,236,0.06);
  padding: 1rem 1.5rem;
  text-align: center;
}


/* Ensure product grid is a true grid and items align to top */
.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  gap: 24px !important;
  list-style: none;
  padding: 40px 20px;
  margin: 0 auto;
  align-items: start;
  justify-items: center;
  width: min(1200px, 96%);
  position: relative;
  z-index: 1;
}

/* Product items should be in normal flow, not absolutely positioned */
.woocommerce ul.products li.product {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: auto !important;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  overflow: visible;
}

/* Make image/link elements fill card width and use stable aspect ratio */
.woocommerce ul.products li.product .product-thumbnail,
.woocommerce ul.products li.product .product-link,
.woocommerce ul.products li.product img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  object-fit: cover;
  aspect-ratio: 3 / 4; /* stable cover ratio for all product images */
  border-radius: 0.9rem;
}

/* Ensure title/price/buttons sit above background layers */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .price,
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .woocommerce-loop-product__title a {
  z-index: 3;
}

/* -------------------------
   Funkenwelt Shop Styles
   ------------------------- */

/* Imports */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;700&family=Inter:wght@300;400;600&display=swap');

:root {
  --gold: #E6C27A;
  --rose: #C18A6E;
  --cream: #FFF8EC;
  --brown: #3E1E1A;
  --bg-dark: #140E0C;
  --peach: #F3D1B0;
}

/* ===== Reset ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Page base for WooCommerce */
body.woocommerce-page {
  background: radial-gradient(circle at center, rgba(248,213,126,0.12), rgba(20,10,8,0.92) 90%);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== Background Aurora Effect ===== */
body.woocommerce-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(
      80% 60% at 20% 30%,
      rgba(230,194,122,0.18),
      transparent
    ),
    radial-gradient(
      80% 60% at 80% 70%,
      rgba(193,138,110,0.18),
      transparent
    );
  animation: auroraMove 18s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

@keyframes auroraMove {
  0% { background-position: 0% 50%, 100% 50%; }
  50% { background-position: 100% 20%, 0% 80%; }
  100% { background-position: 50% 100%, 50% 0%; }
}

/* ===== Product Grid Card Styles ===== */
.woocommerce ul.products li.product {
  background: radial-gradient(
      circle at top center,
      rgba(230,194,122,0.05),
      rgba(193,138,110,0.08),
      rgba(20,10,8,0.85)
    );
  border: 1px solid rgba(230,194,122,0.22);
  box-shadow:
    0 6px 25px rgba(20,10,8,0.8),
    0 0 40px rgba(193,138,110,0.1),
    inset 0 0 20px rgba(230,194,122,0.04);
  border-radius: 1.3rem;
  padding: 1.5rem;
  text-align: center;
  transition: transform .35s ease, box-shadow .35s ease;
  position: relative;
  overflow: hidden;
}

/* Animated shimmer edge */
.woocommerce ul.products li.product::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    rgba(230,194,122,0.15),
    rgba(193,138,110,0.35),
    rgba(230,194,122,0.15)
  );
  background-size: 300% 300%;
  z-index: -1;
  animation: shimmerEdge 10s ease-in-out infinite alternate;
}

/* Hover lift */
.woocommerce ul.products li.product:hover {
  transform: translateY(-8px);
  box-shadow:
    0 12px 35px rgba(20,10,8,0.9),
    0 0 60px rgba(230,194,122,0.25);
}

/* ===== Product Title ===== */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0.6rem 0 0.8rem;
  background: linear-gradient(90deg, var(--gold), var(--rose), var(--peach));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: .6px;
}

/* Title link fallback */
.woocommerce ul.products li.product .woocommerce-loop-product__title a {
  color: inherit !important;
  text-decoration: none;
  display: block;
}

/* ===== Product Price ===== */
.woocommerce ul.products li.product .price {
  display: inline-block;
  background: rgba(255,248,236,0.08);
  border: 1px solid rgba(230,194,122,0.25);
  padding: 0.6rem 1.2rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 1rem;
  transition: background .3s ease;
}

.woocommerce ul.products li.product .price:hover {
  background: rgba(230,194,122,0.12);
}

/* Force price color in more specific places */
.woocommerce ul.products li.product .woocommerce-Price-amount,
.woocommerce ul.products li.product .woocommerce-Price-currencySymbol,
.woocommerce ul.products li.product .woocommerce-Price-amount bdi {
  color: var(--gold) !important;
}

/* ===== Add to Cart Button ===== */
.woocommerce ul.products li.product .button.add_to_cart_button,
.woocommerce ul.products li.product .button {
  background: linear-gradient(90deg, var(--rose), var(--gold));
  color: #fffaf3 !important;
  border-radius: 2rem;
  padding: 0.75rem 1.6rem;
  font-weight: 700;
  text-transform: uppercase;
  border: none;
  transition: transform .25s ease, box-shadow .25s ease;
  display: inline-block;
  margin-top: 0.6rem;
  box-shadow: 0 6px 18px rgba(20,10,8,0.45);
}

/* Focus-visible (accessibility) */
.woocommerce ul.products li.product .button:focus-visible,
.woocommerce ul.products li.product .button.add_to_cart_button:focus-visible {
  outline: 3px solid rgba(230,194,122,0.35);
  outline-offset: 4px;
  box-shadow: 0 0 30px rgba(230,194,122,0.28);
  transform: translateY(-2px);
}

.woocommerce ul.products li.product .button.add_to_cart_button:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 30px rgba(230,194,122,0.38);
}

/* ===== "New" Badge (add markup or use PHP to inject) =====
   HTML example to place inside the product loop:
   <span class="product-badge product-badge-new">New</span>
*/
.woocommerce ul.products li.product .product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(90deg, rgba(193,138,110,1), rgba(230,194,122,1));
  color: #fffaf3;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: .08em;
  box-shadow: 0 8px 18px rgba(20,10,8,0.5);
  z-index: 5;
  text-transform: uppercase;
}

/* ===== Single Product Page ===== */
.woocommerce div.product .summary {
  background: radial-gradient(
      circle at top center,
      rgba(230,194,122,0.05),
      rgba(193,138,110,0.08),
      rgba(20,10,8,0.85)
    );
  border: 1px solid rgba(230,194,122,0.22);
  border-radius: 1rem;
  padding: 2rem;
  color: var(--cream);
  margin-top: 2rem;
  text-align: center;
  box-shadow:
    0 8px 30px rgba(20,10,8,0.9),
    0 0 50px rgba(230,194,122,0.15);
}

.woocommerce div.product .summary .product_title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  background: linear-gradient(90deg, var(--gold), var(--rose), var(--peach));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.woocommerce div.product .summary .price {
  font-weight: bold;
  color: var(--gold);
  background: rgba(255,248,236,0.08);
  border: 1px solid rgba(230,194,122,0.25);
  padding: 0.8rem 1.5rem;
  border-radius: 0.5rem;
  display: inline-block;
  margin-bottom: 1.5rem;
}

/* ===== Single Product Add to Cart ===== */
.woocommerce div.product .summary .single_add_to_cart_button {
  background: linear-gradient(90deg, var(--rose), var(--gold));
  color: #fffaf3;
  border-radius: 2rem;
  padding: 0.9rem 2rem;
  font-weight: 700;
  text-transform: uppercase;
  transition: all .3s ease;
}

.woocommerce div.product .summary .single_add_to_cart_button:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(230,194,122,0.45);
}

/* ===== Small utility helpers ===== */
.woocommerce .product .excerpt { color: rgba(255,248,236,0.86); margin-top: .6rem; }
.woocommerce ul.products li.product .meta { color: rgba(255,248,236,0.65); font-size: .88rem; margin-top: .4rem; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .woocommerce ul.products {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    padding: 28px 16px;
    gap: 18px;
  }

  .woocommerce div.product .summary {
    padding: 1.5rem;
  }

  .woocommerce ul.products li.product {
    min-height: auto;
  }
}

@media (max-width: 480px) {
  .woocommerce ul.products {
    grid-template-columns: 1fr !important;
    padding: 20px 12px;
    gap: 14px;
  }
}

/* ===== Fix for Shop: force header offset and footer behavior =====
   Paste this at the end of shop.css to override conflicting theme rules.
   It ensures main gets top padding and footer stays at bottom on shop page.
   ===== */

/* fallback header height variable */
:root {
  --header-height: 74px; /* عدّل هذا إن لزم */
}

/* ensure header is fixed on shop page (override only if needed) */
body.woocommerce-page header.site-header,
body.woocommerce-page .site-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 10000 !important;
}

/* Make sure the site/page wrappers are full-height flex column */
body.woocommerce-page,
body.woocommerce-page .site,
body.woocommerce-page #page {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
  justify-content: flex-start !important;
}

/* Ensure main content is flexible and gets top padding to avoid being hidden under header */
body.woocommerce-page main,
body.woocommerce-page .site-main,
body.woocommerce-page .content,
body.woocommerce-page #content,
body.woocommerce-page .page-wrapper {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  /* IMPORTANT: force padding so content is visible under fixed header */
  padding-top: calc(var(--header-height) + 12px) !important;
}

/* Ensure footer participates and sits at bottom */
body.woocommerce-page .site-footer,
body.woocommerce-page footer.site-footer,
body.woocommerce-page .footer {
  margin-top: auto !important;
  position: relative !important;
  z-index: 3 !important;
  width: 100% !important;
}

/* Remove stray whitespace from any last-child margins before footer */
body.woocommerce-page .site-main > *:last-child,
body.woocommerce-page .content > *:last-child {
  margin-bottom: 0 !important;
}
