/**
 * Offerte Template Styles - Mobile First
 * Designed for optimal mobile experience
 */

@font-face {
    font-family: 'Timsans';
    src: url('../webfonts/timsans-heavy.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

/* La topnav (loghi 26px, padding verticale 12px, ecc.) è ora definita in
   style.css del child, caricato site-wide, così è identica su tutte le pagine. */

.offerta-single {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 100%;
    padding: 0 16px;
    margin: 0 auto;
}

/* Offerte Header Styling */
.offerte-header {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.single-offerte .it-header-center-content-wrapper {
    padding: 24px 0;
}

/* Offerte Header Actions */
.offerte-header-actions {
    display: flex;
    align-items: center;
}

.offerte-back-button {
    color: #0066cc;
    text-decoration: none;
    font-size: 14px;
    padding: 10px 20px;
    border: 1px solid #0066cc;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    white-space: nowrap;
}

.offerte-back-button:hover {
    background: #0066cc;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.offerte-back-button::before {
    content: '←';
    font-weight: bold;
    font-size: 16px;
}

/* Mobile responsive for back button */
@media (max-width: 767px) {
    .offerte-back-button {
        padding: 8px 12px;
        font-size: 12px;
    }

    .offerte-back-button span {
        display: none;
    }

    .offerte-back-button::after {
        content: 'Indietro';
        margin-left: 4px;
    }
}

/* Header Styles - Custom Header (fallback) */
.offerta-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 0;
}

.offerta-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.offerta-logo img {
    max-height: 40px;
    width: auto;
}

.offerta-site-title {
    font-size: 20px;
    font-weight: 700;
    color: #0066cc;
    text-decoration: none;
}

.btn-back {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #f5f5f5;
    color: #0066cc;
}

/* Hero Section */
.offerta-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 84px;
    overflow: hidden;
}

.offerta-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.offerta-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 49, 154, 0.85) 0%,
        rgba(30, 58, 138, 0.75) 45%,
        rgba(0, 0, 0, 0.3) 100%
    );
    z-index: 2;
}

.offerta-hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
}

.offerta-hero-inner {
    text-align: center;
    color: #fff;
    padding: 40px 0;
}

.offerta-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 24px 0;
    line-height: 1.2;
}

.offerta-pricing {
    margin: 24px 0 32px 0;
    text-align: center;
}

.offerta-price-old {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: line-through;
    margin-bottom: 8px;
}

