/*
  VIVIDEAR Components
  Reusable UI patterns for homepage, product templates, article templates, and WooCommerce loops.
*/


/* Buttons and Labels */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  color: var(--primary-blue);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-extrabold);
  line-height: 22px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.eyebrow::before {
  width: 10px;
  height: 10px;
  content: "";
  background: var(--aqua);
  border-radius: var(--radius-pill);
}
.eyebrow--light {
  color: var(--aqua);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 14px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  font-weight: var(--font-weight-extrabold);
  line-height: 1.2;
  transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base), color var(--transition-base);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn--primary {
  color: var(--white);
  background: var(--primary-blue);
}
.btn--primary:hover {
  background: var(--blue-hover);
}
.btn--secondary {
  color: var(--deep-navy);
  background: var(--white);
  border-color: var(--border);
}
.btn--secondary:hover {
  border-color: rgba(61, 126, 255, .28);
}
.btn--light {
  color: var(--deep-navy);
  background: var(--white);
}
.btn--outline {
  color: var(--primary-blue);
  background: transparent;
  border-color: var(--primary-blue);
}
.btn--outline:hover {
  color: var(--white);
  background: var(--primary-blue);
}
.btn--sm {
  min-height: 42px;
  padding: 8px 18px;
  font-size: var(--font-size-sm);
}
.badge {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-black);
  line-height: 22px;
}
.badge--blue { color: var(--primary-blue); background: var(--blue-light); }
.badge--coral { color: var(--coral); background: rgba(242, 106, 90, .12); }
.badge--orange { color: #9a5f00; background: var(--gold-light); }
.badge--teal { color: #18786b; background: var(--teal-light); }
.badge--purple { color: var(--purple); background: rgba(122, 90, 248, .12); }

/*
  Overlay badge: badge positioned inside a card media area.
  Apply .badge--overlay to .badge elements inside card media containers.
  Page CSS should override color/background to suit the context.
*/
.badge--overlay {
  position: absolute;
  inset-block-start: var(--space-3);
  inset-inline-start: var(--space-3);
  z-index: 1;
  margin: 0;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .76);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(12px);
}


/* Branding */

.brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--deep-navy);
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: var(--font-weight-extrabold);
  line-height: 1;
  letter-spacing: .06em;
}
.brand__mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-blue), var(--aqua));
  border-radius: var(--radius-button);
  box-shadow: 0 10px 30px rgba(61, 126, 255, .22);
}
.brand__mark span {
  width: 3px;
  background: var(--white);
  border-radius: var(--radius-pill);
}
.brand__mark span:nth-child(1) {
  height: 12px;
}
.brand__mark span:nth-child(2) {
  height: 22px;
  margin: 0 4px;
}
.brand__mark span:nth-child(3) {
  height: 15px;
}


/* Icons and Floating Cards */

.float-card,
.product-float {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(228, 232, 237, .85);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
}
.float-card strong,
.product-float strong {
  display: block;
  color: var(--deep-navy);
  font-size: var(--font-size-base);
  line-height: 22px;
}
.float-card small,
.product-float small,
.product-float span {
  display: block;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 22px;
}
.mini-icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  color: var(--white);
  border-radius: 16px;
  font-weight: var(--font-weight-black);
}
.mini-icon.blue { background: var(--primary-blue); }
.mini-icon.teal { background: var(--soft-teal); }
.mini-icon.gold { background: var(--gold-accent); }
.outline-icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  color: var(--primary-blue);
  background: var(--blue-light);
  border: 1px solid rgba(61, 126, 255, .18);
  border-radius: 16px;
  font-weight: var(--font-weight-black);
}


/* Section Controls */

