/**
 * Majsterkowo Opinie — Consolidated CSS
 * @author Majsterkowo
 */

/* ─── Star Rating Component ──────────────────────────────────────────── */

.mo-stars {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}
.mo-stars .mo-star {
  color: #dee2e6;
  font-size: 20px;
  line-height: 1;
  user-select: none;
}
.mo-stars .mo-star.filled {
  color: #ffc107;
}
.mo-stars.interactive .mo-star {
  cursor: pointer;
  transition: color 0.15s ease, transform 0.1s ease;
}
.mo-stars.interactive .mo-star:hover {
  transform: scale(1.15);
}
.mo-stars.interactive .mo-star.hover {
  color: #ffca2c;
}

/* ─── Product Additional Info (under Add to Cart) ────────────────────── */

.mo-additional-info {
  margin: 20px 0;
  font-weight: 300;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 15px 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.mo-additional-info .mo-best-review {
  flex: 1 1 auto;
  font-style: italic;
  color: #495057;
  padding-right: 20px;
  border-right: 1px solid #dee2e6;
  position: relative;
  padding-left: 25px;
}

.mo-additional-info .mo-best-review .mo-review-text::before {
  content: "\201C";
  font-size: 60px;
  line-height: 1;
  color: #dee2e6;
  position: absolute;
  top: -10px;
  left: -5px;
  font-family: "Times New Roman", Times, serif;
  opacity: 0.5;
  display: block;
  width: 40px;
  height: 40px;
}

.mo-additional-info .mo-best-review .mo-review-author {
  font-weight: 600;
  text-align: right;
  font-style: normal;
  margin-top: 5px;
  font-size: 0.85em;
  color: #212529;
}

.mo-additional-info .mo-links {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 0 0 auto;
  text-align: right;
  padding-left: 10px;
}

.mo-additional-info .mo-links a,
.mo-additional-info .mo-links button {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  text-decoration: none;
  color: #6b868f;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  font-size: 14px;
}

.mo-additional-info .mo-links a:hover,
.mo-additional-info .mo-links button:hover {
  color: #232323;
}

.mo-additional-info .mo-links .material-icons {
  margin-right: 5px;
  font-size: 18px;
}

@media (max-width: 768px) {
  .mo-additional-info {
    flex-direction: column;
    align-items: flex-start;
  }
  .mo-additional-info .mo-best-review {
    border-right: none;
    border-bottom: 1px solid #dee2e6;
    padding-right: 0;
    padding-bottom: 15px;
    margin-right: 0;
    margin-bottom: 15px;
    width: 100%;
  }
  .mo-additional-info .mo-links {
    width: 100%;
    align-items: center;
    text-align: center;
  }
  .mo-additional-info .mo-links a,
  .mo-additional-info .mo-links button {
    justify-content: center;
  }
}

/* ─── Review Comment List ────────────────────────────────────────────── */

#mo-reviews-header {
  padding: 20px 15px;
  color: #232323;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

#mo-reviews-header .mo-comments-nb .material-icons {
  margin-right: 3px;
  vertical-align: middle;
}

.mo-comment-item {
  padding: 26px 0;
  margin: 0 0 20px;
  background-color: #ffffff;
  text-align: left;
}

.mo-comment-item .mo-comment-infos {
  color: #6b868f;
  font-size: 14px;
}

.mo-comment-item .mo-comment-infos .mo-stars {
  margin-bottom: 10px;
}

