/*
 * Product discussions (Diskusie) - "Otázky k produktu"
 * Inherits template fonts. Colours can be overridden by the template:
 *   .pd-discussion { --pd-accent: #e8711a; --pd-seller: #d4343e; }
 */
.pd-discussion {
  --pd-accent: #e8711a;          /* ask box, buttons, links */
  --pd-seller: #d4343e;          /* seller badge */
  --pd-box-border: #000;         /* left border of the rating summary and the ask box */
  --pd-line: rgba(128,128,128,.22);
  --pd-muted: rgba(128,128,128,.95);
  --pd-soft: rgba(128,128,128,.06);
  --pd-avatar-bg: #e4e6ea;       /* customer avatar (initials) - neutral gray */
  --pd-avatar-text: #5b616b;
  --pd-avatar-seller-bg: #6b717c; /* seller avatar - darker gray, white icon */
  max-width: 920px; margin: 0 auto; padding: 8px 0 32px;
}

/* Header */
.pd-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.pd-title { margin: 0; font-size: 1.25em; }
.pd-count { font-weight: normal; color: var(--pd-muted); }

/* Ask box */
.pd-ask { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 18px; border-left: 4px solid var(--pd-box-border); border-radius: 4px; background: var(--pd-soft); }
.pd-ask-icon { flex: none; width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--pd-accent); background: #fff; border: 1px solid var(--pd-line); }
.pd-ask-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd-ask-text span { font-size: .9em; color: var(--pd-muted); }
/* Uses the template's own .button style (same as "Vložiť do košíka"); only layout here */
.pd-ask .pd-ask-btn { flex: none; width: auto; margin: 0; white-space: nowrap; text-decoration: none; }