.offerta-price-current {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.offerta-discount {
    display: inline-block;
    background: #ff4757;
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.offerta-excerpt {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin: 24px 0 32px 0;
    line-height: 1.5;
}

.offerta-cta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.btn-offerta-primary,
.btn-offerta-secondary {
    display: inline-block;
    padding: 16px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    min-width: 200px;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-offerta-primary {
    background: #0066cc;
    color: #fff;
    border: 2px solid #0066cc;
}

.btn-offerta-primary:hover {
    background: #0052a3;
    border-color: #0052a3;
    transform: translateY(-2px);
}

.btn-offerta-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}

.btn-offerta-secondary:hover {
    background: #fff;
    color: #0066cc;
    transform: translateY(-2px);
}

/* Content Section */
.offerta-content {
    padding: 40px 0;
    background: #fff;
}

.offerta-content-inner {
    max-width: 800px;
    margin: 0 auto;
}

.offerta-thumbnail {
    margin-bottom: 32px;
    text-align: center;
}

.offerta-thumbnail img {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.offerta-description {
    font-size: 16px;
    line-height: 1.8;
    color: #444;
}

.offerta-description h2,
.offerta-description h3,
.offerta-description h4 {
    color: #0066cc;
    margin: 32px 0 16px 0;
    font-weight: 600;
}

.offerta-description ul,
.offerta-description ol {
    padding-left: 24px;
    margin: 16px 0;
}

.offerta-description li {
    margin-bottom: 8px;
}

/* Contact Section */
.offerta-contact {
    background: #f8f9fa;
    padding: 40px 0;
}

.offerta-contact-inner {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.offerta-contact h2 {
    font-size: 24px;
    color: #0066cc;
    margin: 0 0 16px 0;
    font-weight: 600;
}

.offerta-contact p {
    font-size: 16px;
    color: #666;
    margin: 0 0 32px 0;
}

.offerta-contact-methods {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-method {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.contact-method:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    color: inherit;
    text-decoration: none;
}

.contact-icon {
    font-size: 24px;
    margin-right: 16px;
    flex-shrink: 0;
}

.contact-info {
    text-align: left;
    flex: 1;
}

.contact-info strong {
    display: block;
    font-size: 16px;
    color: #0066cc;
    margin-bottom: 4px;
}

.contact-info span {
    font-size: 14px;
    color: #666;
}

/* Tablet Styles (768px and up) */
@media (min-width: 768px) {
    .container {
        max-width: 750px;
    }

    .offerta-title {
        font-size: 36px;
    }

    .offerta-price-current {
        font-size: 48px;
    }

    .offerta-excerpt {
        font-size: 20px;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }

    .offerta-cta {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }

    .offerta-content {
        padding: 60px 0;
    }

    .offerta-contact-methods {
        flex-direction: row;
        gap: 20px;
    }

    .contact-method {
        flex: 1;
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }

    .contact-icon {
        margin: 0 0 12px 0;
        font-size: 32px;
    }

    .contact-info {
        text-align: center;
    }

    section.hero-offerta .hero-title {
        font-size: 2.5rem !important;
    }

    section.hero-offerta .hero-subtitle {
        font-size: 1.5rem !important;
    }
}

/* Desktop Styles (992px and up) */
@media (min-width: 992px) {
    .container {
        max-width: 970px;
    }

    .offerta-title {
        font-size: 42px;
    }

    .offerta-hero-inner {
        padding: 60px 0;
    }

    .offerta-content {
        padding: 80px 0;
    }

    .offerta-contact {
        padding: 60px 0;
    }
}

/* Large Desktop Styles (1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1170px;
    }

    .offerta-title {
        font-size: 48px;
    }

    .offerta-hero-inner {
        padding: 80px 0;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }

.hero-price-badge-topleft {
    background: white;
    border: 2px solid var(--tim-blue);
    padding: 1rem 1.2rem;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-price-badge-topleft .price-amount {
    font-size: 3rem;
    font-weight: 900;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    font-family: "Timsans", sans-serif;
}

.hero-price-badge-topleft .price-amount .price-decimal {
    font-size: 1.2rem;
    display: inline;
    white-space: nowrap;
    line-height: 1;
}


.hero-price-badge-topleft .price-period {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0;
    text-align: start;
    min-width: 50px;
}

.hero-price-badge-topleft .price-pill {
    background: var(--tim-blue, #122ac2);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    width: 100%;
}

.offer-card {
    background: var(--tim-blue, #122ac2);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(18, 42, 194, 0.3);
    color: white;
    z-index: 2;
    position: relative;
}

section.hero-offerta > .container {
    max-width: 900px;
}

section.hero-offerta .hero-title {
    font-size: 1.5rem;
    margin-bottom: .5rem;
    text-shadow: 1px 1px 1px rgba(0,0,0,.4), 3px 3px 5px rgba(0, 0, 0, 0.9)
}

section.hero-offerta .hero-subtitle {
    font-size: 1rem;
    line-height: 1.2;
    color: white;
    margin: 0;
    font-weight: 400;
    text-shadow: 1px 1px 1px rgba(0,0,0,.4), 2px 2px 4px rgba(0, 0, 0, 0.9)
}

section.hero-offerta .hero-image {
    /* larga quasi quanto tutto l'hero; quadrata così la creatività (1:1) riempie il box */
    width: 95%;
    aspect-ratio: 1 / 1;
    height: auto;
    max-height: 640px;
    /* angoli stondati coerenti con il form .offer-card; padding = cornice "safe area" */
    overflow: hidden;
    border-radius: 28px;
    clip-path: inset(0 round 28px);
    line-height: 0;
    background: #1428bf;
    padding: 8px;
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.20);
    position: absolute;
    left: 0;
    bottom: 0;
    /* sopra l'effetto di dissolvenza (::after / .hero-fader), ma sotto al form (z-index:2) */
    z-index: 1;
}

/* Alert errori dentro la card offerta */
.offer-form-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 14px;
}

/* Secondo form (sotto la descrizione) */
.offerta-form-inline {
    max-width: 480px;
    margin: 40px auto 0;
}

/* Bordo animato dell'input telefono (spostato dall'inline <style>) */
.border-beam-wrapper {
    position: relative;
    border-radius: 8px;
    padding: 0;
    background: transparent;
}

.border-beam-wrapper::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 10px;
    padding: 2px;
    background: conic-gradient(from var(--angle), transparent 70%, #ef4444 80%, #ff6b6b 90%, #ef4444 95%, transparent 100%);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: subtract;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: subtract;
    animation: borderBeamRotate 2s linear infinite;
    --angle: 0deg;
}

.border-beam-wrapper .form-input {
    position: relative;
    z-index: 1;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    outline: none;
    background: white;
}

@keyframes borderBeamRotate {
    0% { --angle: 0deg; }
    100% { --angle: 360deg; }
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}