/* CSS per Plugin Attività Commerciali */

#attivita-commerciali-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Navigazione Tab */
.ac-tabs-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    /*border-bottom: 2px solid #f1f1f1;*/
    flex-wrap: wrap;
    gap: 10px;
}

.ac-tab-btn {
    background: none;
    border: none;
    /*padding: 15px 25px;*/
    cursor: pointer;
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.9px;
    font-family: Smooch Sans, Sans-serif;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    justify-content: center;
    border-radius: 200px;
}

.ac-tab-btn:hover {
    color: #333;
    background-color: #f8f9fa;
}

.ac-tab-btn.active {
    color: #000000;
    background-color: #e7e2d8;
}

.ac-tab-icon {
    font-size: 20px;
}

/* Contenuto Tab */
.ac-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.ac-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Griglia delle attività */
.ac-businesses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Card delle attività */
.ac-business-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* riempi l’altezza della cella */
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    text-decoration: none;
    color: inherit;
}

.ac-business-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: inherit;
}

.ac-business-info {
    flex: 1;
    /* occupa tutto lo spazio rimanente */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* o space-between se vuoi pulsanti in fondo */
    padding: 20px;
}

.ac-business-name {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px 0;
}

.ac-business-contact {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
}

.ac-business-contact a {
    color: #007cba;
    text-decoration: none;
}

.ac-business-contact a:hover {
    text-decoration: underline;
}

.ac-business-excerpt {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
    line-height: 1.4;
}

/* Messaggio per dati di esempio */
.ac-example-notice {
    grid-column: 1 / -1;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.ac-example-notice p {
    margin: 0;
    color: #856404;
}

.ac-example-notice strong {
    color: #533f03;
}

/* Messaggi di errore e stato */
.ac-no-results,
.ac-ajax-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.ac-ajax-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ac-ajax-error p {
    margin: 5px 0;
}

.ac-no-results {
    color: #666;
}

/* Loading spinner */
.ac-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.ac-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== STILI PAGINA SINGOLA ATTIVITÀ ===== */

.ac-single-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Breadcrumb */
.ac-breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.ac-breadcrumb a {
    color: #007cba;
    text-decoration: none;
}

.ac-breadcrumb a:hover {
    text-decoration: underline;
}

.ac-breadcrumb-separator {
    margin: 0 8px;
    color: #999;
}

.ac-breadcrumb-current {
    color: #333;
    font-weight: 600;
}

/* Header dell'attività */
.ac-single-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    align-items: start;
}

.ac-single-image {
    width: 100%;
}

.ac-featured-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.ac-single-info {
    padding: 20px 0;
}

.ac-single-title {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.ac-category-badge {
    margin-bottom: 20px;
}

.ac-category-tag {
    display: inline-block;
    background: #f8f9fa;
    color: #007cba;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #e9ecef;
}

.ac-quick-contact {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #007cba;
}

.ac-contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.ac-contact-item:last-child {
    margin-bottom: 0;
}

.ac-contact-icon {
    font-size: 18px;
    width: 25px;
}

.ac-contact-link {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
}

.ac-contact-link:hover {
    text-decoration: underline;
}

.ac-contact-text {
    color: #555;
}

/* Contenuto principale */
.ac-single-content {
    margin-top: 40px;
}

.ac-single-content h2 {
    color: #333;
    font-size: 24px;
    font-weight: 700;
    margin: 40px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f1f1;
}

.ac-single-content h2:first-child {
    margin-top: 0;
}

/* Galleria */
.ac-gallery-section {
    margin-bottom: 40px;
}

.ac-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.ac-gallery-item {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.ac-gallery-item:hover {
    transform: scale(1.05);
}

.ac-gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Descrizione */
.ac-description-section {
    margin-bottom: 40px;
}

.ac-description-content {
    color: #555;
    line-height: 1.7;
    font-size: 16px;
}

.ac-description-content p {
    margin-bottom: 15px;
}

/* Griglia dettagli */
.ac-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.ac-detail-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ac-detail-card h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f1f1;
}

.ac-detail-content {
    color: #555;
    line-height: 1.6;
}

.ac-contact-row {
    margin-bottom: 10px;
}

.ac-contact-row:last-child {
    margin-bottom: 0;
}

.ac-contact-row strong {
    color: #333;
}

.ac-contact-row a {
    color: #007cba;
    text-decoration: none;
}

.ac-contact-row a:hover {
    text-decoration: underline;
}

/* Modulo di contatto */
.ac-contact-form-section {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 12px;
    margin: 40px 0;
}

.ac-contact-form-container {
    max-width: 600px;
}

.ac-contact-form .ac-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ac-form-group {
    margin-bottom: 20px;
}

.ac-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.ac-form-group input,
.ac-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.ac-form-group input:focus,
.ac-form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.ac-form-actions {
    margin-top: 20px;
}

.ac-btn-primary {
    background-color: #007cba;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
}

.ac-btn-primary:hover:not(:disabled) {
    background-color: #005a87;
}

.ac-btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.ac-form-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    font-weight: 500;
}