/* Form */
.pd-form-home { margin: -6px 0 22px; padding: 16px; border: 1px solid var(--pd-line); border-radius: 6px; }
.pd-form-title { margin: 0 0 10px; }
.pd-form .textBox { width: 100%; box-sizing: border-box; }
.pd-form textarea.textBox { min-height: 96px; resize: vertical; }
.pd-form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pd-captcha { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.pd-captcha input { width: 200px; max-width: 100%; }
.pd-captcha-refresh { cursor: pointer; width: 24px; height: 24px; }
.pd-form-note { margin: 8px 0 0; font-size: .85em; color: var(--pd-muted); }
.pd-thread .pd-form { margin: 12px 0 0 52px; }
.pd-info { margin: 0 0 16px; }

/* Threads */
.pd-list { border-top: 1px solid var(--pd-line); }
.pd-empty { padding: 16px 0; }
.pd-thread { padding: 16px 0; border-bottom: 1px solid var(--pd-line); }

.pd-post { display: flex; gap: 12px; align-items: flex-start; }
.pd-body { flex: 1; min-width: 0; }
.pd-avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: .8em; font-weight: bold; letter-spacing: .02em; color: var(--pd-avatar-text);
  background: var(--pd-avatar-bg);
}
.pd-avatar-seller { background: var(--pd-avatar-seller-bg); color: #fff; }
.pd-avatar-logo { background: #fff; border: 1px solid var(--pd-line); overflow: hidden; }
.pd-avatar-logo img { width: 70%; height: 70%; object-fit: contain; }

.pd-post-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 4px; }
.pd-author { font-weight: bold; }
.pd-date, .pd-email { font-size: .85em; color: var(--pd-muted); }
.pd-text { line-height: 1.55; overflow-wrap: anywhere; }

.pd-badge { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: .72em; font-weight: bold; text-transform: uppercase; letter-spacing: .04em; line-height: 1.6; }
.pd-badge-admin { background: var(--pd-seller); color: #fff; }
.pd-badge-pending { background: #fff4d6; color: #8a5a00; }
.pd-pending { opacity: .75; }

/* Replies: indented under the question with a connector line */
.pd-replies { position: relative; margin: 12px 0 0 17px; padding-left: 35px; border-left: 2px solid var(--pd-line); display: flex; flex-direction: column; gap: 12px; }
.pd-replies .pd-post { position: relative; }
.pd-replies .pd-post::before { content: ""; position: absolute; left: -35px; top: 17px; width: 27px; border-top: 2px solid var(--pd-line); }
.pd-reply .pd-avatar { width: 30px; height: 30px; }
.pd-reply.pd-admin .pd-body { padding: 10px 12px; border-radius: 6px; background: var(--pd-soft); }

/* Replies to replies: each level indented under its reply (30px avatar -> line under its centre) */
.pd-node > .pd-replies { margin-left: 14px; }
.pd-reply-to { font-size: .85em; color: var(--pd-muted); }
/* Reply form (top of the tab): the answered post */
.pd-reply-quote { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--pd-line); background: var(--pd-soft); border-radius: 0 4px 4px 0; color: var(--pd-muted); font-size: .9em; overflow-wrap: anywhere; }
.pd-reply-quote strong { color: inherit; }

/* Seller replies written in the admin editor (sanitized HTML) */
.pd-text-html p { margin: 0 0 .5em; }
.pd-text-html p:last-child { margin-bottom: 0; }
.pd-text-html ul, .pd-text-html ol { margin: .3em 0 .5em 1.4em; padding: 0; }
.pd-text-html img { max-width: 100%; height: auto; }
.pd-text-html a { color: var(--pd-accent); text-decoration: underline; }

/* Admin workspace actions */
.pd-actions { margin-top: 6px; display: flex; gap: 12px; }
.pd-btn-link { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; font-size: .88em; }
.pd-btn-link:hover { opacity: .7; }

/* Load more */
.pd-more { text-align: center; margin-top: 20px; }
.pd-more-btn { padding: 10px 22px; border: 1px solid var(--pd-accent); border-radius: 4px; background: none; color: var(--pd-accent); font: inherit; font-weight: bold; cursor: pointer; }
.pd-more-btn:hover { background: var(--pd-accent); color: #fff; }
.pd-more-btn[disabled] { opacity: .5; cursor: wait; }

.pd-login { padding: 12px; background: var(--pd-soft); border-radius: 4px; }

@media (max-width: 600px) {
  .pd-ask { flex-wrap: wrap; }
  .pd-ask-icon { display: none; }
  .pd-ask .pd-ask-btn { width: 100%; text-align: center; }
  .pd-form-cols { grid-template-columns: 1fr; }
  .pd-replies { margin-left: 10px; padding-left: 18px; }
  .pd-replies .pd-post::before { left: -18px; width: 12px; }
  .pd-thread .pd-form { margin-left: 0; }
  .pd-node > .pd-replies { margin-left: 8px; }
}

/* ---- Ratings ---- */
.pd-discussion, .pd-rating-line { --pd-star: #f5a623; --pd-star-off: rgba(128,128,128,.28); }
.pd-stars { position: relative; display: inline-block; line-height: 1; letter-spacing: 2px; white-space: nowrap; vertical-align: middle; }
.pd-stars-bg { color: var(--pd-star-off, rgba(128,128,128,.28)); }
.pd-stars-fill { position: absolute; left: 0; top: 0; overflow: hidden; color: var(--pd-star, #f5a623); }
.pd-stars-s { font-size: .95em; }
.pd-stars-l { font-size: 1.7em; letter-spacing: 4px; }

/* Top row: rating summary + rate/ask box */
.pd-top { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 16px; margin-bottom: 18px; align-items: stretch; }
.pd-top:not(:has(.pd-summary)) { grid-template-columns: 1fr; }
.pd-top .pd-ask { margin-bottom: 0; }
.pd-summary { padding: 14px 16px; border-left: 4px solid var(--pd-box-border); border-radius: 4px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pd-summary-title { font-weight: bold; margin-bottom: 6px; }
.pd-summary-title .pd-count { font-weight: normal; }
.pd-summary-score { font-size: 1.5em; margin-bottom: 2px; }
.pd-summary-score strong { font-size: 1.35em; }
.pd-summary-empty { color: var(--pd-muted); font-size: .9em; }
.pd-summary-dist { margin-top: 10px; display: flex; flex-direction: column; gap: 3px; font-size: .82em; color: var(--pd-muted); }
.pd-dist-row { display: grid; grid-template-columns: 28px 1fr 28px; gap: 8px; align-items: center; }
.pd-dist-row span:last-child { text-align: right; }
.pd-dist-bar { height: 6px; border-radius: 3px; background: var(--pd-star-off); overflow: hidden; }
.pd-dist-bar span { display: block; height: 100%; background: var(--pd-star); }

.pd-ask-buttons { flex: none; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pd-ask .pd-ask-btn-second { background: transparent; color: inherit; border: 1px solid currentColor; }
.pd-ask .pd-ask-btn[aria-expanded="true"] { outline: 2px solid var(--pd-star); outline-offset: 2px; }

/* Star picker in the form */
.pd-rate-field { display: flex; align-items: center; gap: 10px; }
.pd-rate-field[hidden] { display: none; }
.pd-rate-input { display: inline-flex; flex-direction: row-reverse; }
.pd-rate-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pd-rate-input label { font-size: 1.9em; line-height: 1; padding: 0 2px; cursor: pointer; color: var(--pd-star-off); transition: color .1s; }
.pd-rate-input label:hover, .pd-rate-input label:hover ~ label,
.pd-rate-input input:checked ~ label { color: var(--pd-star); }
.pd-rate-input input:focus-visible + label { outline: 2px solid var(--pd-star); border-radius: 3px; }

/* Review cards */
.pd-post-rating { display: inline-flex; }

/* Rating line under the product title */
.pd-rating-line { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 8px; color: inherit; text-decoration: none; font-size: .95em; }
.pd-rating-line:hover .pd-rating-line-count { text-decoration: underline; }
.pd-rating-line-count { opacity: .7; }

@media (max-width: 700px) {
  .pd-top { grid-template-columns: 1fr; }
  .pd-ask-buttons { width: 100%; }
  .pd-ask-buttons .pd-ask-btn { flex: 1; }
}

/* Ask box next to the rating summary: buttons move under the text when space is short */
.pd-top .pd-ask { flex-wrap: wrap; align-content: center; }
.pd-top .pd-ask-text { flex: 1 1 240px; }
.pd-top .pd-ask-buttons { flex: 1 1 auto; justify-content: flex-start; padding-left: 60px; }
@media (max-width: 700px) { .pd-top .pd-ask-buttons { padding-left: 0; } }

/* Flat SVG stars (no font glyphs: some systems draw ★ as a shaded emoji) */
.pd-stars { position: relative; display: inline-block; width: 5.4em; height: 1em; line-height: 1; letter-spacing: 0; vertical-align: -.14em; font-size: 1em; }
.pd-stars-bg, .pd-stars-fill { position: absolute; left: 0; top: 0; height: 100%; overflow: hidden; white-space: nowrap; color: transparent !important; background-repeat: repeat-x; background-size: 1.08em 1em; background-position: 0 0; }
.pd-stars-bg { width: 100%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 24'%3E%3Cpath fill='%23D9DCE1' d='M13 2.2c.4 0 .75.22.92.58l2.6 5.38 5.9.83c.82.12 1.15 1.13.55 1.7l-4.28 4.12 1.03 5.85c.14.81-.71 1.43-1.44 1.05L13 18.92l-5.28 2.79c-.73.38-1.58-.24-1.44-1.05l1.03-5.85L3.03 10.7c-.6-.57-.27-1.58.55-1.7l5.9-.83 2.6-5.38c.17-.36.52-.58.92-.58z'/%3E%3C/svg%3E"); }
.pd-stars-fill { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 24'%3E%3Cpath fill='%23F6B01E' d='M13 2.2c.4 0 .75.22.92.58l2.6 5.38 5.9.83c.82.12 1.15 1.13.55 1.7l-4.28 4.12 1.03 5.85c.14.81-.71 1.43-1.44 1.05L13 18.92l-5.28 2.79c-.73.38-1.58-.24-1.44-1.05l1.03-5.85L3.03 10.7c-.6-.57-.27-1.58.55-1.7l5.9-.83 2.6-5.38c.17-.36.52-.58.92-.58z'/%3E%3C/svg%3E"); }
.pd-stars-s { font-size: 1.05em; }
.pd-stars-l { font-size: 1.6em; letter-spacing: 0; }

/* Star picker: flat stars too */
.pd-rate-input label { width: 1.55em; height: 1.55em; padding: 0; margin-right: 2px; font-size: 1.2em; color: transparent !important; overflow: hidden;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 24'%3E%3Cpath fill='%23D9DCE1' d='M13 2.2c.4 0 .75.22.92.58l2.6 5.38 5.9.83c.82.12 1.15 1.13.55 1.7l-4.28 4.12 1.03 5.85c.14.81-.71 1.43-1.44 1.05L13 18.92l-5.28 2.79c-.73.38-1.58-.24-1.44-1.05l1.03-5.85L3.03 10.7c-.6-.57-.27-1.58.55-1.7l5.9-.83 2.6-5.38c.17-.36.52-.58.92-.58z'/%3E%3C/svg%3E") center / contain no-repeat; }
.pd-rate-input label:hover, .pd-rate-input label:hover ~ label,
.pd-rate-input input:checked ~ label { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 24'%3E%3Cpath fill='%23F6B01E' d='M13 2.2c.4 0 .75.22.92.58l2.6 5.38 5.9.83c.82.12 1.15 1.13.55 1.7l-4.28 4.12 1.03 5.85c.14.81-.71 1.43-1.44 1.05L13 18.92l-5.28 2.79c-.73.38-1.58-.24-1.44-1.05l1.03-5.85L3.03 10.7c-.6-.57-.27-1.58.55-1.7l5.9-.83 2.6-5.38c.17-.36.52-.58.92-.58z'/%3E%3C/svg%3E"); }
.pd-rate-input:hover input:checked ~ label:not(:hover):not(:hover ~ label) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 24'%3E%3Cpath fill='%23D9DCE1' d='M13 2.2c.4 0 .75.22.92.58l2.6 5.38 5.9.83c.82.12 1.15 1.13.55 1.7l-4.28 4.12 1.03 5.85c.14.81-.71 1.43-1.44 1.05L13 18.92l-5.28 2.79c-.73.38-1.58-.24-1.44-1.05l1.03-5.85L3.03 10.7c-.6-.57-.27-1.58.55-1.7l5.9-.83 2.6-5.38c.17-.36.52-.58.92-.58z'/%3E%3C/svg%3E"); }

.pd-dist-star { display: inline-block; width: .95em; height: .9em; vertical-align: -.1em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 24'%3E%3Cpath fill='%23D9DCE1' d='M13 2.2c.4 0 .75.22.92.58l2.6 5.38 5.9.83c.82.12 1.15 1.13.55 1.7l-4.28 4.12 1.03 5.85c.14.81-.71 1.43-1.44 1.05L13 18.92l-5.28 2.79c-.73.38-1.58-.24-1.44-1.05l1.03-5.85L3.03 10.7c-.6-.57-.27-1.58.55-1.7l5.9-.83 2.6-5.38c.17-.36.52-.58.92-.58z'/%3E%3C/svg%3E") center / contain no-repeat; }
.pd-dist-row { grid-template-columns: 34px 1fr 28px; }

/* Eshop admin: clickable rating + set / reset popup */
.pd-rating-line-admin { background: none; border: 1px dashed transparent; border-radius: 4px; padding: 2px 6px; margin-left: -6px; font: inherit; cursor: pointer; }
.pd-rating-line-admin:hover { border-color: rgba(128,128,128,.5); }
.pd-rating-edit-icon { opacity: .55; font-size: .95em; }

/* Mandatory field marker (stars of a rating) */
.pd-required::after { content: " *"; color: #c0392b; }
/* Logged-in customer: name and e-mail from the account, read-only */
.pd-form input.textBox[readonly] { background: var(--pd-soft); color: var(--pd-muted); cursor: default; }