.mo-comment-item .mo-comment-body .mo-comment-text {
  color: #363a42;
  font-size: 14px;
  line-height: 19px;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Review images */
.mo-review-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mo-review-images .mo-review-img {
  display: block;
  width: 100px;
  height: 100px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mo-review-images .mo-review-img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mo-review-images .mo-review-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Usefulness buttons */
.mo-comment-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.mo-comment-actions button {
  background: none;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 13px;
  color: #6b868f;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.mo-comment-actions button:hover {
  border-color: #6b868f;
  color: #232323;
}

.mo-comment-actions button .material-icons {
  font-size: 16px;
}

.mo-comment-actions .mo-report-abuse {
  margin-left: auto;
  border: none;
  color: #adb5bd;
}
.mo-comment-actions .mo-report-abuse:hover {
  color: #dc3545;
}

/* Pagination */
#mo-reviews-pagination {
  margin-top: 15px;
}
#mo-reviews-pagination ul {
  display: flex;
  flex-wrap: nowrap;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 4px;
}
#mo-reviews-pagination li span {
  display: block;
  width: 32px;
  height: 32px;
  text-align: center;
  line-height: 32px;
  cursor: pointer;
  font-size: 14px;
  color: #6b868f;
  border-radius: 4px;
  transition: all 0.15s ease;
}
#mo-reviews-pagination li.active span {
  font-weight: bold;
  background: #232323;
  color: #fff;
  cursor: default;
}
#mo-reviews-pagination li.disabled span {
  opacity: 0.3;
  cursor: not-allowed;
}
#mo-reviews-pagination li.hidden {
  display: none;
}

#mo-reviews-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

/* ─── Review Modal ───────────────────────────────────────────────────── */

#mo-review-modal .modal-dialog {
  max-width: 640px;
}

#mo-review-modal .modal-header {
  border-bottom: 1px solid #dee2e6;
  padding: 1.25rem 1.5rem;
}

#mo-review-modal .modal-header .h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

#mo-review-modal .modal-body {
  padding: 1.5rem;
}

#mo-product-info {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

#mo-product-info img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

#mo-product-info .mo-product-meta h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

#mo-product-info .mo-grade-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#mo-product-info .mo-grade-row small {
  color: #6c757d;
  font-size: 0.85rem;
}

/* Form fields */
#mo-review-form .form-group {
  margin-bottom: 1.25rem;
}

#mo-review-form label {
  font-weight: 500;
  color: #333;
  margin-bottom: 0.5rem;
  display: block;
}

#mo-review-form textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 0.625rem 0.75rem;
  font-size: 0.9375rem;
  resize: vertical;
  transition: border-color 0.15s ease;
}

#mo-review-form textarea:focus {
  border-color: #80bdff;
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Image upload zone */
.mo-upload-zone {
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafbfc;
}

.mo-upload-zone:hover,
.mo-upload-zone.dragover {
  border-color: #80bdff;
  background: #f0f7ff;
}

.mo-upload-zone .mo-upload-icon {
  font-size: 32px;
  color: #adb5bd;
  margin-bottom: 8px;
}

.mo-upload-zone p {
  margin: 0;
  color: #6c757d;
  font-size: 0.9rem;
}

.mo-upload-zone small {
  color: #adb5bd;
}

.mo-upload-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.mo-upload-previews .mo-preview-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid #dee2e6;
}

.mo-upload-previews .mo-preview-item.uploading {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
}

.mo-upload-previews .mo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mo-upload-previews .mo-preview-item .mo-remove-img {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #dc3545;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.15s ease;
  padding: 0;
  line-height: 1;
}

.mo-upload-previews .mo-preview-item .mo-remove-img:hover {
  transform: scale(1.1);
  background: #c82333;
}

.mo-upload-errors {
  color: #dc3545;
  font-size: 0.85rem;
  margin-top: 8px;
}

/* Modal footer */
#mo-review-modal .modal-footer {
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
}

#mo-review-modal .modal-footer .mo-required-note {
  font-size: 0.8rem;
  color: #6c757d;
}

#mo-review-modal .mo-btn-submit {
  background-color: #232323;
  border-color: #232323;
  color: #fff;
  padding: 0.5rem 1.5rem;
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.2s ease;
}

#mo-review-modal .mo-btn-submit:hover {
  background-color: #000;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

#mo-review-modal .mo-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Post review button */
.mo-btn-write-review {
  height: 36px;
  border-radius: 2px;
  background-color: #6b868f;
  color: #ffffff;
  font-size: 14px;
  box-shadow: 2px 2px 4px 0 rgba(0, 0, 0, 0.2);
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease;
}

.mo-btn-write-review:hover {
  background-color: #3c4d52;
  color: #fff;
  text-decoration: none;
}

.mo-btn-write-review.big {
  height: 45px;
  padding: 13px 16px;
}

/* ─── Lightbox ───────────────────────────────────────────────────────── */

#mo-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: moFadeIn 0.2s ease;
}

