/* ================================================================
   Bitdefender Konfigurator – Styles
   ================================================================ */

:root {
  --bd-red:       #ff0000;
  --bd-red-dark:  #cc0000;
  --bd-red-light: #fff0f0;
  --bd-text:      #1a1a1a;
  --bd-muted:     #666;
  --bd-border:    #e0e0e0;
  --bd-bg:        #f8f8f8;
  --bd-white:     #ffffff;
  --bd-radius:    12px;
  --bd-shadow:    0 4px 24px rgba(0,0,0,.08);
  --bd-trans:     0.22s ease;
}

/* ── Wrapper ── */
.bd-konfigurator {
  max-width: 1290px;
  margin: 56px auto 0;
  padding: 0 16px;
  font-family: inherit;
  color: var(--bd-text);
}

/* ── Sections row (desktop) ── */
.bd-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

@media (min-width: 900px) {
  .bd-sections {
    flex-direction: row;
    align-items: stretch;
  }
  .bd-sections .bd-section {
    flex: 1;
    margin-bottom: 0;
  }
}

/* ── Section ── */
.bd-section {
  background: var(--bd-white);
  border: 1px solid var(--bd-border);
  border-radius: var(--bd-radius);
  padding: 28px 32px;
  transition: box-shadow var(--bd-trans);
}
.bd-section:hover {
  box-shadow: var(--bd-shadow);
}

.bd-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.bd-section-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bd-red);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.bd-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--bd-text);
}

/* ── Platforms ── */
.bd-platforms {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.bd-platform-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 28px;
  border: 2px solid var(--bd-border);
  border-radius: var(--bd-radius);
  background: var(--bd-white);
  cursor: pointer;
  transition: border-color var(--bd-trans), background var(--bd-trans), transform var(--bd-trans), box-shadow var(--bd-trans);
  font-size: 14px;
  font-weight: 600;
  color: var(--bd-text);
  min-width: 120px;
  position: relative;
}

.bd-platform-btn:hover {
  border-color: var(--bd-red);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255,0,0,.12);
}

.bd-platform-btn[aria-pressed="true"],
.bd-platform-btn.active {
  border-color: var(--bd-red);
  background: var(--bd-red-light);
  color: var(--bd-red);
  box-shadow: 0 4px 16px rgba(255,0,0,.15);
}

.bd-platform-btn[aria-pressed="true"]::after,
.bd-platform-btn.active::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 13px;
  color: var(--bd-red);
  font-weight: 700;
}

.bd-plat-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bd-plat-icon svg {
  width: 36px;
  height: 36px;
  fill: currentColor;
}

/* ── Slider ── */
.bd-slider-wrap {
  margin-top: 0;
}

.bd-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--bd-red) 0%, var(--bd-border) 0%);
  outline: none;
  cursor: pointer;
}

.bd-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bd-red);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255,0,0,.3);
  transition: transform var(--bd-trans), box-shadow var(--bd-trans);
}

.bd-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 14px rgba(255,0,0,.4);
}

.bd-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bd-red);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(255,0,0,.3);
}

/* Input dokładnej liczby */
.bd-exact-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.bd-exact-wrap label {
  font-size: 13px;
  color: var(--bd-muted);
  white-space: nowrap;
}

.bd-device-input {
  width: 80px;
  padding: 8px 10px;
  border: 2px solid var(--bd-border);
  border-radius: 8px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--bd-text);
  transition: border-color var(--bd-trans);
  -moz-appearance: textfield;
}
.bd-device-input::-webkit-outer-spin-button,
.bd-device-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.bd-device-input:focus {
  outline: none;
  border-color: var(--bd-red);
}

/* ── Add-ons ── */
.bd-addons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.bd-addon-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border: 2px solid var(--bd-border);
  border-radius: var(--bd-radius);
  background: var(--bd-white);
  cursor: pointer;
  transition: border-color var(--bd-trans), background var(--bd-trans), transform var(--bd-trans), box-shadow var(--bd-trans);
  font-size: 14px;
  font-weight: 600;
  color: var(--bd-text);
}

