.sp-section-profile-product {
  background: inherit;
}

.sp-section-profile-product-content {
  padding: 24px 16px;
}

/* Header */
.sp-section-profile-product-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.sp-section-profile-product-title {
  font-family: var(--bs-font-header);
  color: var(--bs-color-base-100);
  font-size: 28px;
  margin: 0 0 8px;
}

.sp-section-profile-product-subtitle {
  font-family: var(--bs-font-roboto);
  color: var(--bs-color-base-100);
  margin: 0;
}

.sp-section-profile-product-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Buttons — styled via global bs-button classes */
.sp-section-profile-product-btn-mail,
.sp-section-profile-product-btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
}

/* Two-column layout */
.sp-section-profile-product-columns {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 24px;
}

/* Image column */
.sp-section-profile-product-image {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* Woocommerce image gallery size override */
@media (min-width: 922px) {
  .woocommerce #content .ast-woocommerce-container div.product .sp-section-profile-product-image div.images,
  .woocommerce .ast-woocommerce-container div.product .sp-section-profile-product-image div.images,
  .woocommerce-page #content .ast-woocommerce-container div.product .sp-section-profile-product-image div.images,
  .woocommerce-page .ast-woocommerce-container div.product .sp-section-profile-product-image div.images {
    width: 100%;
  }
}

.sp-section-profile-product-image img {
  max-width: 100%;
  height: auto;
  display: block;
}

.sp-section-profile-product-image-zoom {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  color: var(--bs-color-base-100);
  opacity: 0.5;
  cursor: pointer;
}

/* Tabs column */
.sp-section-profile-product-tabs {
  display: flex;
  flex-direction: column;
}

/* Tab navigation */
.sp-section-profile-product-tab-nav {
  display: flex;
  width: 100%;
  gap: 12px;
}

.sp-section-profile-product-tab-btn {
  width: 45%;
  background: #fff;
  border: 1px solid var(--bs-color-base-10);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 14px 20px;
  font-family: var(--bs-font-roboto);
  font-size: 15px;
  font-weight: 600;
  color: var(--bs-color-base-100);
  cursor: pointer;
}

/* Hover — override Astra's default blue hover border */
.sp-section-profile-product-tab-btn:hover {
  background: var(--bs-color-base-10);
  color: var(--bs-color-base-100);
  border-color: var(--bs-color-base-10);
}

/* Focus / active states — override Astra's default focus background and outline.
   Order matters: .active comes AFTER these so the selected tab keeps its visual
   when both .active and :focus apply simultaneously. */
.sp-section-profile-product-tab-btn:focus-visible,
.sp-section-profile-product-tab-btn:focus,
.sp-section-profile-product-tab-btn:active {
  color: var(--bs-color-base-100);
  background-color: var(--bs-color-base-00);
  border-color: var(--bs-color-base-10);
}

.sp-section-profile-product-tab-btn.active {
  background: var(--bs-color-base-10);
  border-color: var(--bs-color-base-10);
  color: var(--bs-color-base-100);
}

/* Tab content */
.sp-section-profile-product-tab-content {
  display: none;
  padding: 20px;
  background: var(--bs-color-base-10);
}

.sp-section-profile-product-tab-content.active {
  display: block;
}

/* Measurements table */
.sp-section-profile-product-measurements {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-family: var(--bs-font-roboto);
  font-size: 14px;
}

.sp-section-profile-product-measurements thead tr {
  background: #ded9cd;
}

/* Override Astra's default cell border (table, td, th { border: 1px solid var(--ast-border-color) })
   so we only show the borders we want — Astra's selector has specificity 0,0,1; ours 0,1,1 wins. */
.sp-section-profile-product-measurements th,
.sp-section-profile-product-measurements td {
  border: none;
  border-bottom: 1px solid #ded9cd;
  text-align: left;
  padding: 6px 12px;
  color: var(--bs-color-base-100);
}

.sp-section-profile-product-measurements th {
  padding: 8px 12px;
  font-weight: 600;
}

/* Vertical separator between Mål-group (cols 1–2) and Vinkel-group (cols 3–4).
   In the header, "Mål" is th:first-child (colspan=2). In the body, col 2 = td:nth-child(2). */
.sp-section-profile-product-measurements thead th:first-child,
.sp-section-profile-product-measurements tbody td:nth-child(2) {
  border-right: 1px solid #ded9cd;
}

.sp-section-profile-product-measurements tbody tr:nth-child(odd) {
  background: #ffffff;
}

.sp-section-profile-product-measurements tbody tr:nth-child(even) {
  background: #f2efe9;
}

/* Detail lines */
.sp-section-profile-product-detail {
  font-family: var(--bs-font-roboto);
  font-size: 14px;
  color: var(--bs-color-base-100);
  margin: 0 0 8px;
}

/* Blindfalse title */
.sp-section-profile-product-blindfalse-title {
  font-family: var(--bs-font-roboto);
  font-size: 16px;
  font-weight: 600;
  color: var(--bs-color-base-100);
  margin: 16px 0 8px;
}

/* Length buttons */
.sp-section-profile-product-length-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

/* Length data panels */
.sp-section-profile-product-length-data {
  display: none;
}

.sp-section-profile-product-length-data.active {
  display: block;
}

/* Addons */
.sp-section-profile-product-addons {
  margin-top: 20px;
}

.sp-section-profile-product-addons-title {
  font-family: var(--bs-font-roboto);
  font-size: 15px;
  font-weight: 600;
  color: var(--bs-color-base-100);
  margin: 0 0 12px;
}

.sp-section-profile-product-addon {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: #f9f8f5;
  border-radius: 4px;
}

.sp-section-profile-product-addon-media {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sp-section-profile-product-addon-image {
  max-width: 100%;
  height: auto;
  border-radius: 2px;
}

.sp-section-profile-product-addon-description {
  font-family: var(--bs-font-roboto);
  font-size: 13px;
  color: var(--bs-color-base-100);
  line-height: 1.5;
}

.sp-section-profile-product-addon-products {
  font-family: var(--bs-font-roboto);
  font-size: 14px;
  color: var(--bs-color-base-100);
}

.sp-section-profile-product-addon-product-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}

.sp-section-profile-product-addon-product-icon {
  flex-shrink: 0;
  font-size: 16px;
  color: var(--bs-color-action-100);
  margin-top: 1px;
}

.sp-section-profile-product-addon-product-info {
  line-height: 1.5;
}

/* Price section */
.sp-section-profile-product-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 16px;
  border-top: 1px solid #e0ddd5;
  gap: 4px;
}

