/**
 * Artbring Pricing Calculator — Styles
 *
 * Only structural and plugin-specific layout rules.
 * Typography, colors, form element borders, and button styles
 * are inherited from the active WooCommerce theme.
 */

/* ─── Alpine.js cloak (hide until initialized) ──────── */
[x-cloak] { display: none !important; }

/* ─── Calculator Wrapper ──────────────────────────── */
.abp-calculator-wrapper {
  margin-bottom: 24px;
  width: 100%;
  magin-left: auto;
  margin-right: auto;
}

/* ─── Section Labels ──────────────────────────────── */
.abp-section-label {
  display: block;
  margin-bottom: 4px;
}
.abp-section-label--frame {
  margin-top: 20px;
  margin-bottom: 8px;
}

/* ─── Size Header (label + unit toggle row) ──────────── */
.abp-size-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.abp-size-header .abp-section-label {
  margin-bottom: 10;
}
.abp-size-header .abp-unit-toggle {
  margin-bottom: 10;
}

/* ─── Selects (shared baseline) ─────────────────── */
.abp-calculator-wrapper select.select {
  height: 40px;
  font-size: inherit;
}

/* ─── Custom Select Dropdown ─────────────────────── */
.abp-custom-select {
  position: relative;
  font-size: inherit;
}
.abp-custom-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: auto;
  height: 40px;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: smaller;
  box-sizing: border-box;
}
.abp-custom-select__arrow {
  color: #6b7280;
  transition: transform 0.15s;
}
.abp-custom-select__dropdown {
  position: absolute;
  font-size: smaller;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.abp-custom-select__group-label {
  padding: 8px 12px 4px;
  font-size: smaller;
  font-weight: 600;
  color: #111111
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.abp-custom-select__option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px
  white-space: nowrap;
}
.abp-custom-select__option:hover {
  background: #284e9e;
  color: #fff;
}
.abp-custom-select__trigger--disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

/* ─── Custom Size Toggle ──────────────────────────── */
.abp-custom-size-toggle {
  margin-top: 12px;
}

/* ─── Custom Size Panel ────────────────────────────── */
.abp-custom-size-panel {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  margin-top: 12px;
  /*background: #fafafa;*/
}
.abp-custom-size-row {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  box-sizing: border-box;
}
.abp-custom-size-row > div {
  flex: 1;
  font-size: smaller;
}

/* Mobile: stack label above dropdowns */
@media (max-width: 480px) {
  .abp-custom-size-row > div > label:first-of-type {
    display: block;
    margin-bottom: 4px;
  }
}
.abp-custom-size-hint {
  margin-top: 2px;
  font-size: smaller;
}
.abp-fraction-select {
  margin-top: 4px;
}
.abp-custom-size-panel .abp-loading {
  margin-top: 8px;
}

/* ─── Custom Size Header ──────────────────────────── */
.abp-custom-size-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.abp-custom-size-header .abp-close-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  line-height: 26px;
  font-size: 20px;
  font-weight: 300;
  border: 1px solid #887cc9;
  border-radius: 50%;
  background: #fef2f2;
  cursor: pointer;
  color: #193b99;
  text-align: center;
  transition: background 0.15s, transform 0.1s;
}
.abp-custom-size-header .abp-close-btn:hover {
  background: #8a3e12;
  color: #fff;
  transform: scale(1.1);
}

/* ─── Frame Selector ───────────────────────────────── */
.abp-frames-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 12px;
  margin-top: 16px;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}
.abp-frames-grid::-webkit-scrollbar {
  height: 6px;
}
.abp-frames-grid::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}
.abp-frames-grid::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.abp-frame-card {
  flex: 0 0 auto;
  width: 120px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  background: #fff;
}
.abp-frame-card:hover {
  border-color: #93c5fd;
}
.abp-frame-card.selected {
  border-color: #2563eb;
  background: #eff6ff;
}
.abp-frame-card img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 8px;
}
.abp-frame-card .frame-name {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 2px;
}
.abp-frame-card .frame-price {
  font-size: 14px;
  font-weight: 700;
  color: #2563eb;
}

