/* assets/css/promos-frontend.css v 1.0 */

/* --- WRAPPER --- */
.tprp-promos-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
}
.tprp-promos-main {
    flex: 1;
    min-width: 300px;
}

/* --- BARRA FILTRI --- */
.tprp-filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: center;
}
.tprp-filter-btn {
    padding: 8px 15px;
    background: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    display: flex;
    align-items: center;
}
.tprp-filter-btn.active {
    background: var(--tprp-primary-color);
    color: #fff !important;
    border-color: var(--tprp-primary-color);
}

/* --- VIEW BUTTONS --- */
.tprp-view-btn {
    padding: 8px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tprp-icon-view {
    width: 20px;
    height: 20px;
    fill: #666;
    transition: fill 0.3s ease;
}
.tprp-view-btn:not(.active):hover .tprp-icon-view {
    fill: #000;
}
.tprp-view-btn.active {
    background-color: var(--tprp-primary-color) !important;
    border-color: var(--tprp-primary-color) !important;
}
.tprp-view-btn.active .tprp-icon-view {
    fill: #ffffff !important;
}

/* --- GRIGLIA CARD --- */
.tprp-promos-list.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* --- CARD PROMO --- */
.tprp-promo-card-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
}
.tprp-promo-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #eee;
    height: 100%;
    position: relative;
}
.tprp-promo-card-link:hover .tprp-promo-card {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.tprp-promo-poster {
    position: relative;
    overflow: hidden;
    height: 180px;
}
.tprp-promo-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.tprp-promo-card-link:hover .tprp-promo-poster img {
    transform: scale(1.1);
}
.tprp-poster-placeholder,
.tprp-poster-placeholder-large {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 48px;
}
.tprp-poster-placeholder::before,
.tprp-poster-placeholder-large::before {
    content: '??';
}
.tprp-poster-placeholder-large {
    height: 400px;
    border-radius: 8px;
}

/* --- BADGE SCONTO --- */
.tprp-promo-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--tprp-primary-color);
    color: #fff;
    padding: 8px 14px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    z-index: 2;
}
.tprp-promo-badge.tprp-badge-percentage {
    background: #e74c3c;
}
.tprp-promo-badge.tprp-badge-fixed {
    background: #27ae60;
}
.tprp-promo-badge.tprp-badge-bundle {
    background: #f39c12;
}

.tprp-detail-badge {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    border-radius: 25px;
    color: #fff;
    font-weight: 800;
    font-size: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}
.tprp-detail-badge.tprp-badge-percentage { background: #e74c3c; }
.tprp-detail-badge.tprp-badge-fixed { background: #27ae60; }
.tprp-detail-badge.tprp-badge-bundle { background: #f39c12; }

/* --- INFO CARD --- */
.tprp-promo-info {
    padding: 15px;
}
.tprp-promo-title {
    margin: 0 0 8px 0;
    font-size: 1.15rem;
    line-height: 1.3;
    color: #222;
}
.tprp-promo-desc {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 10px 0;
    line-height: 1.4;
}
.tprp-card-countdown {
    font-size: 0.85rem;
    color: #d9534f;
    font-weight: 600;
    margin-top: 8px;
}
.tprp-card-code {
    font-size: 0.85rem;
    background: #fff8e1;
    border: 1px dashed #f39c12;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 8px;
    color: #555;
}
.tprp-card-code code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    color: #d9534f;
}

/* --- VISTA LISTA --- */
.tprp-promo-list-item-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
    margin-bottom: 10px;
}
.tprp-promo-list-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    padding: 15px 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: all 0.2s ease;
    gap: 8px;
}
.tprp-promo-list-item-link:hover .tprp-promo-list-item {
    background: #f9f9f9;
    border-color: var(--tprp-primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.tprp-list-header-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.tprp-list-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
}
.tprp-list-badge.tprp-badge-percentage { background: #e74c3c; }
.tprp-list-badge.tprp-badge-fixed { background: #27ae60; }
.tprp-list-badge.tprp-badge-bundle { background: #f39c12; }

.tprp-list-validity {
    font-size: 13px;
    color: #666;
}
.tprp-list-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.tprp-list-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    flex-grow: 1;
}
.tprp-list-arrow {
    font-size: 1.4rem;
    color: var(--tprp-primary-color);
    margin-left: 15px;
    transition: transform 0.2s ease;
}
.tprp-promo-list-item-link:hover .tprp-list-arrow {
    transform: translateX(5px);
}

/* --- DETTAGLIO PROMO --- */
.tprp-promo-detail-container {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #eee;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}
.tprp-detail-title {
    text-align: center;
    margin: 10px 0 25px 0;
    font-size: 2.2rem;
    line-height: 1.2;
    color: #111;
}
.tprp-detail-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}
.tprp-detail-poster-column {
    flex: 0 0 45%;
    max-width: 50%;
}
.tprp-main-poster {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.tprp-detail-info-column {
    flex: 1;
}
.tprp-detail-meta-box {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f0f0f0;
}
.tprp-detail-meta-box p.tprp-meta-row {
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    line-height: 1.4;
    color: #333;
}
.tprp-detail-meta-box p.tprp-meta-row:last-child { margin-bottom: 0 !important; }
.tprp-meta-row strong {
    min-width: 70px;
    color: #111;
}
.tprp-code-row code.tprp-promo-code {
    background: #fff;
    border: 2px dashed var(--tprp-primary-color);
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 1rem;
    color: #d9534f;
    letter-spacing: 1px;
}
.tprp-detail-description {
    margin-top: 20px;
    line-height: 1.6;
    color: #444;
}
.tprp-detail-description h3 {
    margin-bottom: 10px;
    color: #222;
}

/* --- NAV BACK --- */
.tprp-detail-nav {
    margin-top: 30px;
}
.tprp-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #444 !important;
}
.tprp-icon-back {
    width: 20px;
    height: 20px;
    fill: var(--tprp-primary-color);
    transition: transform 0.3s ease;
}
.tprp-back-btn:hover {
    background: #fff;
    border-color: var(--tprp-primary-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.tprp-back-btn:hover .tprp-icon-back {
    transform: translateX(-4px);
    fill: var(--tprp-hover-color);
}

/* --- MESSAGGIO NESSUNA PROMO --- */
.tprp-no-promos {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 8px;
}

/* --- PROTEZIONE STILI TEMA --- */
.tprp-promos-wrapper a.tprp-clickable,
.tprp-promos-wrapper a.tprp-clickable span {
    color: var(--tprp-primary-color) !important;
    text-decoration: none !important;
    box-shadow: none !important;
    font-weight: bold;
}
.tprp-promos-wrapper a.tprp-clickable:hover,
.tprp-promos-wrapper a.tprp-clickable:hover span {
    color: var(--tprp-hover-color) !important;
}
.tprp-promos-wrapper a.tprp-filter-btn.active,
.tprp-promos-wrapper a.tprp-filter-btn.active span {
    background-color: var(--tprp-primary-color) !important;
    color: #ffffff !important;
    font-weight: bold;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 900px) {
    .tprp-detail-wrapper {
        flex-direction: column;
    }
    .tprp-detail-poster-column {
        max-width: 100%;
        width: 100%;
        margin-bottom: 20px;
    }
    .tprp-detail-title {
        font-size: 1.8rem;
    }
}
@media (max-width: 768px) {
    .tprp-promos-list.view-grid {
        grid-template-columns: 1fr;
    }
    .tprp-promo-list-item {
        gap: 5px;
        padding: 12px;
    }
    .tprp-list-title { font-size: 16px; }
    .tprp-promo-detail-container {
        padding: 15px 10px;
    }
}