.ac-form-message.ac-form-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ac-form-message.ac-form-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Attività correlate */
.ac-related-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #f1f1f1;
}

.ac-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.ac-related-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ac-related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.ac-related-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ac-related-link:hover {
    text-decoration: none;
    color: inherit;
}

.ac-related-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.ac-related-info {
    padding: 20px;
}

.ac-related-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}

.ac-related-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
}

/* Lightbox */
.ac-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: lightboxFadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.ac-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.ac-lightbox-close {
    position: absolute;
    top: -40px;
    right: -40px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.ac-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.ac-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {

    #attivita-commerciali-container,
    .ac-single-container {
        padding: 15px;
    }

    .ac-tabs-nav {
        flex-direction: column;
        align-items: center;
    }

    .ac-tab-btn {
        width: 100%;
        max-width: 300px;
        margin-bottom: 5px;
    }

    .ac-businesses-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Pagina singola responsive */
    .ac-single-header {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ac-featured-image {
        height: 250px;
    }

    .ac-single-title {
        font-size: 24px;
    }

    .ac-contact-form .ac-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .ac-details-grid {
        grid-template-columns: 1fr;
    }

    .ac-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .ac-contact-form-section {
        padding: 25px 20px;
    }

    .ac-lightbox-close {
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .ac-single-title {
        font-size: 22px;
    }

    .ac-featured-image {
        height: 200px;
    }

    .ac-detail-card {
        padding: 20px;
    }

    .ac-contact-form-section {
        padding: 20px 15px;
    }
}

/* === Griglia uniforme + card tutte uguali === */
.ac-businesses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.ac-business-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    text-decoration: none;
    color: inherit;
}

/* Contenuto che riempie lo spazio rimanente per allineare le basi */
.ac-business-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* Se aggiungi un bottone finale, con questo resta sempre in fondo */
.ac-business-info>.ac-business-excerpt {
    margin-top: auto;
}

/* === Immagini: stessa altezza per tutte + crop automatico === */
/* Uso aspect-ratio per avere stessa altezza a parità di colonna.
   object-fit: cover fa il crop automatico per verticali/orizzontali. */
.ac-business-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    /* stessa altezza su tutte le card */
    height: auto;
    display: block;
    object-fit: cover;
    /* CROPPING intelligente */
    object-position: center;
    /* centra il soggetto */
    background: #f5f5f5;
    /* placeholder */
    flex: 0 0 auto;
}

/* Su schermi piccoli puoi preferire un rapporto più alto */
@media (max-width: 640px) {
    .ac-business-image {
        aspect-ratio: 4 / 3;
    }
}

/* Fallback per browser senza aspect-ratio */
@supports not (aspect-ratio: 1 / 1) {
    .ac-business-image {
        height: 200px;
    }

    /* stessa altezza per tutti */
}