/**
 * Theme rules for markup without a source equivalent, plus functional state.
 * Visual styling for source markup comes from assets/css/app.css.
 */

/* ------------------------------------------------------------------
 * Hidden attribute must win over any display utility.
 * ------------------------------------------------------------------ */
[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------
 * WordPress admin bar — keep the sticky header below it.
 * ------------------------------------------------------------------ */
body.admin-bar .site-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

/* ------------------------------------------------------------------
 * Pointer cursor on interactive controls.
 * ------------------------------------------------------------------ */
a[href],
button:not(:disabled):not([disabled]),
[role="button"]:not([aria-disabled="true"]),
input[type="submit"]:not(:disabled),
input[type="button"]:not(:disabled),
input[type="reset"]:not(:disabled),
label[for],
summary,
select,
.theme-attr-pill,
.theme-product-thumb,
.theme-header-cart,
.theme-mobile-toggle,
[data-cart-open],
[data-cart-close],
[data-qty-increase],
[data-qty-decrease],
[data-remove-item],
[data-empty-cart],
[data-filter-cat],
.ajax_add_to_cart,
.single_add_to_cart_button:not(:disabled):not(.disabled) {
  cursor: pointer;
}

/* ------------------------------------------------------------------
 * Scroll reveals (fadeUp variants from the design).
 * ------------------------------------------------------------------ */
.reveal-item {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.4, 0.25, 1), transform 0.7s cubic-bezier(0.25, 0.4, 0.25, 1);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}

.reveal-item.is-visible {
  opacity: 1;
  transform: none;
}

