/* Mr Vic Store — theme additions for WordPress/WooCommerce markup only.
   Source styling lives in app.css (compiled). */

[hidden] { display: none !important; }

.theme-attr-select-hidden { display: none !important; }

.site-logo-img  { height: var(--logo-height) !important; width: auto !important; display: block; }
.site-logo-text { line-height: var(--logo-height); display: block; }

/* Source renders the header logo at 56px and 68px from md up. */
.theme-header-logo { height: var(--logo-height) !important; width: auto !important; object-fit: contain; }
@media (min-width: 768px) {
  .theme-header-logo { height: calc(var(--logo-height) + 12px) !important; }
}
/* Source renders the footer logo at 96px and 112px from md up. */
.theme-footer-logo { height: calc(var(--logo-height) * 1.7142857) !important; width: auto !important; object-fit: contain; }
@media (min-width: 768px) {
  .theme-footer-logo { height: calc(var(--logo-height) * 2) !important; }
}

/* Source hero height: viewport minus the announcement bar and header. */
.theme-hero { min-height: 520px; height: calc(100svh - var(--hero-offset, 116px)); }

/* Source slideshow fade between frames. */
.theme-slide { opacity: 0; transition: opacity 0.9s cubic-bezier(0.25, 0.4, 0.25, 1); }
.theme-slide.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .theme-slide { transition: none; }
}

/* Source in-view reveal: opacity 0 → 1 with a 32px rise, staggered 0.1s. */
.theme-reveal { opacity: 0; }
.theme-reveal.is-visible {
  animation: theme-fade-up 0.7s cubic-bezier(0.25, 0.4, 0.25, 1) forwards;
  animation-delay: var(--reveal-delay, 0s);
}
@keyframes theme-fade-up {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .theme-reveal { opacity: 1; }
  .theme-reveal.is-visible { animation: none; }
}
body.is-customizer .theme-reveal { opacity: 1; }
html.no-js .theme-reveal,
body.no-observer .theme-reveal { opacity: 1; }

/* Source hero entrance. */
.theme-hero-fade { animation: theme-fade-in 1.1s cubic-bezier(0.25, 0.4, 0.25, 1) forwards; }
.theme-hero-line { animation: theme-rise 0.9s cubic-bezier(0.25, 0.4, 0.25, 1) forwards; opacity: 0; }
.theme-hero-line-1 { animation-delay: 0.35s; }
.theme-hero-line-2 { animation-delay: 0.55s; animation-duration: 0.7s; }
.theme-hero-line-3 { animation-delay: 0.75s; animation-duration: 0.65s; }
@keyframes theme-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .theme-hero-fade, .theme-hero-line { animation: none; opacity: 1; }
}

/* WP menu output inside the header: <ul><li><a>. Match the source nav classes. */
.site-header ul.menu { list-style: none; margin: 0; padding: 0; }
.site-header ul.menu > li { margin: 0; }
.site-header ul.menu > li > a {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: color 0.3s ease;
  cursor: pointer;
}
.site-header ul.menu > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.3s var(--transition-smooth);
}
.site-header ul.menu > li > a:hover::after { transform: scaleX(1); }

/* Footer menu output. */
footer ul.menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 768px) {
  footer ul.menu { gap: 1.75rem; }
}
footer ul.menu > li > a {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.2s ease;
}
footer ul.menu > li > a:hover { color: hsl(var(--foreground)); }

