/* v1.8.24 premium visual repair */

:root {
  --afp-premium-bg: #fffaf7;
  --afp-premium-bg-soft: #fcf5f0;
  --afp-premium-border: rgba(223,198,185,.92);
  --afp-premium-accent: #b56c52;
  --afp-premium-accent-soft: #f3e5db;
  --afp-premium-text: #241c18;
  --afp-premium-muted: #8f7367;
}

/* ---------- Product photo: restore main image and hide messy thumbs ---------- */
.single-product div.product .woocommerce-product-gallery,
.single-product div.product .images {
  display: block !important;
  position: relative !important;
  background: var(--afp-premium-bg) !important;
  border: 1.5px solid var(--afp-premium-border) !important;
  border-radius: 32px !important;
  padding: 18px !important;
  box-shadow: 0 20px 40px rgba(36,24,18,.04), inset 0 1px 0 rgba(255,255,255,.82) !important;
  overflow: hidden !important;
}

.single-product div.product .woocommerce-product-gallery__wrapper,
.single-product div.product .flex-viewport,
.single-product div.product .woocommerce-product-gallery__image,
.single-product div.product .woocommerce-product-gallery__image > a,
.single-product div.product .images > a:first-child,
.single-product div.product .images > a:first-child > img,
.single-product div.product .woocommerce-product-gallery img,
.single-product div.product .images img,
.single-product div.product .slick-track,
.single-product div.product .slick-list,
.single-product div.product figure.woocommerce-product-gallery__wrapper {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  background: transparent !important;
}

.single-product div.product .woocommerce-product-gallery__wrapper,
.single-product div.product .flex-viewport,
.single-product div.product .woocommerce-product-gallery__image,
.single-product div.product .woocommerce-product-gallery__image > a,
.single-product div.product .images > a:first-child {
  overflow: hidden !important;
  border-radius: 24px !important;
}

.single-product div.product .woocommerce-product-gallery img,
.single-product div.product .images img,
.single-product div.product img.wp-post-image {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  object-fit: cover !important;
  border-radius: 24px !important;
  transform: none !important;
  transition: none !important;
  box-shadow: none !important;
}

.single-product div.product .woocommerce-product-gallery .flex-control-thumbs,
.single-product div.product .woocommerce-product-gallery .flex-control-nav,
.single-product div.product .woocommerce-product-gallery .thumbnails,
.single-product div.product .woocommerce-product-gallery .slick-dots,
.single-product div.product .woocommerce-product-gallery .product-thumbnails,
.single-product div.product .woocommerce-product-gallery .thumbnail_image,
.single-product div.product .woocommerce-product-gallery .yith_magnifier_gallery,
.single-product div.product .images .flex-control-thumbs,
.single-product div.product .images .flex-control-nav,
.single-product div.product .images .thumbnails,
.single-product div.product .images .slick-dots,
.single-product div.product .images .product-thumbnails,
.single-product div.product .images .thumbnail_image,
.single-product div.product .images .yith_magnifier_gallery,
.single-product div.product .afp-format-mini-gallery {
  display: none !important;
}

.single-product div.product .woocommerce-product-gallery .woocommerce-product-gallery__trigger,
.single-product div.product .images .woocommerce-product-gallery__trigger {
  top: 16px !important;
  right: 16px !important;
  left: auto !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 999px !important;
  border: 1px solid var(--afp-premium-border) !important;
  background: rgba(255,250,247,.95) !important;
  box-shadow: 0 12px 28px rgba(36,24,18,.08) !important;
}

/* ---------- Layout shells ---------- */
.afp-widget .afp-unified-card,
.afp-widget .afp-master-table,
.afp-widget .afp-master-table > tbody,
.afp-widget .afp-preview-card,
.afp-widget .afp-live-panel,
.afp-widget .afp-range-shell {
  background: transparent !important;
}

.afp-widget .afp-master-row--summary td {
  background: #fffaf7 !important;
}

/* ---------- Format field ---------- */
.afp-widget .afp-format-dropdown { display: none !important; }
.afp-widget .afp-control--format-simple {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  min-height: 72px !important;
  border: 1.5px solid var(--afp-premium-border) !important;
  border-radius: 28px !important;
  background: linear-gradient(180deg, #fffefd 0%, var(--afp-premium-bg) 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88) !important;
  overflow: hidden !important;
}

.afp-widget .afp-control--format-simple::after {
  content: "" !important;
  position: absolute !important;
  right: 20px !important;
  top: 50% !important;
  width: 12px !important;
  height: 12px !important;
  margin-top: -8px !important;
  border-right: 2px solid #8a7064 !important;
  border-bottom: 2px solid #8a7064 !important;
  transform: rotate(45deg) !important;
  pointer-events: none !important;
}

.afp-widget .afp-control--format-simple select#afp_format {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  position: relative !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  display: block !important;
  width: 100% !important;
  height: 72px !important;
  min-height: 72px !important;
  padding: 0 64px 0 24px !important;
  border: 0 !important;
  border-radius: 28px !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--afp-premium-text) !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  line-height: 72px !important;
}