/* Customizer preview, reduced motion and no-JS all resolve visible. */
.is-customizer .reveal-item,
.no-js .reveal-item {
  opacity: 1 !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ------------------------------------------------------------------
 * Hero — the source animates the artwork and staggers the copy.
 * ------------------------------------------------------------------ */
.hero-kenburns {
  animation: theme-kenburns 24s ease-in-out infinite;
  transform-origin: center;
}

@keyframes theme-kenburns {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.hero-veil {
  background: linear-gradient(
    135deg,
    hsl(var(--foreground) / 0.38) 0%,
    hsl(var(--primary) / 0.24) 55%,
    hsl(var(--foreground) / 0.34) 100%
  );
}

.hero-fade {
  animation: theme-fade-in 1.1s cubic-bezier(0.25, 0.4, 0.25, 1) forwards;
}

.hero-enter {
  opacity: 0;
  animation: theme-hero-enter 1s cubic-bezier(0.25, 0.4, 0.25, 1) forwards;
}

.hero-enter--title {
  --hero-y: 22px;
  animation-duration: 1s;
  animation-delay: 0.5s;
}

.hero-enter--sub {
  --hero-y: 14px;
  animation-duration: 0.8s;
  animation-delay: 0.75s;
}

.hero-enter--cta {
  --hero-y: 14px;
  animation-duration: 0.7s;
  animation-delay: 0.95s;
}

@keyframes theme-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes theme-hero-enter {
  from {
    opacity: 0;
    transform: translateY(var(--hero-y, 14px));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-kenburns,
  .hero-fade,
  .hero-enter {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Decorative layer of the About / Theory sections. */
.theme-section__decor {
  opacity: 0;
  transition: opacity 1.4s cubic-bezier(0.25, 0.4, 0.25, 1);
}

.theme-section.is-visible .theme-section__decor,
.is-customizer .theme-section__decor,
.no-js .theme-section__decor {
  opacity: 1;
}

/* ------------------------------------------------------------------
 * Meet Mary portrait treatment (inline styles in the source).
 * ------------------------------------------------------------------ */
.founder-glow {
  background:
    radial-gradient(circle at 30% 25%, hsl(var(--teal) / 0.28), transparent 60%),
    radial-gradient(circle at 70% 80%, hsl(var(--marigold) / 0.28), transparent 65%);
}

.founder-arch {
  border-radius: 46% 46% 44% 44% / 28% 28% 30% 30%;
}

/* ------------------------------------------------------------------
 * FAQ accordion chevron state.
 * ------------------------------------------------------------------ */
.theme-accordion__icon {
  display: inline-flex;
}

.theme-accordion__icon.rotate-180 {
  transform: rotate(180deg);
}

/* ------------------------------------------------------------------
 * Product cards: the image link needs block layout (no inline gap).
 * Match Lovable: aspect crop via object-cover, no extra zoom.
 * ------------------------------------------------------------------ */
.theme-product-card__image-link {
  display: block;
  overflow: hidden;
}

.theme-product-card__image-link img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
}

.theme-product-card .theme-stock-badge {
  pointer-events: none;
}

/* Card CTA: keep Lovable default (readable before hover). */
.theme-product-card__cta {
  background-color: transparent !important;
  color: hsl(var(--foreground)) !important;
  border-color: hsl(var(--primary) / 0.25) !important;
}

.theme-product-card__cta:hover {
  background-color: hsl(var(--powder) / 0.6) !important;
  color: hsl(var(--foreground)) !important;
}

/* ------------------------------------------------------------------
 * Single product gallery — fill the 4/3 frame without over-zoom.
 * ------------------------------------------------------------------ */
.theme-product-main {
  display: block;
  aspect-ratio: 4 / 3;
}

.theme-product-main img,
.theme-product-main__image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.theme-product-thumb {
  display: block;
  padding: 0;
  background: none;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.theme-product-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ------------------------------------------------------------------
 * Variation pills + native select handling.
 * ------------------------------------------------------------------ */
.theme-attr-select-hidden {
  display: none !important;
}

.single-product .variations.shop_attributes tbody,
.single-product .variations tbody tr,
.single-product .variations tbody td,
.woocommerce-page .variations tbody,
.woocommerce-page .variations tbody tr,
.woocommerce-page .variations tbody td,
.theme-product-page .variations tbody,
.theme-product-page .variations tbody tr,
.theme-product-page .variations tbody td {
  display: block;
  width: 100%;
}

.theme-product-page .variations {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  padding: 0;
}

.theme-product-page .variations tbody td.label,
.theme-product-page .variations td.label {
  display: none;
  padding: 0;
}

.theme-product-page .variations tbody td.value,
.theme-product-page .variations td.value {
  padding: 0;
}

.theme-product-page .variations select {
  width: 100%;
}

.theme-attr-pill.is-active {
  border-color: hsl(var(--primary));
}

/* ------------------------------------------------------------------
 * Add-to-cart: disabled + loading states (Section 11.4.1 / 31.8).
 * ------------------------------------------------------------------ */
.single_add_to_cart_button.button:disabled,
.single_add_to_cart_button.button.disabled,
.add_to_cart_button.button:disabled,
.add_to_cart_button.button.disabled,
.single_add_to_cart_button:disabled,
.single_add_to_cart_button.disabled {
  cursor: not-allowed !important;
  opacity: 0.4 !important;
  pointer-events: none !important;
}

.single_add_to_cart_button.button:disabled:hover,
.single_add_to_cart_button.button.disabled:hover,
.add_to_cart_button.button:disabled:hover,
.add_to_cart_button.button.disabled:hover,
.single_add_to_cart_button.disabled:hover {
  opacity: 0.4 !important;
}

.ajax_add_to_cart.theme-btn-loading {
  opacity: 0.6 !important;
  pointer-events: none !important;
  cursor: wait !important;
}

.single-product .single_add_to_cart_button.loading::after,
.ajax_add_to_cart.loading::after {
  display: none !important;
}

/* Hide the "View cart" link WooCommerce appends after an AJAX add. */
.woocommerce-page a.added_to_cart.wc-forward,
.single-product a.added_to_cart.wc-forward,
body a.added_to_cart.wc-forward {
  display: none !important;
}

/* ------------------------------------------------------------------
 * Side cart drawer + overlay.
 * Overlay stays under the drawer so backdrop blur never covers it.
 * ------------------------------------------------------------------ */
#theme-cart-drawer {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.4, 0.25, 1);
  will-change: transform;
  pointer-events: none;
  z-index: 50;
}

body.cart-open #theme-cart-drawer {
  transform: translateX(0);
  pointer-events: auto;
}

#theme-cart-overlay[hidden] {
  display: none !important;
}

#theme-cart-overlay {
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.25, 0.4, 0.25, 1);
  pointer-events: none;
  z-index: 40;
}

body.cart-open #theme-cart-overlay {
  opacity: 1;
  pointer-events: auto;
}

#theme-cart-drawer.is-updating > * {
  opacity: 0.6;
  pointer-events: none;
}

#theme-cart-drawer .woocommerce-message {
  display: none;
}

.theme-cart-count:empty {
  display: none;
}