.bd-addon-btn:hover {
  border-color: var(--bd-red);
  transform: translateY(-1px);
}

.bd-addon-btn[aria-pressed="true"],
.bd-addon-btn.active {
  border-color: var(--bd-red);
  background: var(--bd-red-light);
  color: var(--bd-red);
}

.bd-addon-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.bd-addon-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.bd-addon-check {
  opacity: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--bd-red);
  transition: opacity var(--bd-trans);
}
.bd-addon-btn[aria-pressed="true"] .bd-addon-check,
.bd-addon-btn.active .bd-addon-check {
  opacity: 1;
}

/* ── Results header ── */
.bd-results-section {
  margin-top: 32px;
}
.bd-results-header {
  margin-bottom: 24px;
  text-align: center;
}
.bd-results-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--bd-text);
}
.bd-results-subtitle {
  margin: 0;
  color: var(--bd-muted);
  font-size: 14px;
}

/* ── Results grid ── */
.bd-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ── Flip Card ── */
.bd-card {
  height: 500px;
  perspective: 1000px;
  cursor: pointer;
}

.bd-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--bd-radius);
}

.bd-card.is-flipped .bd-card-inner {
  transform: rotateY(180deg);
}

.bd-card-front,
.bd-card-back {
  position: absolute;
  inset: 0;
  border-radius: var(--bd-radius);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  padding: 28px 24px;
  border: 1px solid var(--bd-border);
  background: var(--bd-white);
  overflow: hidden;
}

/* Front — items flow top-down; flip hint pushed to bottom via margin-top: auto */
.bd-card-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  box-shadow: var(--bd-shadow);
  transition: box-shadow var(--bd-trans);
}
.bd-card:hover .bd-card-front {
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}

.bd-card-img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  flex-shrink: 0;
}

.bd-card-front-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bd-card-name {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 2px;
  color: var(--bd-text);
  line-height: 1.3;
}

.bd-card-meta {
  font-size: 12px;
  color: var(--bd-muted);
  margin-bottom: 4px;
}

.bd-card-price {
  color: var(--bd-red);
  font-size: 18px;
  font-weight: 800;
}

.bd-card-price del {
  font-size: 13px;
  color: var(--bd-muted);
  font-weight: 400;
  margin-right: 4px;
}

.bd-card-flip-hint {
  margin-top: auto;
  font-size: 12px;
  color: var(--bd-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.bd-card-flip-hint svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.bd-card-note {
  width: 100%;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  color: #7a5c00;
  text-align: left;
  line-height: 1.4;
}

.bd-card-note--info {
  background: #f0f4ff;
  border-color: #c5d0f0;
  color: #3a4a80;
}

/* Back */
.bd-card-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--bd-shadow);
}

.bd-card-back-top {
  flex: 1;
}

.bd-card-back-name {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--bd-text);
}

.bd-card-desc {
  font-size: 12px;
  color: var(--bd-muted);
  line-height: 1.5;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Feature list (card front) ── */
.bd-feat-tagline {
  font-size: 11px;
  color: var(--bd-muted);
  line-height: 1.5;
  margin: 0;
  font-style: italic;
}

.bd-feat-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  width: 100%;
  text-align: left;
}

.bd-feat-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--bd-text);
  margin-bottom: 3px;
}

.bd-feat-icon {
  width: 14px;
  height: 14px;
  fill: var(--bd-red);
  flex-shrink: 0;
}

.bd-var-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--bd-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

/* ── Variant selector ── */
.bd-var-select {
  margin-bottom: 10px;
}

.bd-var-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.bd-var-row--hidden {
  display: none;
}

.bd-var-label {
  font-size: 11px;
  color: var(--bd-muted);
  font-weight: 600;
  white-space: nowrap;
  min-width: 60px;
}

