
/* ============================================================
   LAYOUT GENERALE
============================================================ */
.ebm-product-view {
    display: flex;
    gap: 40px;
    width: 100%;
}

.ebm-view-left {
    flex: 1;
}

.ebm-view-right {
    flex: 2;
    display: flex;
    flex-direction: column;
}

.ebm-view-left img {
    width: 100%;
}

/* ============================================================
   TITOLI E TESTI
============================================================ */
.ebm-view-title {
    font-size: 2.5rem;
    font-weight: 700;
}

.ebm-view-author {
    color: #666;
    margin-bottom: 10px;
}

.ebm-view-rating-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ebm-rating .dashicons {
    color: #ffb400;
}

/* ============================================================
   DESCRIZIONE (LEGGI TUTTO)
============================================================ */
.ebm-description-container {
    max-height: 120px;
    overflow: hidden;
    position: relative;
    transition: all .3s ease;
}

.ebm-description-container.open {
    max-height: 2000px;
}

.ebm-description-container:not(.open)::after {
    content: "";
    position: absolute;
    bottom: 0;
    height: 50px;
    width: 100%;
    /*background: linear-gradient(transparent, white);*/
    background: transparent;
}

.ebm-read-more-btn {
    display: inline-block;
    margin-top: 10px;
    color: #ddc475 !important;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 600;
}

/* ============================================================
   FORMATI (BOTTONI)
============================================================ */
.ebm-format-selector {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.ebm-format-box {
    padding: 12px 20px;
    border-radius: 8px;
    background: #dae7ee;
    color: #000;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all .2s ease;
    font-weight: 500;
}

/* hover */
.ebm-format-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* selezionato */
.ebm-format-box.active {
    background: #7eafc5;
    color: #fff;
}

.ebm-format-box.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================
   PLAYER + PLAYLIST
============================================================ */
.ebm-audio-player-wrapper {
    margin: 20px 0;
}

.ebm-playlist {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.ebm-track {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background .2s;
}

.ebm-track:hover {
    background: #f7f7f7;
}

.ebm-track.active {
    background: #111;
    color: #fff;
}

/* ============================================================
   DOWNLOAD BUTTON
============================================================ */
.ebm-download-btn {
    padding: 12px 20px;
    border-radius: 8px;
    background: #337887;
    color: #fff !important;
    border: none;
    cursor: pointer;
    width: fit-content;
}

.ebm-download-btn:hover {
    background: #dae7ee;
    color: #000 !important;
}

.ebm-download-btn.disabled {
    background: #dae7ee;
    cursor: not-allowed;
}

/* ============================================================
   TOOLTIP LOGIN
============================================================ */
.ebm-tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.ebm-tooltip-text {
    visibility: hidden;
    background: #333;
    color: #fff;
    padding: 6px;
    border-radius: 6px;
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: .2s;
}

.ebm-tooltip-wrapper:hover .ebm-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ============================================================
   RECENSIONI
============================================================ */
#recensioni {
    display: flex;
    gap: 40px;
    margin-top: 60px;
    align-items: flex-start; 
}

#recensioni > div:first-child {
    flex: 1;
    background: #fff;
    padding: 25px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

#recensioni > div:last-child {
    flex: 2;
}

#recensioni input,
#recensioni textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    background: #EFF2FA;
}

.ebm-review-form {
    flex: 0 0 320px; /* 🔥 larghezza fissa */
}

.ebm-review-list {
    flex: 1;
}

/* stelle recensione */
.star {
    cursor: pointer;
    font-size: 20px;
    color: #ccc;
}

.star.dashicons-star-filled {
    color: #ffb400;
}

/* ============================================================
   EFFETTO COVER 3D
============================================================ */
.ebm-view-left .ebm-img-container {
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all .4s ease;
    border-radius: 8px;
}

.ebm-view-left img {
    transform: scale(1.05);
    transition: transform .6s ease;
}

.ebm-view-left .ebm-img-container:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 25px rgba(0,0,0,0.25);
}

.ebm-view-left .ebm-img-container:hover img {
    transform: scale(1);
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {

    .ebm-product-view {
        flex-direction: column;
    }

    .ebm-view-left,
    .ebm-view-right {
        width: 100%;
    }

    #recensioni {
        flex-direction: column;
    }
}

