#searchInput {
    padding: 10px;
    width: 450px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 20px;   /* space between search bar and grid */
}

#searchInput:focus {
    outline: none;
    border: 1px solid grey;
}

#gridContainerLocandine {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns */
    margin-left: -15px;
}

#gridContainerOfferteSpeciali {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns */
    margin-left: -15px;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    #gridContainerLocandine {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on smaller screens */
    }

    #gridContainerOfferteSpeciali {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on smaller screens */
    }
}
#footer {
    text-align: center;
    vertical-align: middle;
    line-height: 20px; 
    position: relative;
    bottom: 0px;
    left: 0px;
    right: 0px;
    height: 150px;
    margin-bottom: 0px;
}
#notifica_copia {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px;
    background-color: #00cc00;
    color: white;
    border-radius: 5px;
    display: none;
    z-index: 2000;
}
.hidden {
    display: none;
}

.howitwork {
    font-size: 1.3rem;
    margin: 0 auto;
    margin-left: 10%;
    position: relative;
    text-align: justify;
    width: 80%;
    padding-bottom: 50px;
}

.tooltip-wrapper .tooltip_contatto {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s !important;
    max-width: none !important; /* Override Bootstrap's max-width */
    width: 300px !important; /* Adjust the width as needed */
    background: white !important;
    color: black !important;
    border-radius: 10px !important; /* Adjust as needed for rounded corners */
    text-align: left;
    pointer-events: none;
}

#mnu-email a:hover {
    background-color: transparent !important;
}

#mnu-faq a:hover {
    background-color: transparent !important;
}

#mnu-phone-wrapper:hover .tooltip-wrapper .tooltip_contatto {
    opacity: 1;
    visibility: visible;
}

.tooltip_contatto .tooltip-inner {
    padding: 10px;
    background: white !important;
    max-width: none !important; /* Override Bootstrap's max-width */
    width: 300px !important; /* Adjust the width as needed */
}

.tooltip_contatto .tooltip-section {
    padding: 10px;
    border-bottom: 1px solid grey;
}

.tooltip_contatto .tooltip-section:last-child {
    border-bottom: none;
}

.tooltip_contatto .tooltip-inner {
    padding: 10px;
    background: white !important;
    max-width: none !important; /* Override Bootstrap's max-width */
    width: 300px !important; /* Adjust the width as needed */
}

.tooltip_contatto .tooltip-section {
    padding: 10px;
    border-bottom: 1px solid grey;
}

.tooltip_contatto .tooltip-section:last-child {
    border-bottom: none;
}

.call-btn, .consult-btn {
    display: inline-block;
    padding: 5px 10px;
    margin-bottom: 10px;
    text-decoration: none;
    color: white;
    border-radius: 8px !important;
}

.call-btn {
    background: blue;
}

.consult-btn {
    background: white;
    border: 2px solid blue;
    color: blue;
}

/* Add a spike to the tooltip */
.tooltip_contatto::before {
    content: '';
    position: absolute;
    top: -5px; /* Position of the spike */
    left: 20%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid white; /* Adjust color to match your tooltip background */
}

.grid-item-offerte-speciali.non-clickable {
    pointer-events: none;
    /*opacity: 0.6; !* Visually indicate that the item is not active/available *!*/
    cursor: not-allowed;
}

/* Make grid items responsive */
.grid-item-offerte-speciali {
    width: 100%;
    max-width: 294px;
    min-width: 280px;
}

/* Additional mobile responsiveness for smaller screens */
@media (max-width: 480px) {
    #gridContainerOfferteSpeciali {
        grid-template-columns: 1fr; /* Single column on very small screens */
        gap: 15px;
        padding: 0 10px;
    }
}

/* Better spacing for mobile */
@media (max-width: 768px) {
    #gridContainerOfferteSpeciali {
        gap: 15px;
        padding: 0 10px;
    }
}

/* AI Badge Styles */
.image-container {
    position: relative;
    overflow: visible; /* Changed from hidden to visible for negative margins */
}