.section-heading {
  max-width: 760px;
  margin: 0 auto var(--space-12);
  text-align: center;
}
.section-heading--left {
  margin-inline: 0;
  text-align: start;
}
.section-heading p {
  margin-top: var(--space-4);
  font-size: var(--font-size-lg);
  line-height: 32px;
}
.section-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: 36px;
}
.section-row h2 {
  max-width: 760px;
}
.slider-controls {
  display: flex;
  gap: 10px;
}
.slider-controls button {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: var(--deep-navy);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  font-weight: var(--font-weight-black);
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.slider-controls button:hover {
  color: var(--white);
  background: var(--primary-blue);
  transform: translateY(-2px);
}
.tabs {
  display: flex;
  gap: 10px;
  padding: 8px;
  margin-bottom: 28px;
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.tab {
  min-height: 48px;
  padding: 10px 18px;
  white-space: nowrap;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-radius: 16px;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-black);
}
.tab:hover,
.tab.is-active {
  color: var(--white);
  background: var(--primary-blue);
}


/* Forms */

.newsletter__form {
  display: flex;
  gap: 12px;
  padding: 8px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.newsletter__form input {
  width: 320px;
  min-height: 56px;
  padding: 0 18px;
  color: var(--text-primary);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}


/* Product Cards */

.product-card {
  min-height: 520px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  scroll-snap-align: start;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.product-card__media {
  position: relative;
  height: 240px;
  margin: 14px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.product-card__media::before,
.product-card__media::after {
  position: absolute;
  content: "";
  border-radius: var(--radius-pill) var(--radius-pill) 38px 38px;
}
.product-card__media::before {
  left: 50%;
  top: 48px;
  width: 68px;
  height: 128px;
  background: linear-gradient(180deg, #ffffff, #cfdaf2);
  box-shadow: inset 0 -20px 28px rgba(61, 126, 255, .16), var(--shadow-sm);
  transform: translateX(-50%) rotate(-18deg);
}
.product-card__media::after {
  left: calc(50% + 36px);
  top: 88px;
  width: 32px;
  height: 80px;
  background: linear-gradient(180deg, var(--primary-blue), var(--aqua));
  transform: rotate(15deg);
}
.product-card__media--one { background: linear-gradient(135deg, #f4f8ff, #e1ecff); }
.product-card__media--two { background: linear-gradient(135deg, #f8fbff, #eaf9f6); }
.product-card__media--three { background: linear-gradient(135deg, #fff9e9, #eaf1ff); }
.product-card__media--four { background: linear-gradient(135deg, #f4fff9, #ecf0ff); }
.score {
  position: absolute;
  top: 18px;
  inset-inline-start: 18px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: var(--white);
  background: var(--deep-navy);
  border: 4px solid rgba(255, 255, 255, .78);
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: var(--font-weight-extrabold);
}
.product-card__body {
  padding: 12px 28px 28px;
}
.product-card h3 {
  min-height: 70px;
  margin-bottom: 10px;
  font-size: 25px;
}
.price {
  margin-bottom: 10px;
  color: var(--primary-blue);
  font-size: 17px;
  font-weight: var(--font-weight-black);
}
.product-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-6);
}
.product-card__actions button {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: var(--deep-navy);
  background: var(--blue-light);
  border: 0;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xl);
}
.product-card__actions a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  color: var(--deep-navy);
  background: var(--warm-bg);
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: var(--font-weight-black);
}


/* Article Cards */

.article-card {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.article-card--featured {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
}
.article-card__image {
  display: block;
  overflow: hidden;
  height: 190px;
  margin-bottom: 18px;
  background:
    linear-gradient(180deg, rgba(23, 50, 77, .04), rgba(23, 50, 77, .1)),
    url("../images/Noise-Management-in-Hearing-Aids.webp") center/cover;
  border-radius: var(--radius-lg);
}
.article-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-card--featured .article-card__image {
  height: 420px;
  margin-bottom: 0;
}
.article-card__image--tinnitus { background-image: linear-gradient(180deg, rgba(242, 106, 90, .08), rgba(23, 50, 77, .14)), url("../images/about/about-2.jpg"); }
.article-card__image--wax { background-image: linear-gradient(180deg, rgba(245, 158, 11, .08), rgba(23, 50, 77, .14)), url("../images/about/about-3.jpg"); }
.article-card__image--protect { background-image: linear-gradient(180deg, rgba(61, 185, 166, .08), rgba(23, 50, 77, .14)), url("../images/about/about-4.jpg"); }
.article-card__image--work { background-image: linear-gradient(180deg, rgba(122, 90, 248, .08), rgba(23, 50, 77, .14)), url("../images/about/about-5.jpg"); }
.article-card h3 {
  margin-bottom: 10px;
  font-size: 26px;
}
.article-card h3 a {
  color: inherit;
  text-decoration: none;
}
.article-card h3 a:hover {
  color: var(--primary-blue);
}
.article-card p {
  margin-bottom: 18px;
  font-size: var(--font-size-base);
  line-height: 26px;
}
.article-card a {
  color: var(--primary-blue);
  font-weight: var(--font-weight-black);
}


/* Comparison Tables
   Scoped to .compare-card to prevent conflicts with WooCommerce and Gutenberg tables.
*/

.compare-card {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xxl);
  box-shadow: var(--shadow-md);
}
.compare-card table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
.compare-card caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.compare-card th,
.compare-card td {
  padding: var(--space-6);
  text-align: start;
  border-bottom: 1px solid var(--divider);
}
.compare-card thead th {
  color: var(--deep-navy);
  background: var(--blue-light);
  font-family: var(--font-heading);
  font-size: 22px;
}
.compare-card tbody th {
  color: var(--deep-navy);
  font-weight: var(--font-weight-black);
}
.compare-card tbody td {
  color: var(--text-secondary);
  font-weight: var(--font-weight-bold);
}
.compare-card tr:last-child th,
.compare-card tr:last-child td {
  border-bottom: 0;
}


/* Generic WordPress Pages */

.generic-page {
  background:
    radial-gradient(circle at 8% 8%, rgba(86, 215, 209, .14), transparent 28%),
    linear-gradient(180deg, var(--color-surface-soft), var(--color-surface));
}
.generic-page__intro {
  padding-block: var(--space-12) var(--space-6);
}
.generic-page__breadcrumb {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
  padding: var(--space-2) var(--space-4);
  margin-block-end: var(--space-5);
  color: var(--text-primary);
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(61, 126, 255, .18);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-body);
}
.generic-page__breadcrumb a {
  color: var(--primary-blue);
}
.generic-page__breadcrumb span[aria-hidden="true"] {
  color: var(--soft-teal);
}
.generic-page__intro h1 {
  max-width: 920px;
  margin-block: 0;
}
.generic-page__intro p {
  max-width: 760px;
  margin-block-start: var(--space-4);
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-body);
}
.generic-page__shell {
  max-width: var(--container-narrow);
  padding-block: var(--space-6) var(--space-16);
}
.generic-page__media {
  margin: 0 0 var(--space-8);
}
.generic-page__media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: var(--radius-section);
  box-shadow: var(--shadow-section);
}
.generic-page__content {
  padding: var(--space-10);
  overflow-wrap: anywhere;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}
.generic-page__content > *:first-child {
  margin-block-start: 0;
}
.generic-page__content > *:last-child {
  margin-block-end: 0;
}
.generic-page__content h2,
.generic-page__content h3,
.generic-page__content h4 {
  max-width: 760px;
  color: var(--deep-navy);
}
.generic-page__content h2 {
  margin-block: var(--space-10) var(--space-4);
  font-size: clamp(30px, 3vw, 42px);
  line-height: var(--line-height-heading);
}
.generic-page__content h3 {
  margin-block: var(--space-8) var(--space-3);
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-heading);
}
.generic-page__content h4 {
  margin-block: var(--space-6) var(--space-3);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-heading);
}
.generic-page__content p,
.generic-page__content li {
  max-width: 760px;
  color: var(--text-primary);
  font-size: var(--font-size-md);
  line-height: 1.8;
}
.generic-page__content p {
  margin-block: 0 var(--space-5);
}
.generic-page__content ul,
.generic-page__content ol {
  display: grid;
  gap: var(--space-3);
  max-width: 760px;
  padding-inline-start: var(--space-6);
  margin-block: 0 var(--space-6);
}
.generic-page__content li::marker {
  color: var(--primary-blue);
}
.generic-page__content a {
  color: var(--primary-blue);
  font-weight: var(--font-weight-bold);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.generic-page__content blockquote {
  max-width: 760px;
  padding: var(--space-6);
  margin: var(--space-8) 0;
  color: var(--deep-navy);
  background: var(--blue-light);
  border: 1px solid rgba(61, 126, 255, .14);
  border-inline-start: 5px solid var(--primary-blue);
  border-radius: var(--radius-lg);
}
.generic-page__content figure {
  margin: var(--space-8) 0;
}
.generic-page__content img,
.generic-page__content video,
.generic-page__content iframe {
  max-width: 100%;
  border-radius: var(--radius-lg);
}
.generic-page__content figcaption {
  margin-block-start: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
  text-align: center;
}
.generic-page__content table {
  display: block;
  width: 100%;
  min-width: 0;
  margin-block: var(--space-8);
  overflow-x: auto;
  white-space: nowrap;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.generic-page__content th,
.generic-page__content td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--divider);
}
.generic-page__page-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block-start: var(--space-8);
}


/* Reusable WooCommerce Product Card */

.shop-product-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.shop-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.shop-product-card__media {
  position: relative;
  display: block;
  height: 230px;
  margin: var(--space-4);
  overflow: hidden;
  background: var(--white);
  border-radius: var(--radius-lg);
}
.shop-product-card__media--fallback {
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .84), transparent 24%),
    linear-gradient(135deg, #fff2d5, #f8fbff 48%, #e1ecff);
}
.shop-product-card__media--fallback::before,
.shop-product-card__media--fallback::after {
  position: absolute;
  content: "";
  background: rgba(255, 255, 255, .72);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
}
.shop-product-card__media--fallback::before {
  inset-block-start: 76px;
  inset-inline-start: 50%;
  width: 112px;
  height: 70px;
  border-radius: var(--radius-md);
  transform: translateX(-50%);
}
.shop-product-card__media--fallback::after {
  inset-block-start: 96px;
  inset-inline-start: calc(50% + 28px);
  width: 84px;
  height: 12px;
  background: linear-gradient(90deg, var(--primary-blue), var(--aqua));
  border-radius: var(--radius-pill);
  transform: translateX(-50%);
}
.shop-product-card__fallback-shape {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(61, 126, 255, .12);
  border-radius: var(--radius-circle);
  box-shadow: var(--shadow-xs);
  transform: translate(-50%, -50%);
}
.shop-product-card__media img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: var(--space-4);
}
.shop-product-card__sale-badge {
  position: absolute;
  inset-block-start: var(--space-3);
  inset-inline-start: var(--space-3);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 var(--space-3);
  color: var(--white);
  background: var(--coral);
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-black);
  line-height: var(--line-height-body);
  backdrop-filter: blur(12px);
}
.shop-product-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 0 var(--space-5) var(--space-5);
}
.shop-product-card__brand {
  margin-block-end: var(--space-2);
  color: var(--primary-blue);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-black);
  line-height: var(--line-height-body);
  text-transform: uppercase;
}
.shop-product-card h3 {
  display: -webkit-box;
  min-height: 78px;
  margin-block: 0 var(--space-3);
  overflow: hidden;
  font-size: var(--font-size-xl);
  line-height: var(--line-height-heading);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.shop-product-card h3 a {
  color: inherit;
  text-decoration: none;
}
.shop-product-card h3 a:hover {
  color: var(--primary-blue);
}
.shop-product-card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  min-height: 48px;
  margin-block: 0 var(--space-4);
  color: var(--deep-navy);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-extrabold);
}
.shop-product-card__price del {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
}
.shop-product-card__price ins {
  color: var(--primary-blue);
  font-weight: var(--font-weight-black);
  text-decoration: none;
}
.shop-product-card__bottom {
  display: grid;
  gap: var(--space-3);
  width: 100%;
  margin-block-start: auto;
}
.shop-product-card__rating {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: 54px;
  padding: var(--space-3);
  margin: 0;
  background: var(--blue-light);
  border: 1px solid rgba(61, 126, 255, .14);
  border-radius: var(--radius-md);
}
.shop-product-card__rating span {
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-body);
  text-transform: uppercase;
}
.shop-product-card__rating strong {
  color: var(--deep-navy);
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  line-height: 1;
}
.shop-product-card__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  width: 100%;
  margin: 0;
}
.shop-product-card__actions .btn,
.shop-product-card__actions button {
  width: 100%;
  min-height: 46px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-button);
  font-size: var(--font-size-sm);
  justify-content: center;
  text-align: center;
}
.shop-product-card__actions button {
  color: var(--deep-navy);
  background: var(--color-surface-soft);
  border: 1px solid var(--border);
  font-weight: var(--font-weight-extrabold);
}

@media (max-width: 640px) {
  .shop-product-card__media {
    height: auto;
    aspect-ratio: 1 / 1;
  }
}