/* Source card hover: lift 4px, image scales 1.04, quick-add appears on desktop. */
.theme-product-card-media { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.theme-product-card-media img { transition: transform 0.7s cubic-bezier(0.25, 0.4, 0.25, 1); }
.theme-product-card:hover .theme-product-card-media { transform: translateY(-4px); }
.theme-product-card:hover .theme-product-card-media img { transform: scale(1.04); }
.theme-product-card:hover .theme-product-card-title { color: hsl(var(--primary)); }
.theme-product-card:hover .theme-product-card-add { opacity: 1; }
@media (min-width: 768px) {
  .theme-product-card-add { opacity: 0; }
  .theme-product-card-add:hover { transform: scale(1.08); }
}
.theme-product-card-add { transition: opacity 0.3s ease, transform 0.2s ease; }
/* Hit-area overlay: keep the quick-add clickable above it. The control sits on the image. */
.theme-product-card .theme-product-card-add { z-index: 3; }
.theme-product-card *:not(.theme-product-card__hit):not(.theme-product-card-add) { pointer-events: none; }
.theme-product-card .theme-product-card-add { pointer-events: auto; }

/* Source category tile hover. */
.theme-collection-tile img { transition: transform 0.7s cubic-bezier(0.25, 0.4, 0.25, 1); }
.theme-collection-tile:hover img { transform: scale(1.05); }

/* Source service card hover. */
.theme-service-card img { transition: transform 0.7s ease; }
.theme-service-card:hover img { transform: scale(1.05); }

/* Source cart badge hides when empty. */
.theme-cart-count:empty { display: none; }

/* WooCommerce product card: image fills its aspect box. */
.theme-product-card-media { position: relative; overflow: hidden; }
.theme-product-card-media > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.theme-product-thumb-wrap { position: relative; overflow: hidden; }
.theme-product-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Cart drawer visibility ---- */
#theme-cart-overlay {
  position: fixed;
  inset: 0;
  background: hsl(var(--foreground) / 0.2);
  z-index: 49;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--transition-smooth);
}
body.cart-open #theme-cart-overlay { opacity: 1; pointer-events: auto; }

#theme-cart-drawer {
  position: fixed;
  right: 0;
  top: 0;
  height: 100%;
  width: 100%;
  max-width: 28rem;
  background: hsl(var(--background));
  z-index: 50;
  box-shadow: var(--shadow-elevated);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s var(--transition-smooth), opacity 0.3s var(--transition-smooth);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
body.cart-open #theme-cart-drawer {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
#theme-cart-drawer.is-updating > * { opacity: 0.6; pointer-events: none; }

body.cart-open { overflow: hidden; }

/* ---- Contact modal ---- */
#theme-contact-modal { display: none; }
body.contact-open #theme-contact-modal { display: block; }

.theme-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.8);
  animation: theme-fade-in 0.2s ease forwards;
}
.theme-modal-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 50;
  display: grid;
  width: 100%;
  max-width: 32rem;
  transform: translate(-50%, -50%);
  gap: 1rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  padding: 1.5rem;
  box-shadow: var(--shadow-elevated);
  animation: theme-modal-in 0.2s ease forwards;
}
@media (min-width: 640px) {
  .theme-modal-panel { border-radius: var(--radius); }
}
@keyframes theme-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes theme-modal-in {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.95); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ---- Announcement bar ---- */
body.announcement-dismissed .theme-announcement { display: none; }

/* ---- Mobile menu ---- */
.theme-mobile-menu { display: none; }
body.menu-open .theme-mobile-menu { display: block; }

/* ---- Header state ---- */
.site-header { position: sticky; top: 0; left: 0; right: 0; z-index: 50; }

/* ---- Hidden-by-default mobile/desktop product gallery is handled by source classes ---- */

/* ---- Price filter, matching the source dual-thumb slider ---- */
.theme-price-filter-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.3s var(--transition-smooth), opacity 0.3s var(--transition-smooth);
}
.theme-price-filter-panel-inner { overflow: hidden; min-height: 0; }
.theme-price-filter-panel.is-open { grid-template-rows: 1fr; opacity: 1; }
.theme-price-filter-chevron { display: inline-flex; transition: transform 0.3s ease; }
.theme-price-filter-chevron.is-open { transform: rotate(180deg); }

.theme-price-slider {
  position: relative;
  height: 1.25rem;
  margin: 0.5rem 0.75rem 0.75rem;
  touch-action: none;
  user-select: none;
}
.theme-price-slider__track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0.5rem;
  transform: translateY(-50%);
  border-radius: 9999px;
  background: hsl(var(--secondary));
  overflow: hidden;
}
.theme-price-slider__range {
  position: absolute;
  top: 0;
  height: 100%;
  background: hsl(var(--primary));
}
.theme-price-slider__thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 1.25rem;
  height: 1.25rem;
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  border: 2px solid hsl(var(--primary));
  background: hsl(var(--background));
  cursor: grab;
  z-index: 1;
  touch-action: none;
}
.theme-price-slider__thumb:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}
.theme-price-slider__thumb:active { cursor: grabbing; }

/* ---- Product thumbnails (single product) ---- */
.theme-product-thumb.is-active img { opacity: 1; }
.theme-product-thumb.is-active .theme-thumb-underline { opacity: 1; }
.theme-product-thumb img { opacity: 0.6; transition: opacity 0.2s ease; }
.theme-product-thumb:hover img { opacity: 1; }
.theme-thumb-underline { opacity: 0; transition: opacity 0.2s ease; }

