:root {
  --p8-ink: #14251d;
  --p8-muted: #66756d;
  --p8-line: #dfe7e2;
  --p8-soft: #f5f8f6;
  --p8-accent: #0b8f50;
  --p8-accent-dark: #08723f;
}

body.p8-modal-open { overflow: hidden; }
.p8-modal-backdrop[hidden] { display: none !important; }
.p8-modal-backdrop { position: fixed; inset: 0; z-index: 999999; display: grid; place-items: center; padding: 20px; background: rgba(8, 18, 13, .58); backdrop-filter: blur(5px); }
.p8-modal { position: relative; width: min(680px, 100%); max-height: min(820px, calc(100vh - 40px)); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden; border-radius: 24px; background: #fff; color: var(--p8-ink); box-shadow: 0 30px 90px rgba(0, 0, 0, .3); font-family: inherit; }
.p8-modal-close { position: absolute; z-index: 2; top: 16px; right: 16px; width: 40px; height: 40px; border: 1px solid var(--p8-line); border-radius: 50%; background: #fff; color: var(--p8-ink); font-size: 26px; line-height: 1; cursor: pointer; }
.p8-modal-header { display: flex; align-items: center; gap: 16px; padding: 24px 70px 18px 24px; border-bottom: 1px solid var(--p8-line); }
.p8-modal-image { width: 76px; height: 76px; flex: 0 0 auto; border-radius: 16px; object-fit: cover; background: var(--p8-soft); }
.p8-modal-kicker { display: block; margin-bottom: 5px; color: var(--p8-accent); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.p8-modal-header h2 { margin: 0; color: var(--p8-ink); font-size: clamp(22px, 4vw, 30px); line-height: 1.1; }
.p8-modal-price { margin: 6px 0 0; color: var(--p8-muted); font-weight: 700; }
.p8-modal-message { min-height: 0; padding: 0 24px; color: #a73a32; font-size: 14px; font-weight: 700; }
.p8-modal-message:not(:empty) { padding-top: 12px; }
.p8-addon-form { min-height: 0; overflow: auto; }
.p8-addon-groups { display: grid; gap: 0; }
.p8-addon-group { min-width: 0; margin: 0; padding: 20px 24px; border: 0; border-bottom: 1px solid var(--p8-line); }
.p8-addon-group legend { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; padding: 0; color: var(--p8-ink); font-size: 17px; font-weight: 850; }
.p8-required, .p8-optional { border-radius: 999px; padding: 5px 8px; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.p8-required { background: rgba(11, 143, 80, .1); color: var(--p8-accent-dark); }
.p8-optional { background: var(--p8-soft); color: var(--p8-muted); }
.p8-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.p8-option { position: relative; min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--p8-line); border-radius: 14px; padding: 10px 40px 10px 12px; background: #fff; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.p8-option:hover { border-color: #aabbb1; transform: translateY(-1px); }
.p8-option:has(input:checked) { border-color: var(--p8-accent); background: rgba(11, 143, 80, .055); }
.p8-option input { position: absolute; opacity: 0; pointer-events: none; }
.p8-option span, .p8-option strong, .p8-option small { display: block; }
.p8-option strong { color: var(--p8-ink); font-size: 14px; }
.p8-option small { margin-top: 3px; color: var(--p8-accent-dark); font-size: 12px; font-weight: 800; }
.p8-option i { position: absolute; right: 12px; width: 20px; height: 20px; border: 1.5px solid #b7c4bc; border-radius: 6px; }
.p8-option input[type="radio"] + span + i { border-radius: 50%; }
.p8-option:has(input:checked) i { border-color: var(--p8-accent); background: var(--p8-accent); box-shadow: inset 0 0 0 4px #fff; }
.p8-textarea, .p8-number, .p8-select { width: 100%; border: 1px solid var(--p8-line); border-radius: 14px; background: #fff; color: var(--p8-ink); padding: 12px 14px; font: inherit; outline: none; }
.p8-textarea { min-height: 92px; resize: vertical; }
.p8-textarea:focus, .p8-number:focus, .p8-select:focus { border-color: var(--p8-accent); box-shadow: 0 0 0 3px rgba(11, 143, 80, .1); }
.p8-group-error { display: none; margin: 8px 0 0; color: #b42318; font-size: 12px; font-weight: 700; }
.p8-addon-group.has-error { background: #fff8f7; }
.p8-addon-group.has-error .p8-group-error { display: block; }
.p8-modal-footer { display: flex; align-items: end; justify-content: flex-end; gap: 10px; padding: 16px 24px; background: #fff; box-shadow: 0 -8px 25px rgba(20, 37, 29, .06); }
.p8-quantity-wrap { display: grid; gap: 5px; margin-right: auto; color: var(--p8-muted); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.p8-quantity { display: grid; grid-template-columns: 42px 58px 42px; overflow: hidden; border: 1px solid var(--p8-line); border-radius: 13px; background: #fff; }
.p8-quantity button, .p8-quantity input { min-height: 46px; border: 0; background: #fff; color: var(--p8-ink); font: inherit; font-weight: 900; text-align: center; }
.p8-quantity button { cursor: pointer; font-size: 22px; }
.p8-quantity button:hover { background: var(--p8-soft); }
.p8-quantity input { width: 58px; border-right: 1px solid var(--p8-line); border-left: 1px solid var(--p8-line); appearance: textfield; }
.p8-quantity input::-webkit-inner-spin-button, .p8-quantity input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.p8-modal-cancel, .p8-modal-submit { min-height: 48px; border-radius: 13px; padding: 11px 18px; font: inherit; font-weight: 850; cursor: pointer; }
.p8-modal-cancel { border: 1px solid var(--p8-line); background: #fff; color: var(--p8-ink); }
.p8-modal-submit { min-width: 150px; border: 1px solid var(--p8-accent); background: var(--p8-accent); color: #fff; }
.p8-modal-submit:hover { background: var(--p8-accent-dark); }
.p8-modal-submit:disabled { opacity: .55; cursor: wait; }

.p8-live-search { width: min(1200px, 100%); margin: 0 auto 24px; }
.p8-live-search > label { display: block; margin-bottom: 8px; color: var(--p8-ink); font-size: 14px; font-weight: 800; }
.p8-search-box { position: relative; display: flex; align-items: center; }
.p8-search-box > span { position: absolute; left: 15px; color: var(--p8-muted); font-size: 24px; transform: rotate(-15deg); pointer-events: none; }
.p8-search-box input { width: 100%; min-height: 54px; border: 1px solid var(--p8-line); border-radius: 16px; background: #fff; color: var(--p8-ink); padding: 12px 48px; font: inherit; font-size: 16px; outline: none; box-shadow: 0 8px 24px rgba(20, 37, 29, .05); }
.p8-search-box input:focus { border-color: var(--p8-accent); box-shadow: 0 0 0 3px rgba(11, 143, 80, .1), 0 8px 24px rgba(20, 37, 29, .06); }
.p8-search-box button { position: absolute; right: 9px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--p8-soft); color: var(--p8-ink); font-size: 22px; cursor: pointer; }
.p8-search-status { min-height: 20px; margin: 8px 2px 0; color: var(--p8-muted); font-size: 13px; }
.p8-search-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 10px 0 0 !important; padding: 0 !important; list-style: none !important; }
.p8-search-product { min-width: 0; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--p8-line); border-radius: 17px; background: #fff; padding: 10px; box-shadow: 0 8px 22px rgba(20, 37, 29, .04); }
.p8-search-image { width: 72px; height: 72px; display: grid; place-items: center; overflow: hidden; border-radius: 13px; background: var(--p8-soft); color: var(--p8-muted); font-size: 10px; font-weight: 850; }
.p8-search-image img { width: 100%; height: 100%; object-fit: cover; }
.p8-search-product h3 { overflow: hidden; margin: 0; color: var(--p8-ink); font-size: 15px; line-height: 1.25; text-overflow: ellipsis; }
.p8-search-product p { margin: 5px 0 0; color: var(--p8-muted); font-size: 13px; font-weight: 700; }
.p8-search-add { min-height: 38px; border: 1px solid var(--p8-accent); border-radius: 11px; background: var(--p8-accent); color: #fff; padding: 8px 12px; font-weight: 850; cursor: pointer; }
.p8-search-loading, .p8-search-empty { grid-column: 1 / -1; border: 1px dashed var(--p8-line); border-radius: 16px; padding: 28px; color: var(--p8-muted); text-align: center; }

.wpc-add-to-cart .p8-wpc-add { width: auto !important; min-width: 82px !important; height: 42px !important; min-height: 42px !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; border: 1px solid var(--p8-accent) !important; border-radius: 12px !important; background: var(--p8-accent) !important; color: #fff !important; padding: 8px 15px !important; font-family: inherit !important; font-size: 14px !important; font-weight: 850 !important; line-height: 1 !important; text-decoration: none !important; box-shadow: none !important; cursor: pointer !important; transition: background .16s ease, transform .16s ease !important; }
.wpc-add-to-cart .p8-wpc-add:hover, .wpc-add-to-cart .p8-wpc-add:focus-visible { background: var(--p8-accent-dark) !important; color: #fff !important; transform: translateY(-1px); }
.wpc-add-to-cart .p8-wpc-add.loading { opacity: .65; }

@media (max-width: 900px) {
  .p8-search-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .p8-modal-backdrop { align-items: end; padding: 0; }
  .p8-modal { width: 100%; max-height: 94vh; border-radius: 24px 24px 0 0; }
  .p8-modal-header { padding: 20px 62px 16px 18px; }
  .p8-modal-image { width: 62px; height: 62px; }
  .p8-addon-group { padding: 18px; }
  .p8-options { grid-template-columns: 1fr; }
  .p8-modal-footer { padding: 13px 16px calc(13px + env(safe-area-inset-bottom)); }
  .p8-modal-cancel { display: none; }
  .p8-modal-footer { flex-wrap: wrap; }
  .p8-quantity-wrap { width: 100%; margin: 0; }
  .p8-quantity { grid-template-columns: 48px 1fr 48px; }
  .p8-quantity input { width: 100%; }
  .p8-modal-submit { width: 100%; }
  .p8-search-results { grid-template-columns: 1fr; }
  .p8-search-product { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .p8-search-image { width: 64px; height: 64px; }
}
.p8-online-order-banner { margin: 16px 0; padding: 16px 18px; border: 1px solid #b43c32; border-radius: 12px; background: #fff1ef; color: #86271f; font-size: 16px; font-weight: 800; text-align: center; }
.p8-online-disabled { cursor: not-allowed !important; opacity: .5 !important; filter: grayscale(1); }