/* ------------------------------------------------------------------
 * WooCommerce notices (styled where they must stay visible).
 * ------------------------------------------------------------------ */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid hsl(var(--border));
  border-left-width: 4px;
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.woocommerce-message { border-left-color: hsl(var(--primary)); }
.woocommerce-info { border-left-color: hsl(var(--teal)); }
.woocommerce-error { border-left-color: hsl(var(--destructive)); }

.woocommerce-message a,
.woocommerce-info a,
.woocommerce-error a {
  color: hsl(var(--nopal));
  text-decoration: underline;
  text-underline-offset: 4px;
}

.single-product .woocommerce-message,
.single-product .woocommerce-info {
  display: none;
}

/* Default WooCommerce quantity input left unstyled on purpose (no quantity
   control in the design), but keep it usable for plugins that add one. */
.theme-product-page form.cart .quantity input.qty {
  width: 5rem;
}

.theme-add-to-cart-area {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem;
}

.theme-add-to-cart-area .single_add_to_cart_button {
  flex: 1 1 auto;
  min-width: 160px;
}

/* ------------------------------------------------------------------
 * Checkout: native WooCommerce Checkout Block styled to the design.
 * ------------------------------------------------------------------ */
body.woocommerce-checkout .site-main,
body.woocommerce-checkout .theme-main {
  padding-bottom: 4rem;
}

body.woocommerce-checkout .entry-content,
body.theme-thankyou-page .entry-content,
body.woocommerce-cart .entry-content,
body.woocommerce-account .entry-content {
  max-width: 100%;
}

body.woocommerce-checkout .page-title,
body.theme-thankyou-page .page-title,
body.woocommerce-cart .page-title,
body.woocommerce-account .page-title {
  margin-left: auto;
  margin-right: auto;
}

/* Single grid owner for the two-column split. */
@media (min-width: 768px) {
  body.woocommerce-checkout .wc-block-components-sidebar-layout.wc-block-checkout.is-large,
  body.woocommerce-checkout .wc-block-checkout.wc-block-components-sidebar-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--checkout-gap, 2.5rem);
    align-items: start;
  }
}

body.woocommerce-checkout .wc-block-checkout {
  display: block;
}

body.woocommerce-checkout .wc-block-checkout__main,
body.woocommerce-checkout .wc-block-checkout__sidebar {
  min-width: 0;
  width: 100%;
  max-width: none;
}

body.woocommerce-checkout .wc-block-components-notice-banner,
body.woocommerce-checkout .wc-block-store-notice {
  grid-column: 1 / -1;
}

body.woocommerce-checkout .wc-block-checkout__sidebar {
  background-color: hsl(var(--butter) / 0.5);
  border: 1px solid hsl(var(--border) / 0.6);
  border-radius: var(--radius);
  padding: 1.5rem;
}

@media (min-width: 768px) {
  body.woocommerce-checkout .wc-block-checkout__sidebar {
    padding: 2rem;
  }
}

body.woocommerce-checkout .wc-block-checkout h2,
body.woocommerce-checkout .wc-block-checkout h3,
body.woocommerce-checkout .wc-block-components-title.wc-block-components-title,
body.woocommerce-checkout .wc-block-components-checkout-step__title {
  font-family: var(--font-display);
  font-weight: 400;
  color: hsl(var(--foreground));
  letter-spacing: -0.015em;
}

body.woocommerce-checkout .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-select select,
body.woocommerce-checkout .wc-blocks-components-select__select,
body.woocommerce-checkout .wc-block-components-textarea textarea,
body.woocommerce-checkout .woocommerce-checkout .form-row .input-text,
body.woocommerce-checkout .woocommerce-checkout .form-row select {
  border-radius: calc(var(--radius) - 2px) !important;
  border-color: hsl(var(--border) / 0.7) !important;
  background-color: hsl(var(--background)) !important;
  color: hsl(var(--foreground)) !important;
  font-family: var(--font-body) !important;
  font-size: 0.875rem !important;
  width: 100% !important;
  max-width: none !important;
}

body.woocommerce-checkout .wc-block-components-text-input input:focus,
body.woocommerce-checkout .wc-block-components-select select:focus,
body.woocommerce-checkout .wc-blocks-components-select__select:focus,
body.woocommerce-checkout .wc-block-components-textarea textarea:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px hsl(var(--nopal) / 0.4) !important;
  border-color: hsl(var(--nopal) / 0.5) !important;
}