/* ---- Accordion panels ---- */
.theme-accordion-panel { display: none; }
.theme-accordion-panel.is-open { display: block; }
.theme-accordion-chevron.is-open { transform: rotate(180deg); }

/* ---- Quantity and add to cart, matching the source product page ---- */
.single-product .theme-add-to-cart-area {
  display: block !important;
  width: 100%;
}
.single-product form.variations_form .theme-add-to-cart-area {
  padding-top: 1.5rem;
}
.single-product .theme-quantity-wrapper {
  display: inline-flex !important;
  align-items: center;
  width: auto !important;
  max-width: 100%;
  border: 1px solid hsl(var(--border));
  background: transparent;
  vertical-align: middle;
}
.single-product .theme-quantity-wrapper .quantity {
  display: flex !important;
  align-items: center;
  width: auto !important;
  float: none !important;
  margin: 0 !important;
}
.single-product .theme-qty-minus,
.single-product .theme-qty-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  line-height: 1;
}
.single-product .theme-qty-minus:hover,
.single-product .theme-qty-plus:hover {
  background: hsl(var(--secondary));
}
.single-product .theme-quantity-wrapper input.qty,
.single-product .theme-quantity-wrapper input.theme-qty-input {
  width: 2.75rem !important;
  min-width: 44px;
  max-width: 4.5rem;
  flex: 0 0 auto !important;
  margin: 0;
  padding: 0.5rem 0.25rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--foreground));
  -moz-appearance: textfield;
  appearance: textfield;
}
.single-product .theme-quantity-wrapper input.qty::-webkit-outer-spin-button,
.single-product .theme-quantity-wrapper input.qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.single-product .single_add_to_cart_button,
.single-product a.single_add_to_cart_button,
.single-product button.single_add_to_cart_button {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  clear: both;
  margin: 0 !important;
  min-width: 0 !important;
  box-sizing: border-box;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border: 0;
  border-radius: 9999px;
  padding: 1rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.single-product .single_add_to_cart_button:hover,
.single-product a.single_add_to_cart_button:hover {
  background: hsl(var(--foreground) / 0.9);
  color: hsl(var(--background));
}

/* ---- WooCommerce generated markup ---- */
.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-radius: var(--radius);
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
}
.woocommerce-error { border-color: hsl(var(--destructive) / 0.4); color: hsl(var(--destructive)); }
.woocommerce-message .button,
.woocommerce-info .button { display: none; }

.single-product .woocommerce-message,
.single-product .woocommerce-info { display: none; }
#theme-cart-drawer .woocommerce-message { display: none; }

/* Hide "View cart" injected by WooCommerce after AJAX add-to-cart */
.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;
}