/* ─── Frame Card — Oversized State ──────────────────── */
.abp-frame-card--oversized {
  flex: 0 0 auto;
  width: 120px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  background: #fff;
}
.abp-frame-card--oversized:hover {
  border-color: #93c5fd;
}
.abp-frame-card--oversized.selected {
  border-color: #2563eb;
  background: #ffffff;
}
.frame-oversized-notice {
  font-size: 11px;
  font-weight: 500;
  color: #fcfafa;
  margin-top: 6px;
  padding: 3px 6px;
  background: #8f3a2c;
  border-radius: 3px;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

/* ─── Frame Details Panel ────────────────────────── */
.abp-frame-details {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
}
.abp-frame-details__images {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.abp-frame-details__image {
  flex: 1;
  text-align: center;
}
.abp-frame-details__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.abp-frame-details__image img {
  max-width: 100%;
  max-height: 120px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  object-fit: cover;
}
.abp-frame-details__info {
  font-size: 13px;
}
.abp-frame-details__row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  color: #374151;
}
.abp-frame-details__row span:first-child {
  font-weight: 600;
  color: #6b7280;
}

/* ─── Frame Remove Link ──────────────────────────── */
.abp-remove-frame {
  margin-top: 8px;
  font-size: 13px;
  color: #6b7280;
}
.abp-remove-frame a {
  color: #dc2626;
  font-weight: 500;
  cursor: pointer;
  margin-left: 8px;
  text-decoration: none;
}
.abp-remove-frame a:hover {
  text-decoration: underline;
}

/* ─── Frame Reminder Line ────────────────────────── */
.abp-frame-reminder {
  margin-top: 10px;
  padding: 10px 14px;
  font-size: 13px;
  background: #fef9c3;
  border-radius: 4px;
  color: #854d0e;
  font-weight: 500;
}
.abp-frame-reminder a {
  color: #ca8a04;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 4px;
}
.abp-frame-reminder a:hover {
  color: #a16207;
}

/* ─── Frame Notice Modal ──────────────────────────── */
.abp-frame-notice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.abp-frame-notice {
  background: linear-gradient(135deg, #fff 0%, #fefdfb 100%);
  border: 1px solid #e5d5b0;
  border-radius: 12px;
  padding: 32px 28px 24px;
  max-width: 600px;
  width: 92%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  font-size: 15px;
  line-height: 1.7;
  color: #4b3a2b;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
  -webkit-overflow-scrolling: touch;
}
.abp-frame-notice::-webkit-scrollbar {
  width: 5px;
}
.abp-frame-notice::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}
.abp-frame-notice::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
.abp-frame-notice h3 {
  margin: 0 0 16px;
  font-size: 19px;
  font-weight: 700;
  color: #1a1a1a;
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0e4c8;
}
.abp-frame-notice p {
  margin: 0 0 14px;
  font-size: 15px;
}
.abp-frame-notice p strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.abp-frame-notice ul {
  margin: 0 0 20px;
  padding: 12px 16px 12px 36px;
  background: #fdf8ef;
  border-radius: 6px;
}
.abp-frame-notice ul li {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 500;
  color: #3d2e1a;
  position: relative;
}
.abp-frame-notice ul li::marker {
  color: #c8960c;
}
.abp-frame-notice-btn {
  display: block;
  margin: 0 auto;
  padding: 12px 40px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #c8960c;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.abp-frame-notice-btn:hover {
  background: #a37d0a;
  transform: translateY(-1px);
}
.abp-frame-notice-btn:active {
  transform: translateY(0);
}

/* ─── Frame Image Lightbox ─────────────────────────── */
.abp-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-overflow-scrolling: touch;
}
.abp-lightbox-container {
  position: relative;
  width: 600px;
  max-width: 80vw;
  height: 800px;
  max-height: 80vh;
  background: #fff;
  border-radius: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  cursor: default;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5);
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #e2e8f0;
  -webkit-overflow-scrolling: touch;
}
.abp-lightbox-container::-webkit-scrollbar {
  width: 6px;
}
.abp-lightbox-container::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 0 8px 8px 0;
}
.abp-lightbox-container::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 3px;
}
.abp-lightbox-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: #fff;
  font-size: 20px;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.abp-lightbox-close:hover {
  opacity: 1;
}
.abp-lightbox-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px 8px 0 0;
}

/* ─── Price Display ────────────────────────────────── */
.abp-price-display {
  text-align: left;
}
.abp-price-label {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.2;
}
.abp-price-display .price {
  font-size: 23px;
  font-weight: 700;
  margin-top: 0;
}

/* ─── Price Breakdown ─────────────────────────────── */
.abp-price-breakdown {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  font-size: 14px;
  color: #333333;
}
.abp-price-breakdown__row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}
.abp-price-breakdown__total {
  font-weight: 600;
  color: #333333;
}
.abp-remove-frame-breakdown {
  font-size: 12px;
  color: #dc2626;
  font-weight: 500;
  margin-left: 6px;
  text-decoration: none;
}
.abp-remove-frame-breakdown:hover {
  text-decoration: underline;
}
@media (max-width: 768px) {
  .abp-remove-frame-breakdown {
    display: none;
  }
}

/* ─── Add to Cart ───────────────────────────────────── */
.abp-add-to-cart-wrap {
  margin-top: 16px;
}
.abp-calculator-submit {
  width: 100%;
  box-sizing: border-box;
}

/* ─── Hide native WooCommerce elements ─────────────── */
.abp-calculator-wrapper .quantity,
.abp-calculator-wrapper .single_add_to_cart_button:not(.abp-calculator-submit) {
  display: none !important;
}

/* ─── Loading spinner ──────────────────────────────── */
.abp-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #d1d5db;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: abp-spin 0.6s linear infinite;
  margin-left: 8px;
}
@keyframes abp-spin {
  to { transform: rotate(360deg); }
}

/* ─── Checkbox Label ───────────────────────────────── */
.abp-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 12px;
  font-size: smaller;
}

/* ─── Unit Toggle (Inches / Centimeters) ───────────── */
.abp-unit-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 10px;
}
.abp-unit-toggle__label {
  margin-right: 8px;
  font-size: smaller;
  color: #6b7280;
}
.abp-unit-toggle__btn {
  height: 30px;
  padding: 3px 12px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #6b7280;
  font-size: smaller;
  line-height: 1;
  cursor: pointer;
}
.abp-unit-toggle__btn:first-of-type {
  border-radius: 4px 0 0 4px;
}
.abp-unit-toggle__btn:last-of-type {
  border-radius: 0 4px 4px 0;
  border-left: none;
}
.abp-unit-toggle__btn--active {
  background: #3669d6;
  border-color: #3669d6;
  color: #fff;
  cursor: default;
}