#mo-lightbox picture img {
  max-width: 90%;
  max-height: 90%;
  box-shadow: 0 0 30px rgba(0,0,0,0.5);
  border-radius: 4px;
}

@keyframes moFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ─── All Reviews Page (/opinie) ─────────────────────────────────────── */

.mo-all-reviews .mo-review-item {
  padding: 20px 0;
  border-bottom: 1px solid #eee;
}

.mo-all-reviews .mo-review-item:last-child {
  border-bottom: none;
}

.mo-all-reviews .mo-product-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #232323;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 8px;
}

.mo-all-reviews .mo-product-link:hover {
  color: #6b868f;
}

.mo-all-reviews .mo-product-link .material-icons {
  font-size: 18px;
}

.mo-all-reviews .mo-product-cover {
  border-radius: 8px;
  max-width: 100%;
  margin-bottom: 10px;
}

.mo-all-reviews .mo-review-images {
  margin-top: 10px;
}

/* Products to review section */
.mo-products-to-review .product-miniature {
  margin-bottom: 20px;
}

.mo-products-to-review .thumbnail-container {
  border-radius: 8px;
  overflow: hidden;
}

.mo-products-to-review .product-title {
  font-size: 0.9rem;
  margin: 10px 0 5px;
}

.mo-products-to-review .btn-review {
  font-size: 0.85rem;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mo-products-to-review .btn-review .material-icons {
  font-size: 16px;
}

/* Promo banner */
.mo-promo-banner {
  margin-bottom: 1.5rem;
}

.mo-promo-banner img {
  max-width: 100%;
  border-radius: 8px;
}

/* ─── Homepage Widget ────────────────────────────────────────────────── */

.mo-latest-reviews .mo-review-card .card {
  border: none;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.mo-latest-reviews .mo-review-card .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.mo-latest-reviews .mo-review-card .card-img-top {
  height: 220px;
  object-fit: cover;
}

.mo-latest-reviews .no-image-placeholder {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  color: #adb5bd;
}

.mo-latest-reviews .no-image-placeholder .material-icons {
  font-size: 48px;
}

.mo-latest-reviews .mo-rating-overlay {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.6);
  border-radius: 4px;
  padding: 2px 6px;
}

.mo-latest-reviews .mo-rating-overlay .mo-star {
  color: #ffc107;
  font-size: 14px;
}

.mo-latest-reviews .mo-rating-overlay .mo-star.empty {
  color: rgba(255,255,255,0.4);
}

.mo-latest-reviews .card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.mo-latest-reviews .mo-review-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.mo-latest-reviews .mo-review-excerpt {
  font-size: 0.85rem;
  color: #495057;
  margin: 0 0 auto;
  line-height: 1.4;
}

.mo-latest-reviews .mo-review-meta {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #6c757d;
}

.mo-latest-reviews .mo-review-meta .material-icons {
  font-size: 14px;
  vertical-align: middle;
  margin-right: 2px;
}

.mo-latest-reviews .mo-review-meta a {
  color: #6c757d;
  text-decoration: none;
}

.mo-latest-reviews .mo-review-meta a:hover {
  color: #232323;
}

.mo-all-reviews-link {
  text-align: center;
  margin-top: 2rem;
}

/* ─── Pagination (shared) ────────────────────────────────────────────── */

.mo-pagination .pagination {
  justify-content: center;
}

/* ─── Product List Stars (listing) ───────────────────────────────────── */

.mo-product-list-reviews {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.mo-product-list-reviews .mo-stars .mo-star {
  font-size: 16px;
}

.mo-product-list-reviews .mo-comments-nb {
  margin-left: 5px;
  font-size: 13px;
}

/* Spinner */
@keyframes moSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.mo-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #dee2e6;
  border-top-color: #6b868f;
  border-radius: 50%;
  animation: moSpin 0.6s linear infinite;
}

/* Confirm/Alert modal shared */
.mo-alert-modal .modal-body {
  padding: 2rem;
  text-align: center;
}
.mo-alert-modal .material-icons.success {
  font-size: 56px;
  color: #28a745;
  margin-bottom: 1rem;
}
.mo-alert-modal .material-icons.error {
  font-size: 56px;
  color: #dc3545;
  margin-bottom: 1rem;
}