.afp-widget .afp-control--format-simple select#afp_format:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* ---------- Area field ---------- */
.afp-widget .afp-control--area-simple,
.afp-widget .afp-control--area-simple::before,
.afp-widget .afp-control--area-simple::after,
.afp-widget .afp-area-input,
.afp-widget .afp-area-input::before,
.afp-widget .afp-area-input::after {
  box-shadow: none !important;
}

.afp-widget .afp-control--area-simple {
  position: relative !important;
  width: 100% !important;
  min-height: 72px !important;
  border: 1.5px solid var(--afp-premium-border) !important;
  border-radius: 28px !important;
  background: linear-gradient(180deg, #fffefd 0%, var(--afp-premium-bg) 100%) !important;
  overflow: hidden !important;
}

.afp-widget .afp-area-input {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: 72px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.afp-widget .afp-control--area-simple #afp_area {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 100% !important;
  height: 72px !important;
  min-height: 72px !important;
  margin: 0 !important;
  padding: 0 168px 0 24px !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--afp-premium-text) !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  line-height: 72px !important;
}

.afp-widget .afp-control--area-simple #afp_area::-webkit-outer-spin-button,
.afp-widget .afp-control--area-simple #afp_area::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

.afp-widget .afp-control--area-simple #afp_area:focus {
  outline: none !important;
  box-shadow: none !important;
}

.afp-widget .afp-area-addon {
  position: absolute !important;
  right: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.afp-widget .afp-area-stepper {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.afp-widget .afp-area-stepper__button {
  all: unset !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(181,108,82,.18) !important;
  background: var(--afp-premium-accent-soft) !important;
  color: var(--afp-premium-accent) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

.afp-widget .afp-area-stepper__button:hover,
.afp-widget .afp-area-stepper__button:focus-visible {
  background: #eddccf !important;
  border-color: rgba(181,108,82,.28) !important;
}

.afp-widget .afp-input-unit-pill,
.afp-widget [data-afp-input-unit] {
  all: unset !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 44px !important;
  height: 30px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(181,108,82,.18) !important;
  background: var(--afp-premium-accent-soft) !important;
  color: var(--afp-premium-accent) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

/* ---------- Input mode buttons ---------- */
.afp-widget .afp-input-mode-switch,
.afp-widget .afp-order-unit-switch {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  margin-top: 12px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.afp-widget .afp-order-unit-switch.is-hidden { display: none !important; }

.afp-widget .afp-input-mode-switch__label {
  color: var(--afp-premium-muted) !important;
  font-size: 12px !important;
  letter-spacing: .14em !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
}

.afp-widget .afp-input-mode-switch__button {
  appearance: none !important;
  -webkit-appearance: none !important;
  all: unset !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 34px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(181,108,82,.16) !important;
  background: var(--afp-premium-bg) !important;
  color: var(--afp-premium-accent) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

.afp-widget .afp-input-mode-switch__button.is-active {
  background: linear-gradient(180deg, #c98161 0%, #b56c52 100%) !important;
  border-color: rgba(181,108,82,.30) !important;
  color: #fff !important;
}

.afp-widget .afp-conversion-note {
  margin-top: 10px !important;
  color: var(--afp-premium-muted) !important;
  font-size: 14px !important;
}

/* ---------- Summary footer & buttons ---------- */
.afp-widget .afp-submit-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  margin-top: 20px !important;
  padding-top: 18px !important;
  border-top: 1px solid var(--afp-premium-border) !important;
}

.afp-widget .afp-submit-row__total {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}

.afp-widget .afp-submit-row__label {
  color: var(--afp-premium-muted) !important;
  font-size: 12px !important;
  letter-spacing: .14em !important;
  text-transform: uppercase !important;
}

.afp-widget .afp-submit-row__total strong {
  display: block !important;
  margin-top: 6px !important;
  color: var(--afp-premium-text) !important;
  font-size: 28px !important;
  line-height: 1.05 !important;
}

.afp-widget .afp-submit-row__actions {
  display: flex !important;
  gap: 14px !important;
  flex-wrap: wrap !important;
}

.afp-widget .afp-add-to-cart,
.afp-widget .afp-checkout-button {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 210px !important;
  min-height: 52px !important;
  padding: 0 24px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(181,108,82,.18) !important;
  box-shadow: none !important;
  text-decoration: none !important;
  font-weight: 800 !important;
}

.afp-widget .afp-add-to-cart {
  background: linear-gradient(180deg, #c98161 0%, #b56c52 100%) !important;
  color: #fff !important;
}

.afp-widget .afp-checkout-button {
  background: var(--afp-premium-bg) !important;
  color: var(--afp-premium-accent) !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .afp-widget .afp-submit-row {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .afp-widget .afp-submit-row__actions {
    justify-content: stretch !important;
  }
  .afp-widget .afp-add-to-cart,
  .afp-widget .afp-checkout-button {
    width: 100% !important;
    min-width: 0 !important;
  }
}
