/* PhantomTweaks — custom overrides.
   This file is preserved across theme updates. All new component styles here. */

/* ================= Nav brand icon fix ================= */

.nav__brand-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(0, 180, 106, 0.5));
  transition: filter 0.3s ease;
}

.nav__brand:hover .nav__brand-icon {
  filter: drop-shadow(0 0 14px rgba(0, 180, 106, 0.7));
}

/* ================= Feedback stats ================= */

.feedback-stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.feedback-stats__rating {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.feedback-stats__number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 48px;
  line-height: 1;
  color: var(--cl-text);
}

.feedback-stats__max {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--cl-muted);
}

.feedback-stats__stars {
  display: flex;
  gap: 4px;
}

.feedback-stats__count {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--cl-muted);
}

/* ================= Cart drawer ================= */

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  visibility: hidden;
}

.cart-drawer.open {
  pointer-events: auto;
  visibility: visible;
}

.cart-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cart-drawer.open .cart-drawer__overlay {
  opacity: 1;
}

.cart-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  background: var(--cl-panel);
  border-left: 1px solid var(--cl-border);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer.open .cart-drawer__panel {
  transform: translateX(0);
}

.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--cl-border);
}

.cart-drawer__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.cart-drawer__title svg {
  color: rgb(var(--cl-accent));
}

.cart-drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--cl-border);
  color: var(--cl-muted);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.cart-drawer__close:hover {
  color: var(--cl-text);
  border-color: rgba(0, 180, 106, 0.5);
  background: var(--cl-soft);
}

.cart-drawer__items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
}

.cart-drawer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  gap: 12px;
  color: var(--cl-muted);
}

.cart-drawer__empty svg {
  opacity: 0.4;
  color: var(--cl-muted);
}

.cart-drawer__empty p {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--cl-text);
}

.cart-drawer__empty span {
  font-size: 14px;
}

.cart-drawer__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--cl-border);
}

.cart-drawer__item:last-child {
  border-bottom: none;
}

.cart-drawer__item-img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--cl-border);
  flex-shrink: 0;
}

.cart-drawer__item-img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cl-soft);
  color: rgb(var(--cl-accent));
}

.cart-drawer__item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cart-drawer__item-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-drawer__item-price {
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgb(var(--cl-accent-hi));
}

.cart-drawer__item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cart-drawer__qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--cl-border);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--cl-muted);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.cart-drawer__qty-btn:hover {
  color: var(--cl-text);
  border-color: rgba(0, 180, 106, 0.5);
  background: var(--cl-soft);
}

.cart-drawer__qty-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.cart-drawer__item-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--cl-muted);
  transition: color 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
}

.cart-drawer__item-remove:hover {
  color: #ff5f57;
  background: rgba(255, 95, 87, 0.1);
}

.cart-drawer__footer {
  padding: 18px 22px;
  border-top: 1px solid var(--cl-border);
  background: var(--cl-bg-alt);
}

.cart-drawer__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 14px;
}

.cart-drawer__total-label {
  color: var(--cl-muted);
}

.cart-drawer__total-price {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--cl-text);
}

.cart-drawer__footer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-drawer__checkout {
  display: flex;
}

/* ================= Nav cart button ================= */

.nav__cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--cl-border);
  color: var(--cl-text);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav__cart:hover {
  border-color: rgba(0, 180, 106, 0.5);
  background: var(--cl-soft);
  color: rgb(var(--cl-accent-hi));
}

.nav__cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: linear-gradient(120deg, rgb(var(--cl-accent-hi)), rgb(var(--cl-accent)));
  color: #03120a;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.nav__account {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--cl-border);
  color: var(--cl-text);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav__account:hover {
  border-color: rgba(0, 180, 106, 0.5);
  background: var(--cl-soft);
  color: rgb(var(--cl-accent-hi));
}

/* ================= Button states ================= */

.btn--full {
  width: 100%;
}

.btn--cart-add {
  color: var(--cl-text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--cl-border);
}

.btn--cart-add:hover {
  border-color: rgba(0, 180, 106, 0.6);
  color: rgb(var(--cl-accent-hi));
  background: var(--cl-soft);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px -12px var(--cl-glow);
}

.btn--cart-add.added {
  border-color: rgb(var(--cl-accent));
  background: var(--cl-soft);
  color: rgb(var(--cl-accent-hi));
}

/* ================= Product card (redesigned) ================= */

.product-card__link {
  display: block;
  text-decoration: none;
}

.product-card__img-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--cl-bg-alt);
  border: 1px solid var(--cl-border);
  margin-bottom: 4px;
}

.product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-card__img {
  transform: scale(1.05);
}

.product-card__img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cl-muted);
  opacity: 0.4;
}

.product-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #03120a;
  background: linear-gradient(120deg, rgb(var(--cl-accent-hi)), rgb(var(--cl-accent)));
  border-radius: 999px;
  padding: 4px 12px;
  box-shadow: 0 4px 12px -4px rgba(0, 180, 106, 0.6);
}

