/**
 * Frontend Styles - Eleva Pharma Manager
 * 
 * @package ElevaPharmaManager
 * @since 1.0.0
 */


/* RESETS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6, p {
    margin: 0 !important;
}

/* WORDPRESS BLOCKS STYLE */
.wp-block-group.boxed .wp-block-group__inner-container {
    width: min(var(--global-content-width), 90vw);
    max-width: 100%;
    margin-inline: auto;
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

/* HERO STYLES */
#hero.boxed {
    width: 100%;
    max-width: min(var(--global-content-width), 100%);
    margin-inline: auto;
    display: flex;
    gap: 4rem;
    align-items: stretch;
}

.epm-hero-pharma {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.16);
    position: relative;
}

.epm-hero-pharma__featured {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 3rem 2rem 2rem 2rem;
    outline: 1px solid #444;
    border-radius: 1rem;
}

/*.epm-hero-pharma__image {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    flex-shrink: 0;
}

.epm-hero-pharma__image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    display: block;
    object-fit: cover;
}*/

.epm-hero-pharma__logo {
    width: 200px;
    height: auto;
}

.epm-hero-pharma__logo img {
    width: 100%;
    height: auto;
    max-height: 60px;
    object-fit: contain;
    display: block;
}

.epm-hero-pharma__content {
    z-index: 2;
    text-align: center;
}

.epm-hero-pharma__title {
    font-size: 2rem;
    line-height: 1.2;
    padding-block: 0.75rem;
}

.epm-hero-pharma .epm-status-badge {
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2rem;
}

.epm-hero-pharma__featured .epm-hero-pharma__orari span.epm-hero-orari {
    background: linear-gradient(45deg, #4365e1, #4890e3);
    padding: 0.25rem 0.5rem;
    border-radius: 2rem;
    color: #fff;
}

.epm-hero-next-opening {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    flex-wrap: wrap;
}

.epm-hero-next-opening-text,
.epm-hero-next-opening-time {
    display: inline-block;
}

.epm-hero-pharma .epm-farmacia-contacts {
    margin: 2rem 0 0;
    justify-content: center;
    background-color: transparent;
}

.epm-hero-pharma .epm-farmacia-contacts .epm-contact-btn {
    background: #4caf50;
    color: #fff;
}

#hero .epm-farmacie-oggi {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 2rem 1rem;
}

#hero .epm-farmacie-oggi .epm-farmacie-oggi-title {
    color: #212121;
    font-weight: 600;
    font-size: var(--global-font-size-medium);
}

#hero .epm-farmacie-oggi .epm-farmacie-oggi-list {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

#hero .epm-farmacie-oggi .epm-farmacie-oggi-list .epm-farmacia-oggi-item {
    padding: 0;
}

/* CALENDAR STYLES */
.epm-calendario,
.epm-farmacie-ora {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* ==========================================================================
   CALENDAR STYLES
   ========================================================================== */

.epm-calendario-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.epm-calendario-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.epm-calendario-title h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.epm-calendario-filters {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: end;
}

.epm-filter-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.epm-location-input,
.epm-distance-slider,
.epm-comune-filter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.epm-distance-value {
    font-weight: 600;
    color: #0073aa;
}

/* Calendar grid */
.epm-calendario-grid {
    background: #fff;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.epm-calendario-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 0;
}

.epm-weekday {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: #555;
    border-right: 0;
}

.epm-weekday:last-child {
    border-right: 0;
}

.epm-calendario-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: 400px;
}