.ai-badge {
    position: absolute;
    top: -5px; /* Negative margin */
    left: -5px; /* Negative margin */
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    padding: 6px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-badge:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.ai-icon {
    width: 28px; /* Bigger icon */
    height: 28px; /* Bigger icon */
    display: block;
}

/* AI Summary Modal */
.ai-summary-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.ai-summary-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    max-height: 80vh;
    width: 90%;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.ai-summary-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-summary-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ai-summary-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.ai-summary-text {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    line-height: 1.6;
    color: #333;
}

.ai-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ai-tab {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

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

.ai-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.ai-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

.ai-tab-content h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.1rem;
}

.ai-tab-content p {
    margin: 0;
    line-height: 1.6;
    color: #555;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    font-size: 1.1rem;
    color: #666;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

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

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .ai-badge {
        top: -3px;
        left: -3px;
        padding: 4px;
    }
    
    .ai-icon {
        width: 22px;
        height: 22px;
    }
    
    .ai-summary-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .ai-summary-header {
        padding: 15px;
    }
    
    .ai-summary-header h3 {
        font-size: 1.2rem;
    }
    
    .ai-summary-body {
        padding: 15px;
    }
    
    .ai-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .ai-tab {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* AI Summary Bubble - Simple version */
.ai-summary-bubble {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 800px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 
                0 8px 24px rgba(102, 126, 234, 0.08);
    border: 1px solid #e8eaf0;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.ai-summary-bubble.show {
    opacity: 1;
    visibility: visible;
}

/* Custom scrollbar for modal */
.ai-summary-bubble::-webkit-scrollbar {
    width: 8px;
}

.ai-summary-bubble::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.ai-summary-bubble::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    transition: background 0.2s;
}

.ai-summary-bubble::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Remove the arrow since it's centered */
.ai-summary-bubble::before {
    display: none;
}

/* Modal backdrop */
.ai-summary-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-summary-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.ai-summary-header {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 18px;
    font-size: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8eaf0;
}

.ai-summary-close {
    background: #f1f5f9;
    color: #64748b;
    font-size: 24px;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    font-weight: 300;
}

.ai-summary-close:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: scale(1.05);
}

.ai-summary-text {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

.ai-summary-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
    padding: 20px 0;
}

.bubble-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Tabs for AI summary */
.ai-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e8eaf0;
    overflow-x: auto;
    padding-bottom: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none; /* Hide scrollbar for IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.ai-tabs::-webkit-scrollbar {
    display: none;
}

.ai-tab {
    background: transparent;
    border: none;
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px 8px 0 0;
    white-space: nowrap;
    position: relative;
    outline: none;
    letter-spacing: 0.01em;
}

.ai-tab:hover {
    background: #f8fafc;
    color: #475569;
    transform: translateY(-1px);
}

.ai-tab.active {
    color: #667eea;
    background: linear-gradient(to bottom, #f0f4ff 0%, #ffffff 100%);
}

.ai-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -2px 8px rgba(102, 126, 234, 0.3);
}

.ai-tab-contents {
    position: relative;
    height: 280px;
    padding: 4px 0;
    overflow-y: auto;
}

.ai-tab-content {
    display: none;
    color: #334155;
    font-size: 14px;
    line-height: 1.75;
    padding: 8px 4px;
}

.ai-tab-content.active {
    display: block;
    animation: fadeInSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom scrollbar for tab contents */
.ai-tab-contents::-webkit-scrollbar {
    width: 6px;
}

.ai-tab-contents::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.ai-tab-contents::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.ai-tab-contents::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Better formatting for list items in content */
.ai-tab-content br {
    display: block;
    content: "";
    margin: 0.5em 0;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ai-summary-bubble {
        max-width: 95%;
        width: 95%;
        padding: 20px;
        font-size: 13px;
        max-height: 90vh;
    }
    
    .ai-summary-text {
        font-size: 13px;
    }
    
    .ai-summary-header {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .ai-tabs {
        gap: 2px;
        margin-bottom: 16px;
    }
    
    .ai-tab {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .ai-tab-content {
        font-size: 13px;
        line-height: 1.65;
        padding: 6px 2px;
    }
    
    .ai-tab-contents {
        height: 220px;
    }
}

/* Modal AI Recap Styles */
.offer-ai-recap {
    background: transparent;
}

.modal-ai-tab {
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 6px 12px !important;
}

.modal-ai-tab:hover {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: white !important;
}

.modal-ai-tab.active {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: white !important;
}

.modal-ai-tab-content {
    animation: fadeIn 0.2s ease;
    color: #555;
}

.modal-ai-tab-content::-webkit-scrollbar {
    width: 5px;
}

.modal-ai-tab-content::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
}

.modal-ai-tab-content::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
}

.modal-ai-tab-content::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

@media (max-width: 768px) {
    .modal-ai-tab {
        font-size: 11px;
        padding: 5px 10px !important;
    }
    
    .modal-ai-tab-content {
        font-size: 13px;
        padding: 10px !important;
        max-height: 150px !important;
    }
}