body.woocommerce-checkout .wc-block-components-text-input label,
body.woocommerce-checkout .wc-block-components-select label,
body.woocommerce-checkout .wc-blocks-components-select label {
  font-family: var(--font-body) !important;
  color: hsl(var(--foreground) / 0.7) !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
  text-transform: uppercase !important;
}

body.woocommerce-checkout .wc-block-components-button,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button {
  border-radius: 9999px !important;
  background-color: hsl(var(--primary)) !important;
  color: hsl(var(--primary-foreground)) !important;
  border: 1px solid hsl(var(--primary)) !important;
  font-family: var(--font-body) !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase !important;
  transition: background-color 0.3s ease, color 0.3s ease !important;
}

body.woocommerce-checkout .wc-block-components-button:hover,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover {
  background-color: hsl(var(--background)) !important;
  color: hsl(var(--primary)) !important;
}

body.woocommerce-checkout .wc-block-cart-items,
body.woocommerce-checkout .wc-block-components-order-summary-item {
  font-family: var(--font-body);
}

/* ------------------------------------------------------------------
 * Thank-you page (theme-thankyou-page).
 * ------------------------------------------------------------------ */
body.theme-thankyou-page {
  overflow-x: hidden;
}

body.theme-thankyou-page .woocommerce-order {
  font-family: var(--font-body);
  color: hsl(var(--foreground));
}

body.theme-thankyou-page .woocommerce-order h2,
body.theme-thankyou-page .woocommerce-order-details__title,
body.theme-thankyou-page .woocommerce-column__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.75rem;
  padding: 0 0 1rem 0;
  color: hsl(var(--foreground));
}

body.theme-thankyou-page .woocommerce-order-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

body.theme-thankyou-page .woocommerce-order-overview li {
  min-width: 0;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  border: 0;
  padding: 0;
}

body.theme-thankyou-page .woocommerce-order-overview li strong {
  display: block;
  margin-top: 0.25rem;
  color: hsl(var(--foreground));
  font-weight: 600;
}

body.theme-thankyou-page .woocommerce-order-details table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

body.theme-thankyou-page .woocommerce-order-details th,
body.theme-thankyou-page .woocommerce-order-details td {
  padding: 0.75rem 0;
  border-bottom: 1px solid hsl(var(--border) / 0.6);
  font-size: 0.9375rem;
  overflow-wrap: break-word;
}

body.theme-thankyou-page .woocommerce-order-details tfoot th {
  text-align: left;
}

body.theme-thankyou-page .woocommerce-order-details tfoot td {
  text-align: right;
}

body.theme-thankyou-page .woocommerce-customer-details {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

body.theme-thankyou-page .woocommerce-customer-details address {
  max-width: 480px;
  overflow-wrap: break-word;
  font-style: normal;
}

/* ------------------------------------------------------------------
 * Cart / account block pages: same width and alignment as checkout.
 * ------------------------------------------------------------------ */
body.woocommerce-cart .wc-block-cart,
body.woocommerce-account .woocommerce {
  font-family: var(--font-body);
  color: hsl(var(--foreground));
}

body.woocommerce-cart .wc-block-components-button,
body.woocommerce-account .woocommerce-Button,
body.woocommerce-account button.button {
  border-radius: 9999px;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: 1px solid hsl(var(--primary));
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------
 * Generic page title + entry content typography (WordPress output).
 * ------------------------------------------------------------------ */
.page-title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  color: hsl(var(--foreground));
}

.entry-content > * + * {
  margin-top: 1rem;
}

.entry-content a {
  color: hsl(var(--nopal));
  text-decoration: underline;
  text-underline-offset: 4px;
}

.entry-content ul {
  list-style: disc;
  padding-left: 1.25rem;
}

.entry-content ol {
  list-style: decimal;
  padding-left: 1.25rem;
}

.entry-content h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.875rem;
}

.entry-content h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* ------------------------------------------------------------------
 * Footer focus list keeps the design's list reset.
 * ------------------------------------------------------------------ */
footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

footer .menu li a,
footer ul li a {
  text-decoration: none;
}

/* ------------------------------------------------------------------
 * Site logo sizing — one definition for every context.
 * ------------------------------------------------------------------ */
.site-logo-img {
  height: var(--logo-height, 64px) !important;
  width: auto !important;
  display: block;
}

.site-logo-text {
  line-height: var(--logo-height, 64px);
  display: block;
}

/* Header brand text sits next to the logo. */
.site-header__brand-name {
  line-height: 1;
}