/* FORM */
.ebm-review-form {
    flex: 1;
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.ebm-review-form input,
.ebm-review-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.ebm-review-form button {
    padding: 12px 20px;
    border-radius: 8px;
    background: #bbd4e0 !important;
    color: #000;
    border: none;
    cursor: pointer;
    width: 100%;
}

.ebm-review-form button:hover {
    background: #7eafc5 !important;
    color: #fff !important;
}

/* STELLE */
.ebm-stars-input .star {
    font-size: 22px;
    cursor: pointer;
    color: #ccc;
}

.ebm-stars-input .star.active {
    color: #ffb400;
}

.ebm-stars-input {
    margin-bottom: 10px;
}

/* LISTA */
.ebm-review-list {
    flex: 2;
}

.ebm-review-card {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.ebm-review-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
}

.ebm-review-title {
    font-weight: bold;
    margin-top: 5px;
}

.ebm-review-content {
    margin-top: 10px;
}

.ebm-stats {
    margin: 30px 0 0 0;
    padding: 15px 20px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    font-size: 14px;
    color: #444;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    font-weight: 500;
}

/* BLOCCO GENERALE */
.ebm-rating-summary {
    display: flex;
    gap: 40px;
    margin: 30px 0;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fff;
}

/* MEDIA */
.ebm-rating-overall {
    flex: 1;
}

.ebm-big-rating {
    font-size: 28px;
    font-weight: bold;
}

.ebm-total-reviews {
    color: #666;
    margin-top: 5px;
}

/* BARRE */
.ebm-rating-bars {
    flex: 2;
}

.ebm-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.ebm-star-label {
    width: 40px;
    font-size: 13px;
}

.ebm-bar {
    flex: 1;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.ebm-bar-fill {
    height: 100%;
    background: #ffb400;
}

.ebm-bar-percent {
    width: 40px;
    font-size: 12px;
    color: #666;
}

.ebm-product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 25px;
}

@media (max-width: 1200px) {
    .ebm-product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .ebm-product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ebm-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ebm-product-grid {
        grid-template-columns: 1fr;
    }
}

.ebm-product-item {
    border-radius: 12px;
    transition: all 0.3s ease;
}

.ebm-grid-title {
    margin-top: 10px;
    padding-left:10px;
    font-weight:600;
}

.ebm-grid-stars {
    padding-left:10px;
}

.ebm-grid-price {
    margin-top: 10px;
    padding-left:10px;
    font-weight:600;
}

.ebm-img-wrapper {
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ebm-img-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.ebm-missing {
    display: block;
    font-size: 12px;
    color: #999;
}

/* per anteprima capitolo */
.ebm-preview-box {
  margin-top: 50px !important;
  padding: 15px;
  border-radius: 10px;
  background: #f8f9fb;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);

  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ebm-preview-box h4 {
  margin-bottom: 10px;
}

.ebm-preview-box .ebm-buttons {
  display: flex;
  gap: 10px;
}

.ebm-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: #337887;
    color: #fff;
}

.ebm-btn:hover {
    background: #dae7ee;
    color: #000 !important;
}

.ebm-btn.secondary {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: #337887;
    color: #fff;
}

.ebm-btn.secondary:hover {
    background: #dae7ee;
    color: #000 !important;
}

.ebm-modal {
    display: none;
    position: fixed !important;
    z-index: 2147483647 !important;

    inset: 0;
    width: 100%;
    height: 100%;

    background: rgba(0,0,0,0.7);

    justify-content: center;
    align-items: flex-start;
    padding-top: 0; 
    padding-bottom: 20px;
}

/* CONTENITORE MODALE */
.ebm-modal-content {
    background: #fff;
    padding: 20px;
    max-width: 800px;
    width: 90%;
    margin-top: 190px; 
    max-height: calc(100vh - 210px);

    overflow-y: auto; /* âœ… scroll attivo */
    
    border-radius: 12px;
    position: relative;
}

body {
    overflow-x: hidden;
}

/* HEADER (titolo) */
.ebm-modal-content h2 {
    margin: 0;
    padding: 15px 20px;
    background: #f5f5f5; /* ðŸ”¥ sfondo diverso */
    border-bottom: 1px solid #ddd;
    font-size: 18px;
}

/* CONTENUTO */
.ebm-reader {
    padding: 20px;
}

/* BOTTONE CHIUSURA */
.ebm-close {
    position: absolute;
    top: 10px;
    right: 15px;

    width: 40px;
    height: 40px;

    font-size: 22px;
    font-weight: bold;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0,0,0,0.1);
    border-radius: 50%;

    cursor: pointer;
    transition: all 0.2s ease;
}

.ebm-close:hover {
    background: rgba(0,0,0,0.2);
    transform: scale(1.1);
}

.ebm-modal-content.audio {
    padding-top: 10px;
}

.ebm-modal-content.audio audio {
    margin-top: 15px; /* ðŸ”¥ spazio sopra il player */
    width: 100%;
}