.epm-calendario-day {
    padding: 12px;
    border-right: 0;
    border-bottom: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.epm-calendario-day:hover {
    background: #f8f9fa;
}

.epm-calendario-day.epm-other-month {
    color: #ccc;
    background: #fafafa;
}

.epm-calendario-day.epm-today {
    background: #e3f2fd;
    font-weight: 600;
}

.epm-day-number {
    font-weight: 600;
    margin-bottom: 0;
    text-align: center;
    position: relative;
    z-index: 2;
}

.epm-calendario-day.epm-today .epm-day-number {
    color: #fff;
}

.epm-day-farmacie-labels {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.epm-farmacia-label {
    background-color: #2196f3;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.epm-farmacia-label:hover {
    background-color: #1976d2;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.epm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.epm-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

/* SVG icons in navigation buttons */
.epm-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    display: block;
}

.epm-calendario-controls .epm-btn {
    color: #333 !important;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
}

.epm-calendario-controls .epm-btn svg {
    width: 1rem;
    height: 1rem;
}

.epm-btn-primary {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.epm-btn-primary:hover {
    background: #005a87;
    border-color: #005a87;
}

.epm-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Screen reader only text */
.epm-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================================
   MODAL STYLES
   ========================================================================== */

.epm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
}

.epm-modal.show {
    display: block;
}

.epm-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.epm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #ddd;
    background: #f8f9fa;
}

.epm-modal-title {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.epm-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.epm-modal-close:hover {
    color: #333;
}

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

.epm-modal-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    margin: -20px -20px 20px -20px;
}

.epm-modal-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
}

.epm-map-popup-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    margin: -10px -10px 10px -10px;
}

.epm-map-popup-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
}