/* Add-to-cart disabled state */
.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 {
  cursor: not-allowed !important;
  opacity: 0.6 !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 {
  opacity: 0.6 !important;
}

/* WooCommerce spinner suppression */
.single-product .single_add_to_cart_button.loading::after,
.ajax_add_to_cart.loading::after { display: none !important; }

.ajax_add_to_cart.theme-btn-loading {
  opacity: 0.6 !important;
  pointer-events: none !important;
  cursor: wait !important;
}

/* Screen reader text */
.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 !important;
  width: 1px;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  clip: auto !important;
  clip-path: none;
  display: block;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* WordPress pagination / comments */
.page-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.25rem;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
@media (min-width: 768px) {
  .page-title { font-size: 3rem; }
}

/* ---- Variations table layout (label above control) ---- */
.single-product .variations tbody,
.single-product .variations tbody tr,
.single-product .variations tbody td {
  display: block;
  width: 100%;
}
.single-product .variations { margin: 0 0 0; }
.single-product .variations tbody tr { margin-bottom: 1.5rem; }
.single-product .variations tbody tr:last-child { margin-bottom: 0; }
.single-product .variations tbody td.label { padding-bottom: 0.75rem; }
.single-product .variations tbody td.value { padding-top: 0; }
.single-product .variations td.label label {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.single-product .theme-attr-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.single-product .theme-attr-pill {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid hsl(var(--border));
  border-radius: 9999px;
  transition: all 0.2s ease;
  font-family: var(--font-body);
  cursor: pointer;
}
.single-product .theme-attr-pill:hover { border-color: hsl(var(--foreground) / 0.6); }
.single-product .theme-attr-pill.is-active {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border-color: hsl(var(--foreground));
}

/* Product features accordion uses the short description, with the source type styles. */
.theme-product-features {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.625;
  color: hsl(var(--muted-foreground));
}
.theme-product-features p {
  margin: 0 0 1rem;
  white-space: pre-line;
}
.theme-product-features p:last-child { margin-bottom: 0; }
.theme-product-features ul,
.theme-product-features ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.theme-product-features li {
  display: flex;
  align-items: flex-start;
  margin: 0;
}
.theme-product-features li::before {
  content: '';
  width: 0.25rem;
  height: 0.25rem;
  margin-top: 0.5rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: hsl(var(--foreground));
}
.theme-product-features li p { margin: 0; }

/* ---- Checkout 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-text-input input,
body.woocommerce-checkout .wc-block-components-select select {
  width: 100% !important;
  max-width: none !important;
}
body.woocommerce-checkout .wc-block-checkout { display: block; }
@media (min-width: 768px) {
  body.woocommerce-checkout .wc-block-components-sidebar-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
  }
}
body.woocommerce-checkout .wc-block-checkout__sidebar {
  background-color: hsl(var(--secondary));
  border-radius: var(--radius);
  padding: 2rem;
}
body.woocommerce-checkout .wc-block-components-notice-banner,
body.woocommerce-checkout .wc-block-components-notice-banner__content { grid-column: 1 / -1; }
body.woocommerce-checkout .entry-content { max-width: 100%; }
body.woocommerce-checkout .site-main {
  padding-top: var(--header-height, 80px);
  padding-bottom: 4rem;
}
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 .wc-block-components-text-input input:focus,
body.woocommerce-checkout .wc-block-components-select select:focus {
  border-color: hsl(var(--border)) !important;
  border-radius: calc(var(--radius) - 4px) !important;
  background-color: hsl(var(--background)) !important;
  color: hsl(var(--foreground)) !important;
  font-family: var(--font-body) !important;
  font-size: 1rem !important;
  box-shadow: 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 {
  outline: none !important;
  border-color: hsl(var(--primary)) !important;
  box-shadow: 0 0 0 1px hsl(var(--primary)) !important;
}
body.woocommerce-checkout .wc-block-components-checkout-place-order-button {
  background-color: hsl(var(--foreground)) !important;
  color: hsl(var(--background)) !important;
  border-radius: 9999px !important;
  font-family: var(--font-body) !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.25em !important;
  text-transform: uppercase !important;
  padding: 1rem 1.5rem !important;
}
body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover {
  background-color: hsl(var(--foreground) / 0.9) !important;
}
body.woocommerce-checkout .wc-block-checkout__sidebar .wc-block-components-order-summary-item__image,
body.woocommerce-checkout .wc-block-cart-items__row { border-radius: var(--radius); }

/* Cart / account / thankyou page alignment */
body.woocommerce-cart .site-main,
body.woocommerce-account .site-main,
body.theme-thankyou-page .site-main { padding-bottom: 4rem; }

body.theme-thankyou-page { overflow-x: hidden; }
body.theme-thankyou-page .woocommerce-order-details table { width: 100%; table-layout: fixed; }
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-order h2,
body.theme-thankyou-page .woocommerce-order-details__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  padding: 0 0 1rem 0;
}
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; }

/* ---- Single product layout guards ---- */
.single-product .theme-product-layout { min-width: 0; }
.single-product .theme-product-gallery,
.single-product .theme-product-info { min-width: 0; max-width: 100%; }
.single-product .theme-product-thumbnails { flex-wrap: wrap; max-width: 100%; }
.single-product .woocommerce-product-details__short-description,
.single-product .woocommerce-variation-description,
.single-product .posted_in { overflow-wrap: break-word; word-break: break-word; }

/* ---- Product card image link ---- */
.theme-product-card__image-link { display: block; }

/* ---- Cart drawer inner WooCommerce markup ---- */
#theme-cart-drawer .cart-item-qty { min-width: 1.5rem; text-align: center; }

/* Preview fallback for reveal helpers */
body.is-customizer .reveal-item,
body.is-customizer .scale-in-item { opacity: 1 !important; transform: none !important; }