.product-card__badge--out {
  background: linear-gradient(120deg, #ff7b7b, #ff5f57);
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(255, 95, 87, 0.6);
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 0;
}

.product-card__name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.product-card__name a {
  color: var(--cl-text);
  transition: color 0.2s ease;
}

.product-card__name a:hover {
  color: rgb(var(--cl-accent-hi));
}

.product-card__desc {
  color: var(--cl-muted);
  font-size: 13.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.product-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product-card__sales {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cl-muted);
}

.product-card__sales svg {
  color: rgb(var(--cl-accent));
}

.product-card__actions {
  display: flex;
  gap: 10px;
}

.product-card__actions .btn {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 10px;
}

.product-card__buy {
  text-align: center;
}

/* ================= Reviews (redesigned) ================= */

.review__head {
  margin-bottom: 4px;
}

.review__stars {
  display: flex;
  align-items: center;
  gap: 3px;
}

.review__star--filled {
  color: #ffc53d;
}

.review__star--empty {
  color: var(--cl-border);
}

.review__rating {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cl-muted);
  margin-left: 8px;
}

.review__comment {
  font-size: 14px;
  color: var(--cl-muted);
  line-height: 1.6;
  margin-bottom: 6px;
}

.review__verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: rgb(var(--cl-accent-hi));
  margin-bottom: 10px;
}

.review__verified svg {
  color: rgb(var(--cl-accent));
}

.review__author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--cl-border);
}

.review__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cl-soft);
  border: 1px solid rgba(0, 180, 106, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: rgb(var(--cl-accent-hi));
  flex-shrink: 0;
}

.review__author b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.review__date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cl-muted);
}

/* ================= Product hero (redesigned) ================= */

.product-hero__image {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--cl-border);
  box-shadow: var(--shadow);
  object-fit: cover;
}

.product-hero__fallback {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--cl-bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--cl-border);
  overflow: hidden;
}

.product-hero__fallback .product-hero__ring { position: absolute; }
.product-hero__fallback .product-hero__ring--1 { width: 280px; height: 280px; }
.product-hero__fallback .product-hero__ring--2 { width: 200px; height: 200px; }

.product-hero__ghost-wrap {
  position: relative;
  z-index: 2;
}

.product-hero__content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.product-hero__short-desc {
  color: var(--cl-muted);
  font-size: 16px;
  line-height: 1.6;
}

.product-hero__price-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.product-hero__price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: rgb(var(--cl-accent-hi));
}

.product-hero__sales {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--cl-muted);
}

.product-hero__sales svg {
  color: rgb(var(--cl-accent));
}

.product-hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.product-hero__cart-btn {
  flex: 1;
  min-width: 160px;
}

.product-hero__delivery {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--cl-muted);
}

.product-hero__delivery svg {
  color: rgb(var(--cl-accent));
}

.product-hero__full-desc {
  margin-top: 40px;
}

.product-description {
  color: var(--cl-muted);
  font-size: 15px;
  line-height: 1.7;
}

.product-description h1,
.product-description h2,
.product-description h3 {
  font-family: var(--font-display);
  color: var(--cl-text);
  margin: 24px 0 10px;
}

.product-description p {
  margin-bottom: 14px;
}

.product-description ul,
.product-description ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.product-description ul { list-style: disc; }
.product-description ol { list-style: decimal; }

.product-description a {
  color: rgb(var(--cl-accent-hi));
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product-hero__reviews {
  margin-top: 48px;
}

/* ================= Products toolbar (search + filters) ================= */

.products-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}

.products-search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 380px;
}

.products-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cl-muted);
  pointer-events: none;
}

.products-search__input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cl-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--cl-text);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

:root[data-scheme="light"] .products-search__input {
  background: #fff;
}

.products-search__input::placeholder {
  color: var(--cl-muted);
}

.products-search__input:focus {
  border-color: rgba(0, 180, 106, 0.6);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px var(--cl-soft);
}

:root[data-scheme="light"] .products-search__input:focus {
  background: #fff;
}

/* ================= Cart page ================= */

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--cl-border);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

:root[data-scheme="light"] .cart-item {
  background: linear-gradient(160deg, #ffffff, #f7faf8);
}

.cart-item__img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--cl-border);
  flex-shrink: 0;
}

.cart-item__info {
  flex: 1;
  min-width: 0;
}

.cart-item__name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.cart-item__price {
  font-family: var(--font-mono);
  font-size: 14px;
  color: rgb(var(--cl-accent-hi));
}

.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cart-item__qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--cl-border);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--cl-muted);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.cart-item__qty-btn:hover {
  color: var(--cl-text);
  border-color: rgba(0, 180, 106, 0.5);
  background: var(--cl-soft);
}

.cart-item__qty-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  min-width: 28px;
  text-align: center;
}

.cart-item__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--cl-muted);
  transition: color 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
}

.cart-item__remove:hover {
  color: #ff5f57;
  background: rgba(255, 95, 87, 0.1);
}

.cart-summary {
  padding: 24px;
  border: 1px solid var(--cl-border);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

:root[data-scheme="light"] .cart-summary {
  background: linear-gradient(160deg, #ffffff, #f7faf8);
}

.cart-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
}

.cart-summary__row b {
  font-family: var(--font-display);
  font-weight: 700;
}

/* ================= Section header left align ================= */

.section__head--left {
  text-align: left;
}

/* ================= Responsive additions ================= */

@media (max-width: 640px) {
  .product-card__actions {
    flex-direction: column;
  }

  .product-card__actions .btn {
    width: 100%;
    text-align: center;
  }

  .cart-item {
    flex-wrap: wrap;
  }

  .cart-item__qty {
    order: 3;
  }

  .products-search {
    max-width: 100%;
  }

  .product-hero__actions {
    flex-direction: column;
  }

  .product-hero__cart-btn {
    width: 100%;
  }
}