.sp-section-profile-product-price-total {
  font-family: var(--bs-font-roboto);
  font-size: 18px;
  color: var(--bs-color-base-100);
}

.sp-section-profile-product-price-vat {
  font-family: var(--bs-font-roboto);
  font-size: 13px;
  color: var(--bs-color-base-100);
  opacity: 0.7;
}

/* Added to cart modal */
.sp-section-profile-product-added-to-card-modal:open {
  position: relative;

  box-shadow: #00000029 0pt 3pt 6pt;
  border: 0;
  border-radius: 0;

  padding: 0;
}

.sp-section-profile-product-added-to-card-modal .sp-section-profile-product-added-to-card-modal-header {
  display: flex;
  flex-flow: row nowrap;
  justify-content: space-between;
  align-items: center;

  margin-top: 32px;
  margin-left: 32px;
  margin-right: 32px;
  margin-bottom: 16px;

  font-size: 24px;
}

@media (min-width: 1024px) {
  .sp-section-profile-product-added-to-card-modal .sp-section-profile-product-added-to-card-modal-header {
    font-size: 30px;
  }
}

.sp-section-profile-product-added-to-card-modal .sp-section-profile-product-added-to-card-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;

  display: flex;

  cursor: pointer;
}

.sp-section-profile-product-added-to-card-modal .sp-section-profile-product-added-to-card-modal-content {
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;
  align-items: center;
  row-gap: 16px;

  margin-left: 32px;
  margin-right: 32px;
  margin-bottom: 32px;
}