.bd-var-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.bd-var-btn {
  padding: 4px 9px;
  border: 1.5px solid var(--bd-border);
  border-radius: 6px;
  background: var(--bd-white);
  font-size: 11px;
  font-weight: 600;
  color: var(--bd-muted);
  cursor: pointer;
  transition: border-color var(--bd-trans), background var(--bd-trans), color var(--bd-trans);
  line-height: 1.4;
}

.bd-var-btn:hover {
  border-color: var(--bd-red);
  color: var(--bd-red);
}

.bd-var-btn.active {
  border-color: var(--bd-red);
  background: var(--bd-red-light);
  color: var(--bd-red);
}

.bd-var-btn--hidden {
  display: none;
}

.bd-card-price-back {
  font-size: 20px;
  font-weight: 800;
  color: var(--bd-red);
  margin: 8px 0 10px;
}
.bd-card-price-back del {
  font-size: 13px;
  color: var(--bd-muted);
  font-weight: 400;
  margin-right: 4px;
}

.bd-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bd-card-flip-back {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--bd-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color var(--bd-trans), background var(--bd-trans);
}
.bd-card-flip-back:hover {
  color: var(--bd-text);
  background: var(--bd-bg);
}
.bd-card-flip-back svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ── Buttons ── */
.bd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--bd-trans), color var(--bd-trans), transform var(--bd-trans), box-shadow var(--bd-trans);
  text-decoration: none;
  border: 2px solid transparent;
  width: 100%;
  text-align: center;
}
.bd-btn:hover {
  transform: translateY(-1px);
}

.bd-btn-primary {
  background: var(--bd-red);
  color: #fff;
  border-color: var(--bd-red);
}
.bd-btn-primary:hover {
  background: var(--bd-red-dark);
  border-color: var(--bd-red-dark);
  box-shadow: 0 4px 14px rgba(255,0,0,.35);
}
.bd-btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.bd-btn-outline {
  background: transparent;
  color: var(--bd-red);
  border-color: var(--bd-red);
}
.bd-btn-outline:hover {
  background: var(--bd-red-light);
}

/* ── Placeholder ── */
.bd-placeholder {
  text-align: center;
  padding: 60px 20px;
  color: var(--bd-muted);
}
.bd-placeholder-icon {
  margin-bottom: 16px;
}
.bd-placeholder-icon svg {
  width: 56px;
  height: 56px;
  fill: var(--bd-border);
}
.bd-placeholder p {
  font-size: 15px;
  margin: 0;
}

/* ── Skeleton loader ── */
.bd-skeleton {
  border-radius: var(--bd-radius);
  height: 500px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: bd-shimmer 1.4s infinite;
}

@keyframes bd-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Card entrance animation ── */
.bd-card {
  animation: bd-card-in 0.35s ease both;
}

@keyframes bd-card-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger delays for cards */
.bd-card:nth-child(1) { animation-delay: 0.05s; }
.bd-card:nth-child(2) { animation-delay: 0.10s; }
.bd-card:nth-child(3) { animation-delay: 0.15s; }
.bd-card:nth-child(4) { animation-delay: 0.20s; }
.bd-card:nth-child(5) { animation-delay: 0.25s; }

/* ── Toast notification ── */
.bd-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  padding: 14px 22px;
  border-radius: 10px;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(0,0,0,.2);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 320px;
}
.bd-toast.bd-toast--success {
  background: #1a7a1a;
}
.bd-toast.bd-toast--error {
  background: #c00;
}
.bd-toast.bd-toast--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .bd-section {
    padding: 20px 18px;
  }
  .bd-platforms {
    gap: 8px;
  }
  .bd-platform-btn {
    min-width: auto;
    padding: 14px 18px;
    flex: 1 1 calc(50% - 4px);
  }
  .bd-plat-icon svg {
    width: 28px;
    height: 28px;
  }
  .bd-results {
    grid-template-columns: 1fr;
  }
  .bd-card {
    height: 440px;
  }
  .bd-toast {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .bd-section-title {
    font-size: 16px;
  }
  .bd-addons {
    flex-direction: column;
  }
  .bd-addon-btn {
    width: 100%;
  }
}