.epm-map-popup {
    max-width: 300px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.epm-map-popup h3 {
    margin: 10px 0 5px 0;
    font-size: 16px;
    color: #333;
}

.epm-map-popup p {
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.4;
}

.epm-map-popup a {
    color: #1976d2;
    text-decoration: none;
}

.epm-map-popup a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   PHARMACY DETAILS
   ========================================================================== */

.epm-farmacia-detail {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 20px;
}

.epm-farmacia-image {
    width: auto;
    height: 225px;
    object-fit: cover;
    object-position: center;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.epm-farmacia-logo {
    width: auto;
    max-width: 150px;
    height: auto;
    max-height: 60px;
    margin: 1rem auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.epm-farmacia-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.epm-farmacia-info {
    flex: 1;
}

.epm-farmacia-info h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 20px;
}

.epm-farmacia-info p {
    margin: 8px 0;
    color: #666;
    line-height: 1.5;
}

.epm-farmacia-info a {
    color: #2196f3;
    text-decoration: none;
}

.epm-farmacia-info a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   PHARMACY LIST
   ========================================================================== */

.epm-farmacie-lista {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.epm-farmacie-filters {
    width: fit-content;
    margin: 1rem auto;
    display: flex;
    justify-content: center;
}

/* Triple Toggle Switch Styles - Based on existing toggle switch */
.epm-triple-toggle-switch {
    position: relative;
    display: inline-flex;
    background: #f0f0f0;
    border-radius: 2rem;
    padding: 0.25rem;
    width: max-content;
}

.epm-triple-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.epm-triple-toggle-labels {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.epm-triple-toggle-labels::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    border-radius: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
    width: var(--pill-width, 0);
    transform: translateX(var(--pill-left, 0));
}

.epm-triple-toggle-switch[data-state="all"] .epm-triple-toggle-labels::before {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.epm-triple-toggle-switch[data-state="open"] .epm-triple-toggle-labels::before {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    box-shadow: 0 2px 12px rgba(76, 175, 80, 0.3);
}

.epm-triple-toggle-switch[data-state="turno"] .epm-triple-toggle-labels::before {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    box-shadow: 0 2px 12px rgba(255, 152, 0, 0.3);
}

.epm-triple-toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: transparent;
    border-radius: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 3;
    white-space: nowrap;
}

.epm-triple-toggle-label.active {
    color: white;
}

@keyframes epm-pulse {
    0% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: scale(1.02);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

.epm-farmacie-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
}

.epm-farmacia-item {
    flex-direction: column;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    height: min-content;
}

.epm-farmacia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.epm-farmacia-title {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.epm-farmacia-title a,
.epm-farmacia-aperta-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.epm-farmacia-title a:hover,
.epm-farmacia-aperta-link:hover {
    color: #1976d2;
    text-decoration: underline;
}

.epm-farmacia-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 1.5rem 1rem 0 1rem;
}

.epm-farmacie-aperte-ora .epm-farmacia-content {
    padding: 1.5rem 1rem 1rem 1rem;
}

.epm-farmacia-logo + .epm-farmacia-content {
    padding-top: 0;
}

.epm-farmacia-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.epm-farmacia-status {
    position: absolute;
    top: -0.75rem;
    left: -1px;
}

.epm-status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 2rem 2rem 2rem 0;
    line-height: 1em;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.epm-status-badge.epm-open {
    background-color: #4caf50;
    color: white;
}

.epm-status-badge.epm-closed {
    background-color: #f44336;
    color: white;
}

.epm-farmacia-details {
    margin-block: auto 0;
}

/* Farmacia open/closed states */
.epm-farmacia-open {
    background: linear-gradient(135deg, #f8fff8 0%, #ffffff 100%);
}

/* Orari */
.week-days {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-inline: -1rem;
}

.day {
    padding: 0.25rem 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.day.turno {
    /*background: linear-gradient(90deg, #2196f3 0%, #1976d2 100%);
    color: white;*/
    font-weight: 700;
    position: relative;
    isolation: isolate;
}

.day.turno:before {
    content: '';
    z-index: -1;
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(45deg, #f4f4f4 50%, #ededed 100%);
}

/* Contact buttons */
.epm-farmacia-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    margin: 1rem -1rem 0 -1rem;
    border-radius: 0 0 0.5rem 0.5rem;
    background-color: #c2e4ff;
}

.epm-contact-btn {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-size: 0.9rem;
    flex-direction: row;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.epm-contact-btn:is(:hover, :focus, :focus-visible) {
    background: #1976d2;
    color: white;
}

.epm-contact-btn:is(:focus, :focus-visible) {
    outline: 2px solid #1976d2;
    outline-offset: 1px;
}

.epm-contact-text {
    opacity: 0;
    transform: translateX(-15px);
    font-weight: 500;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-width: 0;
    overflow: hidden;
}

.epm-contact-btn:is(:hover, :focus, :focus-visible) .epm-contact-text {
    opacity: 1;
    transform: translateX(0);
    max-width: 200px;
    margin-inline: 0.25rem;
}

.epm-contact-text--always {
    opacity: 1;
    transform: translateX(0);
    max-width: 200px;
    margin-inline: 0.25rem;
}

/*.epm-phone-btn {
    border-color: #4caf50;
    color: #4caf50;
}

.epm-phone-btn:hover {
    background: #4caf50;
    color: white;
}

.epm-whatsapp-btn {
    border-color: #25d366;
    color: #25d366;
}

.epm-whatsapp-btn:hover {
    background: #25d366;
    color: white;
}

.epm-email-btn {
    border-color: #2196f3;
    color: #2196f3;
}

.epm-email-btn:hover {
    background: #2196f3;
    color: white;
}

.epm-address-btn {
    border-color: #ff9800;
    color: #ff9800;
}

.epm-address-btn:hover {
    background: #ff9800;
    color: white;
}*/

.epm-farmacia-address {
    margin: 8px 0;
    font-size: 1rem;
    color: #666;
}

/* ==========================================================================
   TURNO BADGES
   ========================================================================== */

.epm-turno-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
}

.epm-turno-badge.epm-turno-notturno {
    background: #9c27b0;
}

.epm-turno-badge.epm-turno-festivo {
    background: #ff5722;
}

.epm-turno-badge.epm-turno-24h {
    background: #2196f3;
}

.epm-turno-badge.epm-turno-straordinario {
    background: #ff9800;
}

/* ==========================================================================
   LOADING STATES
   ========================================================================== */

.epm-calendario-loading,
.epm-farmacie-ora-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.epm-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: epm-spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.epm-no-results {
    text-align: center;
    padding: 40px;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ==========================================================================
   FARMACIE ORA STYLES
   ========================================================================== */

.epm-farmacie-ora-header {
    text-align: center;
    margin-bottom: 30px;
}

.epm-farmacie-ora-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: #333;
}

.epm-farmacie-ora-subtitle {
    margin: 0;
    color: #666;
    font-size: 1rem;
}

.epm-farmacie-ora-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: end;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.epm-farmacie-ora-content {
    position: relative;
}

/* ==========================================================================
   MAP STYLES
   ========================================================================== */

.epm-mappa-container {
    margin-block: 3rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.epm-mappa-container #epm-mappa,
.epm-mappa {
    width: 100%;
    height: 100%;
    min-height: 300px;
}

/* Map popup styles */
.epm-map-popup {
    padding: 10px;
    max-width: 300px;
}

.epm-map-popup h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.epm-map-popup p {
    margin: 5px 0;
    color: #666;
}

.epm-map-popup .epm-map-popup-orari {
    margin: 10px 0;
}

.epm-map-popup .epm-map-popup-orari div {
    margin-top: 5px;
    font-size: 1rem;
}

.epm-map-popup-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.epm-map-popup-button:hover {
    background: #005a87;
}

/* Map popup detailed styles */
.epm-map-popup-detailed {
    padding: 15px;
    max-width: 350px;
    line-height: 1.4;
}

.epm-map-popup-detailed h3 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 16px;
}

.epm-map-popup-detailed p {
    margin: 8px 0;
    color: #666;
    font-size: 1rem;
}

.epm-map-popup-detailed a {
    color: #007cba;
}

.epm-map-popup-detailed .epm-map-popup-orari {
    margin: 12px 0;
}

.epm-map-popup-detailed .epm-map-popup-orari div {
    margin-top: 6px;
    font-size: 1rem;
    color: #555;
}

/* Error messages */
.epm-error {
    color: red;
}

/* ==========================================================================
   FARMACIE OGGI SHORTCODE
   ========================================================================== */

.epm-farmacie-oggi {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.epm-farmacie-oggi-title {
    margin: 0;
    color: white;
    font-size: 1rem;
}

.epm-farmacie-oggi-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.epm-farmacia-oggi-item {
    background: white;
    border-radius: 0.5rem;
    padding: 0.25rem 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

/*
.epm-farmacia-oggi-item::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 12px;
    height: 12px;
    border-radius: 0.5rem;
    background: linear-gradient(45deg, #0fdf58, #109f18);
    box-shadow: 0 0 10px 0 rgba(21, 201, 84, 0.7);
    z-index: 2;
    animation: epm-pulse 2s infinite;
}*/

@keyframes epm-pulse {
    0% {
        opacity: 1;
        transform: scale(0.95);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(0.95);
    }
}

.epm-farmacia-oggi-link {
    display: block;
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

.epm-farmacia-oggi-link:hover {
    color: #005a87;
    text-decoration: none;
    transform: scale(1.05);
}

.epm-farmacia-oggi-item:hover::before {
    animation-duration: 1s;
}

.epm-farmacia-oggi-link:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    border-radius: 4px;
}

.epm-farmacie-oggi-empty {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px dashed #ddd;
}

/* Highlight effect for farmacia when clicked from farmacie oggi */
.epm-farmacia-item.epm-farmacia-highlighted {
    /*animation: epm-highlight 3s ease-in-out !important;*/
    background-color: rgba(0, 115, 170, 0.08) !important;
    transition: all 0.3s ease !important;
    outline: 3px solid #0073aa !important;
    outline-offset: 2px !important;
    position: relative !important;
}

@keyframes epm-highlight {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 115, 170, 0.4);
    }
    50% { 
        transform: scale(1.01);
        box-shadow: 0 0 0 6px rgba(0, 115, 170, 0.1);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 115, 170, 0);
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .epm-weekday {
        padding: 0.5rem 0.25rem;
    }
    
    .epm-farmacie-filters {
        width: 100%;
    }

    .epm-filter-group {
        justify-content: center;
    }
    
    .epm-calendario-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .epm-calendario-filters,
    .epm-farmacie-ora-filters {
        flex-direction: column;
        gap: 15px;
    }
    
    .epm-farmacia-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .epm-modal-content {
        margin: 10px;
        max-height: 90vh;
    }
    
    .epm-farmacia-detail {
        flex-direction: column;
        gap: 15px;
    }
    
    .epm-farmacia-image {
        width: 100%;
        height: 200px;
        object-fit: cover;
    }
}

@media (max-width: 480px) {
    .epm-calendario-day {
        padding: 8px;
        min-height: 40px;
    }
    
    .epm-day-number {
        font-size: 1rem;
    }
    
    .epm-farmacia-label {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    .epm-modal-content {
        width: 90%;
        margin: 5px auto;
    }
}

/* ==========================================================================
   FARMACIE APERTE ORA GRID
   ========================================================================== */

/* Layout a griglia per farmacie aperte ora - usa le stesse classi della lista */
.epm-farmacie-aperte-ora {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(25ch, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}

/* ==========================================================================
   CALENDARIO TURNO DAY INFO
   ========================================================================== */

/* Container query setup for calendario turno */
.epm-calendario-turno {
    container-type: inline-size;
    container-name: calendario-turno;
}

.epm-calendario-day.epm-day-clickable {
    cursor: pointer;
}

/* Container query: reduce cell height when container is smaller than 500px */
@container calendario-turno (max-width: 650px) {
    .epm-calendario-day {
        max-height: 50px;
        padding: 4px 8px;
    }
    .epm-calendario-days {
        min-height: 220px;
    }
    .epm-weekday {
        font-size: 0.8rem;
    }
}

/* Today dot indicator - only for today */
.epm-calendario-day.epm-today-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2rem;
    height: 2rem;
    background: #2196f3;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

/* Selected day - subtle overlay instead of background color */
.epm-calendario-day.epm-selected {
    position: relative;
}

.epm-calendario-day.epm-selected {
    outline: 2px solid #0073aa;
    outline-offset: -2px;
    border-radius: 4px;
}

.epm-calendario-day.epm-selected .epm-day-number {
    position: relative;
    z-index: 2;
}

.epm-day-info {
    background: #fff;
    border-radius: 0px 0px 0.5rem 0.5rem;
    margin-top: -2rem;
    padding-top: 2rem;
    z-index: 0;
    position: relative;
    display: block;
    overflow: hidden;
}

.epm-day-info-loading,
.epm-day-info-empty,
.epm-day-info-error {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.epm-day-info-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: #333;
}

.epm-day-info-section .epm-farmacia-item {
    padding: 1rem;
    border: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.epm-day-info-section .epm-farmacia-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.epm-day-info-section .epm-farmacia-orari {
    font-size: 0.9rem;
    color: #666;
}

/* Note Turno o Chiusura */
.epm-day-info-section .epm-farmacia-notes {
    font-size: 0.85rem;
    position: absolute;
    top: 1rem;
    right: 1rem;
    left: unset;
    border-radius: 2rem;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: #fff;
    font-weight: 500;
}

/* Note Turno o Chiusura per la farmacia in evidenza */
.epm-farmacia-turno .epm-farmacia-evidenza .epm-farmacia-notes {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: #fff;
}

/* Shortcode titolo turni oggi */
.epm-titolo-turni-oggi {
    color: #000;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
    justify-content: center;
}

.epm-titolo-turni-oggi__data {
    position: relative;
}

.epm-titolo-turni-oggi > p {
    width: fit-content;
    margin: 0 auto;
}

.epm-titolo-turni-oggi__data:before {
    content: '';
    height: 10px;
    width: 10px;
    position: absolute;
    top: 8px;
    right: -20px;
    -moz-border-radius: 100vmax;
    -webkit-border-radius: 100vmax;
    -o-border-radius: 100vmax;
    border-radius: 100vmax;
    animation: pulse 2s infinite;
    border: 1px solid #369538;
    background-color: #4caf50;
    -moz-box-shadow: 0 0 10px 0 rgba(76, 175, 80, 0.5);
    -webkit-box-shadow: 0 0 10px 0 rgba(76, 175, 80, 0.5);
    -o-box-shadow: 0 0 10px 0 rgba(76, 175, 80, 0.5);
    box-shadow: 0 0 10px 0 rgba(76, 175, 80, 0.5);
}
@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

/** ========= SHORTCODE ORARI FARMACIA IN EVIDENZA ======== */
/* ORARI FARMACIA */
:is(.orari-farmacia, .epm-farmacia-orari) .orari-table {
    border: none;
    width: 100%;
    border-collapse: collapse;
    font-size: 1.1rem;
}
:is(.orari-farmacia, .epm-farmacia-orari) .orari-table th,
:is(.orari-farmacia, .epm-farmacia-orari) .orari-table td {
    border: none;
    text-align: left;
    border-bottom: 1px solid #ddd;
    padding: 0.5rem 1rem;
}
:is(.orari-farmacia, .epm-farmacia-orari) .orari-table th {
    border-bottom: 2px solid #ddd;
    border-top: none;
}
:is(.orari-farmacia, .epm-farmacia-orari) .orari-table thead {
    border: none;
}
:is(.orari-farmacia, .epm-farmacia-orari) .orari-table thead th {
    border-top: none !important;
    border-left: none;
    border-right: none;
}
:is(.orari-farmacia, .epm-farmacia-orari) table caption+thead tr:first-child td,
:is(.orari-farmacia, .epm-farmacia-orari) table caption+thead tr:first-child th,
:is(.orari-farmacia, .epm-farmacia-orari) table colgroup+thead tr:first-child td,
:is(.orari-farmacia, .epm-farmacia-orari) table colgroup+thead tr:first-child th,
:is(.orari-farmacia, .epm-farmacia-orari) table thead:first-child tr:first-child td,
:is(.orari-farmacia, .epm-farmacia-orari) table thead:first-child tr:first-child th {
    border-top: none !important;
    border-bottom: none !important;
}
:is(.orari-farmacia, .epm-farmacia-orari) .orari-table tbody tr:last-child td {
    border-bottom: none;
}
:is(.orari-farmacia, .epm-farmacia-orari) .orari-table tbody > tr:nth-child(odd) > td,
:is(.orari-farmacia, .epm-farmacia-orari) .orari-table tbody > tr:nth-child(odd) > th {
    background-color: transparent;
}
:is(.orari-farmacia, .epm-farmacia-orari) .orari-table th,
:is(.orari-farmacia, .epm-farmacia-orari) .giorno-nome {
    font-weight: 500;
}
:is(.orari-farmacia, .epm-farmacia-orari) .orario-formattato .fascia-oraria,
:is(.orari-farmacia, .epm-farmacia-orari) .orario-formattato .etichetta {
    font-weight: 700;
}
:is(.orari-farmacia, .epm-farmacia-orari) .orari-table tr.today {
    background-color: var(--e-global-color-a412f48);
    color: var(--e-global-color-cdbbc21);
    border-top: none !important;
    border-bottom: none !important;
}
:is(.orari-farmacia, .epm-farmacia-orari) .giorno-nome,
:is(.orari-farmacia, .epm-farmacia-orari) .giorno-orari {
    font-weight: 500;
}
:is(.orari-farmacia, .epm-farmacia-orari) .orario-testo {
    color: #2e7d32;
}
:is(.orari-farmacia, .epm-farmacia-orari) .orario-formattato {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
:is(.orari-farmacia, .epm-farmacia-orari) .today .orario-chiuso {
    color: var(--e-global-color-cdbbc21);
}
@media (max-width: 767px) {
    :is(.orari-farmacia, .epm-farmacia-orari) .orari-table {
            font-size: 0.95rem;
    }
}

/* ==========================================================================
   STATO FARMACIA (orario_violante shortcode)
   ========================================================================== */

/*.stato-farmacia {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
}

.stato-farmacia .stato {
    font-weight: 600;
    margin-right: 0.25rem;
}

.stato-farmacia .mid {
    margin: 0 0.25rem;
    font-weight: 400;
}

.stato-farmacia .orario {
    font-weight: 600;
}

.stato-farmacia.farmacia-aperta {
    color: #2d5016;
}

.stato-farmacia.farmacia-aperta .stato {
    color: #2d5016;
}

.stato-farmacia.farmacia-aperta .orario {
    color: #2d5016;
}

.stato-farmacia.farmacia-chiusa {
    color: #666;
}

.stato-farmacia.farmacia-chiusa .stato {
    color: #666;
}*/

/* Responsive */
/*@media (max-width: 768px) {
    .stato-farmacia {
        font-size: 0.9rem;
    }
}*/