.sp-section-profile-product-added-to-card-modal .sp-section-profile-product-added-to-card-modal-content > * {
  width: fit-content;
}

.sp-section-profile-product-added-to-card-modal .sp-section-profile-product-added-to-card-modal-content > .bs-button-primary {
  display: flex;
  flex-flow: row nowrap;
  justify-content: center;
  align-items: center;
  column-gap: 8px;
}

/* ------------------------------------------------------------------
   Modal: Send profile to email (Phase 2)
   Visuelt match med cart-bliktud's modal (samme paddings, farver,
   border-radii). Section-specifik praefix saa CSS-scope er korrekt
   selv naar baade cart og profile-modaler eksisterer paa samme side
   (sjaeldent, men teoretisk muligt).
   ------------------------------------------------------------------ */
.sp-section-profile-product-mail-modal {
  border: none;
  border-radius: 8px;
  padding: 0;
  max-width: 500px;
  width: calc(100vw - 32px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.sp-section-profile-product-mail-modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.sp-section-profile-product-mail-modal-inner {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.sp-section-profile-product-mail-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--bs-color-base-20, #edeade);
  gap: 12px;
}

.sp-section-profile-product-mail-modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  color: var(--bs-color-base-100, #1a1710);
}

.sp-section-profile-product-mail-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.375rem;
  line-height: 1;
  color: var(--bs-color-base-60, #8a7e68);
  padding: 2px 4px;
  border-radius: 2px;
  transition: color 0.15s ease;
}

.sp-section-profile-product-mail-modal-close:hover {
  color: var(--bs-color-base-100, #1a1710);
}

.sp-section-profile-product-mail-modal-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 24px;
}

.sp-section-profile-product-mail-modal-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--bs-color-base-80, #453f2e);
}

.sp-section-profile-product-mail-modal-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--bs-color-base-30, #e5e0d4);
  border-radius: 4px;
  font-size: 1rem;
  color: var(--bs-color-base-100, #1a1710);
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.sp-section-profile-product-mail-modal-input:focus {
  outline: none;
  border-color: var(--bs-color-action-100, #000);
}

.sp-section-profile-product-mail-modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--bs-color-base-20, #edeade);
}

/* Status-besked (succes/fejl) — toggled via [hidden] + modifier-klasse fra mail-modal.js */
.sp-section-profile-product-mail-modal-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 0.875rem;
  line-height: 1.4;
  border: 1px solid transparent;
}

.sp-section-profile-product-mail-modal-status--success {
  background: #e8f5e9;
  color: #1b5e20;
  border-color: #66bb6a;
}

.sp-section-profile-product-mail-modal-status--error {
  background: #fdecea;
  color: #c0392b;
  border-color: #e74c3c;
}

.sp-section-profile-product-mail-modal-status--info {
  background: #f5f0e3;
  color: #453f2e;
  border-color: #e5e0d4;
}

/* Send-knap disabled-state under AJAX-request */
.sp-section-profile-product-mail-modal [data-submit-mail][disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Desktop layout */
@media (min-width: 1024px) {
  .sp-section-profile-product-content {
    padding: 48px 32px;
  }

  .sp-section-profile-product-header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
  }

  .sp-section-profile-product-title {
    font-size: 40px;
    font-weight: var(--bs-font-alexandria-medium-weight);
  }

  .sp-section-profile-product-tab-nav {
    width: 50%;
  }

  .sp-section-profile-product-tab-btn {
    width: 50%;
  }

  .sp-section-profile-product-columns {
    display: grid;
    grid-template-columns: 45% 55%;
    gap: 32px;
    align-items: start;
  }

  .sp-section-profile-product-addon {
    flex-direction: row;
  }

  .sp-section-profile-product-addon-media {
    flex: 0 0 200px;
  }
}
