/* ==========================================
   SmiecioPlan.pl — Main Stylesheet
   ========================================== */

/* ---------- CSS Variables ---------- */
:root {
    --sp-primary: #10B981;
    --sp-primary-dark: #059669;
    --sp-primary-light: #D1FAE5;
    --sp-secondary: #3B82F6;
    --sp-bg: #F9FAFB;
    --sp-surface: #FFFFFF;
    --sp-text: #111827;
    --sp-text-secondary: #6B7280;
    --sp-border: #E5E7EB;
    --sp-waste-mixed: #3B82F6;
    --sp-waste-segregated: #F59E0B;
    --sp-waste-bio: #22C55E;
    --sp-waste-bulky: #8B5CF6;
    --sp-radius-sm: 0.375rem;
    --sp-radius-md: 0.5rem;
    --sp-radius-lg: 0.75rem;
    --sp-radius-xl: 1rem;
    --sp-radius-2xl: 1.5rem;
    --sp-radius-full: 9999px;
    --sp-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --sp-shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.05);
}

/* ---------- Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

[x-cloak] { display: none !important; }

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--sp-text);
    background: var(--sp-bg);
    line-height: 1.6;
}

/* ---------- Header ---------- */
.sp-header {
    background: #fff;
    padding: 12px 16px;
}

.sp-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.smiecioplan-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.sp-nav {
    display: flex;
    gap: 24px;
    font-size: 0.875rem;
}

.sp-nav a {
    color: #374151;
    text-decoration: none;
}

.sp-nav a:hover {
    color: var(--sp-primary);
}

.sp-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.sp-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #374151;
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.sp-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.sp-hamburger.open span:nth-child(2) {
    opacity: 0;
}

.sp-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.sp-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.2);
    z-index: 99;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

@media (max-width: 639px) {
    .sp-hamburger {
        display: flex;
    }

    .sp-nav {
        display: none;
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 8px 0;
        gap: 0;
        border-top: none;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        border-radius: 0 0 16px 16px;
        z-index: 100;
        animation: sp-nav-slide 0.2s ease-out;
    }

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

    .sp-nav.open {
        display: flex;
    }

    .sp-nav a {
        padding: 14px 24px;
        font-size: 0.938rem;
        font-weight: 500;
        color: #374151;
        border-bottom: 1px solid #F3F4F6;
        transition: background 0.15s, color 0.15s;
    }

    .sp-nav a:last-child {
        border-bottom: none;
    }

    .sp-nav a:hover,
    .sp-nav a:active {
        background: #F0FDF4;
        color: var(--sp-primary);
    }

    .sp-header-inner {
        position: relative;
    }
}

/* ---------- FAQ details/summary reset ---------- */
.sp-page-content details summary { outline: none; }
.sp-page-content details summary::-webkit-details-marker { display: none; }
.sp-page-content details[open] summary svg { transform: rotate(180deg); }

/* ---------- Hero Search Section ---------- */
.sp-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #ECFDF5 0%, #F0FDFA 30%, #EFF6FF 70%, #F5F3FF 100%);
    padding: 56px 16px 64px;
    text-align: center;
}

/* Floating background icons */
.sp-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.sp-float {
    position: absolute;
    font-size: 2rem;
    opacity: 0.08;
    animation: sp-float 20s ease-in-out infinite;
}

.sp-float-1 { top: 10%; left: 8%; font-size: 2.5rem; animation-duration: 22s; }
.sp-float-2 { top: 20%; right: 12%; font-size: 2rem; animation-duration: 18s; animation-delay: -3s; }
.sp-float-3 { bottom: 30%; left: 15%; font-size: 1.8rem; animation-duration: 25s; animation-delay: -7s; }
.sp-float-4 { bottom: 15%; right: 8%; font-size: 2.2rem; animation-duration: 20s; animation-delay: -5s; }
.sp-float-5 { top: 50%; left: 5%; font-size: 1.6rem; animation-duration: 24s; animation-delay: -10s; }
.sp-float-6 { top: 40%; right: 5%; font-size: 1.8rem; animation-duration: 19s; animation-delay: -8s; }

@keyframes sp-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(5deg); }
    50% { transform: translateY(-10px) rotate(-3deg); }
    75% { transform: translateY(-25px) rotate(3deg); }
}

.sp-hero-content {
    position: relative;
    z-index: 1;
}

.sp-brand {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--sp-primary);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sp-brand-logo {
    font-size: 2.5rem;
    line-height: 1;
}

.sp-brand-tld {
    font-weight: 400;
    color: #9CA3AF;
}

.sp-hero h1.sp-subtitle {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--sp-text);
    margin: 0 0 8px 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.sp-subtitle-city {
    color: var(--sp-primary);
}

.sp-hero-desc {
    font-size: 1.05rem;
    color: var(--sp-text-secondary);
    margin: 0 0 32px 0;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Search Box ---------- */
.sp-search-box {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
}

.sp-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

/* Search icon inside input */
.sp-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
}

.sp-input {
    flex: 1;
    min-width: 200px;
    padding: 16px 44px 16px 50px;
    border: 2px solid var(--sp-border);
    border-radius: var(--sp-radius-2xl);
    font-size: 1.05rem;
    color: var(--sp-text);
    background: var(--sp-surface);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.sp-input:focus {
    border-color: var(--sp-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.sp-input::placeholder {
    color: #B0B8C4;
}

/* ---------- Clear Button ---------- */
.sp-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #9CA3AF;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: var(--sp-radius-sm);
    transition: color 0.15s;
}

.sp-clear-btn:hover {
    color: var(--sp-text);
}

.sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--sp-radius-full);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.sp-btn-primary {
    background: var(--sp-primary);
    color: #fff;
}

.sp-btn-primary:hover {
    background: var(--sp-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--sp-shadow-lg);
}

.sp-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.sp-btn-secondary {
    background: var(--sp-surface);
    color: var(--sp-text);
    border: 2px solid var(--sp-border);
}

.sp-btn-secondary:hover {
    border-color: var(--sp-primary);
    color: var(--sp-primary);
}

.sp-btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* ---------- Autocomplete Dropdown ---------- */
.sp-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-xl);
    box-shadow: var(--sp-shadow-lg);
    z-index: 50;
    max-height: 320px;
    overflow-y: auto;
}

.sp-dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid #F3F4F6;
}

.sp-dropdown-item:last-child {
    border-bottom: none;
}

.sp-dropdown-item:hover {
    background: #F0FDF4;
}

.sp-dropdown-street {
    font-weight: 600;
    color: var(--sp-text);
}

.sp-dropdown-meta {
    font-size: 0.75rem;
    color: var(--sp-text-secondary);
}

/* ---------- Static Page Content ---------- */
.sp-page-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 32px 0 12px;
}
.sp-page-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1F2937;
    margin: 24px 0 8px;
}
.sp-page-content ul,
.sp-page-content ol {
    padding-left: 24px;
    margin: 8px 0;
}
.sp-page-content li {
    margin-bottom: 6px;
}
.sp-page-content a {
    color: #10B981;
    text-decoration: none;
}
.sp-page-content a:hover {
    text-decoration: underline;
}
.sp-page-content p {
    margin: 0 0 12px;
}

/* ---------- Schedule Page ---------- */
.sp-schedule {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px;
}

.sp-schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.sp-address-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.sp-address-subtitle {
    font-size: 0.875rem;
    color: var(--sp-text-secondary);
    margin: 4px 0 0 0;
}

.sp-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- Filters ---------- */
.sp-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--sp-surface);
    border-radius: var(--sp-radius-xl);
    border: 1px solid var(--sp-border);
}

.sp-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--sp-radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: 2px solid;
    transition: all 0.15s;
    background: transparent;
}

.sp-filter-btn.active {
    color: #fff;
}

.sp-filter-btn:not(.active) {
    opacity: 0.4;
}

.sp-filter-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* Compact filters */
.sp-filters-compact {
    padding: 10px 14px;
    margin-bottom: 16px;
    gap: 6px;
    flex-direction: column;
}
.sp-filters-label {
    font-size: 0.75rem;
    color: #6B7280;
    font-weight: 500;
}
.sp-filters-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.sp-filter-btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-width: 1.5px;
}
.sp-filter-btn-sm .sp-filter-dot {
    width: 8px;
    height: 8px;
}

/* ---------- Bulky Waste Info Box ---------- */
.sp-bulky-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    margin-top: 32px;
    margin-bottom: 24px;
    background: #F5F3FF;
    border: 1px solid #DDD6FE;
    border-left: 4px solid #8B5CF6;
    border-radius: var(--sp-radius-lg);
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.6;
}

.sp-bulky-info-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.sp-bulky-info-text {
    flex: 1;
}

.sp-bulky-info-text strong {
    color: #5B21B6;
}

/* ---------- Calendar Grid ---------- */
.sp-calendar-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
}

@media (min-width: 640px) {
    .sp-calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .sp-calendar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.sp-month-card {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-md);
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.sp-month-card:hover {
    box-shadow: var(--sp-shadow);
}

.sp-month-card.current-month {
    border: 2px solid var(--sp-primary);
    box-shadow: 0 0 0 1px var(--sp-primary);
}

.sp-month-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1F2937;
    margin: 0;
    padding: 5px 12px;
    text-align: center;
    background: #D1D5DB;
}

.sp-cal-table {
    width: 100%;
    border-collapse: collapse;
}

.sp-cal-table th {
    font-size: 0.7rem;
    font-weight: 700;
    color: #374151;
    padding: 4px 2px;
    text-align: center;
    text-transform: uppercase;
    background: #E5E7EB;
    letter-spacing: 0.03em;
}

.sp-cal-table td {
    text-align: center;
    padding: 0;
    vertical-align: top;
    height: 40px;
    border: 1px solid #F1F5F9;
    position: relative;
}

.sp-cal-table td.sp-weekend {
    background: #F8FAFC;
}

.sp-cal-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: 100%;
    width: 100%;
}

.sp-day-num {
    font-size: 0.813rem;
    font-weight: 700;
    line-height: 1;
    color: var(--sp-text);
    padding: 4px 0;
    text-align: center;
    position: relative;
    z-index: 1;
}

.sp-day-num.today {
    background: #1F2937;
    color: #fff;
    border-radius: 9999px;
    width: 26px;
    height: 26px;
    line-height: 26px;
    padding: 0;
    margin: 0 auto;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1F2937;
}

.sp-day-num.past {
    color: #CBD5E1;
}

/* Color blocks filling the cell as background */
.sp-day-blocks {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    z-index: 0;
}

.sp-day-block {
    flex: 1;
    width: 100%;
    min-height: 0;
    opacity: 0.85;
}

/* Has events — white text on day number over colored background */
td.sp-has-events .sp-day-num {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5), 0 0 1px rgba(0,0,0,0.3);
}

td.sp-has-events .sp-day-num.today {
    text-shadow: none;
    color: #fff;
}

td.sp-past-cell {
    opacity: 0.4;
}

/* Weekend label styling — same as weekdays */
.sp-cal-table th.sp-weekend-th {
    color: #374151;
}

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

/* ---------- Upcoming Pickups ---------- */
.sp-upcoming {
    margin-top: 32px;
}

.sp-upcoming h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 16px 0;
}

.sp-upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sp-upcoming-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-lg);
    transition: background 0.1s;
}

.sp-upcoming-item:hover {
    background: #F0FDF4;
}

.sp-upcoming-date {
    font-weight: 700;
    font-size: 0.875rem;
    min-width: 55px;
}

.sp-upcoming-day {
    font-size: 0.75rem;
    color: var(--sp-text-secondary);
    min-width: 35px;
}

.sp-upcoming-type {
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sp-type-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ---------- Legend ---------- */
.sp-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: #F9FAFB;
    border-radius: var(--sp-radius-lg);
    margin-bottom: 16px;
}

.sp-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.813rem;
    color: var(--sp-text-secondary);
}

/* ---------- Export Modal ---------- */
.sp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.sp-modal {
    background: var(--sp-surface);
    border-radius: var(--sp-radius-2xl);
    padding: 32px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--sp-shadow-lg);
}

.sp-modal h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 16px 0;
}

.sp-modal-section {
    margin-bottom: 20px;
}

.sp-modal-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 0.875rem;
    cursor: pointer;
}

.sp-modal-section input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--sp-primary);
}

.sp-modal-section input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--sp-primary);
}

.sp-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ---------- Loading / Error ---------- */
.sp-loading {
    text-align: center;
    padding: 60px 16px;
}

.sp-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--sp-border);
    border-top-color: var(--sp-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.sp-error {
    text-align: center;
    padding: 40px 16px;
    color: #EF4444;
}

.sp-empty {
    text-align: center;
    padding: 60px 16px;
    color: var(--sp-text-secondary);
}

/* ---------- Page Content (kontakt, polityka) ---------- */
.sp-page-content {
    max-width: 768px;
    margin: 0 auto;
    padding: 40px 16px;
}

.sp-page-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 24px 0;
}

.sp-page-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 24px 0 12px 0;
}

.sp-page-content p {
    margin: 0 0 12px 0;
    color: var(--sp-text-secondary);
    line-height: 1.7;
}

/* ---------- Contact Form ---------- */
.sp-contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sp-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sp-form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sp-text);
}

.sp-form-group input,
.sp-form-group textarea {
    padding: 12px 16px;
    border: 2px solid var(--sp-border);
    border-radius: var(--sp-radius-lg);
    font-size: 1rem;
    color: var(--sp-text);
    font-family: inherit;
    transition: border-color 0.15s;
}

.sp-form-group input:focus,
.sp-form-group textarea:focus {
    outline: none;
    border-color: var(--sp-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.sp-form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* ---------- Save Button ---------- */
.sp-btn-save {
    background: var(--sp-surface);
    color: var(--sp-text);
    border: 2px solid var(--sp-border);
    transition: all 0.2s;
}

.sp-btn-save:hover {
    border-color: var(--sp-primary);
    color: var(--sp-primary);
}

.sp-btn-save.saved {
    background: var(--sp-primary-light);
    border-color: var(--sp-primary);
    color: var(--sp-primary-dark);
}

/* ---------- Stats Bar ---------- */
.sp-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin: 28px auto 0;
    max-width: 400px;
}

.sp-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.sp-stat-num {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--sp-text);
    letter-spacing: -0.02em;
}

.sp-stat-label {
    font-size: 0.75rem;
    color: var(--sp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.sp-stat-divider {
    width: 1px;
    height: 32px;
    background: var(--sp-border);
}

/* ---------- Feature Cards ---------- */
.sp-features {
    max-width: 960px;
    margin: 48px auto 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    text-align: left;
}

.sp-feature-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(229, 231, 235, 0.6);
    border-radius: var(--sp-radius-xl);
    padding: 28px 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sp-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.sp-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.sp-feature-icon-search {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
    color: #059669;
}

.sp-feature-icon-cal {
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    color: #2563EB;
}

.sp-feature-icon-pdf {
    background: linear-gradient(135deg, #EDE9FE, #DDD6FE);
    color: #7C3AED;
}

.sp-feature-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--sp-text);
    margin: 0 0 6px 0;
}

.sp-feature-desc {
    font-size: 0.875rem;
    color: var(--sp-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ---------- Saved Addresses (Home) ---------- */
.sp-saved-section {
    max-width: 560px;
    margin: 32px auto 0;
    text-align: left;
}

.sp-saved-title {
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--sp-text);
    margin: 0 0 12px 0;
    text-align: center;
}

.sp-saved-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sp-saved-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-lg);
    cursor: pointer;
    transition: all 0.15s;
}

.sp-saved-item:hover {
    border-color: var(--sp-primary);
    background: #F0FDF4;
}

.sp-saved-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sp-saved-address {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sp-text);
}

.sp-saved-sector {
    font-size: 0.75rem;
    color: var(--sp-text-secondary);
}

.sp-saved-remove {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #D1D5DB;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--sp-radius-sm);
    transition: all 0.15s;
    line-height: 1;
}

.sp-saved-remove:hover {
    color: #EF4444;
    background: #FEF2F2;
}

/* ---------- Social Share ---------- */
.sp-share {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sp-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-full);
    background: var(--sp-surface);
    cursor: pointer;
    transition: all 0.15s;
    color: var(--sp-text-secondary);
}

.sp-share-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--sp-shadow);
}

.sp-share-fb:hover {
    background: #1877F2;
    color: #fff;
    border-color: #1877F2;
}

.sp-share-x:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

.sp-share-wa:hover {
    background: #25D366;
    color: #fff;
    border-color: #25D366;
}

.sp-share-copy {
    width: auto;
    padding: 0 12px;
    gap: 4px;
}

.sp-share-copy:hover {
    border-color: var(--sp-primary);
    color: var(--sp-primary);
}

/* ---------- Streets Directory ---------- */
.sp-streets-directory a[href*="/harmonogram/"]:hover {
    border-color: var(--sp-primary) !important;
    background: #F0FDF4 !important;
}

/* ---------- SEO Section ---------- */
.sp-seo-section p {
    break-inside: avoid;
}

@media (max-width: 639px) {
    .sp-seo-section div[style*="columns:2"] {
        columns: 1 !important;
    }

    .sp-streets-directory div[style*="columns:2"] {
        columns: 1 !important;
    }

    .sp-hero {
        padding: 32px 16px 40px;
        min-height: auto;
    }

    .sp-search-box {
        max-width: 100%;
    }

    .sp-input {
        padding: 14px 40px 14px 44px;
        font-size: 0.95rem;
    }

    .sp-search-icon {
        left: 14px;
    }

    .sp-brand {
        font-size: 1.75rem;
    }

    .sp-brand-logo {
        font-size: 2rem;
    }

    .sp-hero h1.sp-subtitle {
        font-size: 1.35rem;
    }

    .sp-hero-desc {
        font-size: 0.938rem;
        margin-bottom: 24px;
    }

    .sp-features {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 24px;
    }

    .sp-feature-card {
        padding: 14px 16px;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .sp-feature-icon {
        width: 36px;
        height: 36px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .sp-feature-title {
        font-size: 0.875rem;
        margin-bottom: 2px;
    }

    .sp-feature-desc {
        font-size: 0.8rem;
    }

    .sp-stats {
        gap: 16px;
    }

    .sp-stat-num {
        font-size: 1.1rem;
    }

    .sp-float {
        display: none;
    }
}

/* ---------- Sector Selector (Multi-sector addresses) ---------- */
.sp-sector-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 9999px;
    background: #fff;
    font-size: 0.813rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}
.sp-sector-btn:hover {
    border-color: #10B981;
    color: #10B981;
}
.sp-sector-btn.active {
    background: #10B981;
    border-color: #10B981;
    color: #fff;
}

/* ---------- Print Styles — Full A4, stretched ---------- */
@media print {
    .smiecioplan-header,
    .smiecioplan-footer,
    .smiecioplan-cookie-banner,
    .sp-hero,
    .sp-actions,
    .sp-filters,
    .sp-bulky-info,
    .sp-search-box,
    .sp-quick-links,
    .sp-modal-overlay,
    .sp-share,
    .sp-sector-btn,
    .sp-saved-section,
    .sp-seo-section,
    .sp-streets-directory nav,
    .sp-upcoming,
    nav,
    .wp-block-navigation,
    #wpadminbar,
    footer,
    section[style*="background:#F9FAFB"],
    section[style*="background:#F0FDF4"] {
        display: none !important;
    }

    @page {
        size: A4 portrait;
        margin: 6mm;
    }

    * {
        box-sizing: border-box;
    }

    html {
        background: #fff !important;
        margin: 0;
        padding: 0;
    }

    body {
        background: #fff !important;
        color: #000;
        font-size: 10px;
        margin: 0;
        padding: 0;
        width: 100%;
        height: 285mm;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    main {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    /* Alpine.js wrapper: main > div */
    main > div {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .sp-schedule {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
        width: 100% !important;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    /* Alpine.js inner wrapper: .sp-schedule > div */
    .sp-schedule > div {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    /* --- Header: street name centered, compact --- */
    .sp-schedule-header {
        margin-bottom: 0;
        text-align: center;
        display: block;
        flex-shrink: 0;
    }

    .sp-address-title {
        font-size: 11px;
        font-weight: 800;
        margin: 0;
        text-align: center;
    }

    .sp-address-subtitle {
        font-size: 7px;
        margin: 0;
        text-align: center;
        color: #555;
    }

    /* --- Legend: single row, centered, compact --- */
    .sp-legend {
        margin: 0 0 2px;
        padding: 2px 0;
        justify-content: center;
        gap: 16px;
        font-size: 7px;
        background: none;
        border-radius: 0;
        flex-shrink: 0;
    }

    .sp-legend-item .sp-type-badge {
        width: 8px;
        height: 8px;
    }

    /* --- Calendar Grid: 3 cols, flex:1 fills remaining page space --- */
    .sp-calendar-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        grid-auto-rows: 1fr;
        gap: 2px !important;
        width: 100% !important;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    /* --- Month cards: fill cell --- */
    .sp-month-card {
        border: 1px solid #999 !important;
        border-radius: 3px !important;
        box-shadow: none !important;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding: 0 !important;
    }

    .sp-month-card.current-month {
        border-color: #999 !important;
        box-shadow: none !important;
    }

    /* --- Month title bar --- */
    .sp-month-title {
        font-size: 7px;
        font-weight: 700;
        padding: 1px 0;
        margin: 0;
        text-align: center;
        background: #D1D5DB;
        color: #1F2937;
        flex-shrink: 0;
    }

    /* --- Table: flex column, thead fixed, tbody grid with equal rows --- */
    .sp-cal-table {
        width: 100%;
        display: flex !important;
        flex-direction: column;
        flex: 1;
    }

    .sp-cal-table thead {
        display: block;
        width: 100%;
        flex-shrink: 0;
    }

    .sp-cal-table thead tr {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
    }

    .sp-cal-table th {
        font-size: 7px;
        font-weight: 700;
        padding: 1px 0;
        text-align: center;
        background: #E5E7EB;
        color: #374151;
        letter-spacing: 0;
        line-height: 1.2;
    }

    /* tbody: CSS Grid with 6 EQUAL rows — flex:1 fills remaining card space */
    .sp-cal-table tbody {
        display: grid !important;
        grid-template-rows: repeat(6, 1fr);
        flex: 1;
    }

    .sp-cal-table tbody tr {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        min-height: 0;
        overflow: hidden;
    }

    .sp-cal-table td {
        text-align: center;
        padding: 0;
        border: 1px solid #ccc;
        font-size: 8px;
        line-height: 1;
        position: relative;
        overflow: hidden;
        min-height: 0;
    }

    /* Center day number vertically + horizontally in cell */
    .sp-cal-day {
        justify-content: center;
        align-items: center;
    }

    .sp-day-block {
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
        opacity: 0.9;
    }

    .sp-day-num {
        font-size: 8px;
        font-weight: 700;
        padding: 0;
        text-align: center;
    }

    /* Bigger + white text on colored cells */
    td.sp-has-events .sp-day-num {
        font-size: 10px;
        color: #fff;
        text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    }

    /* --- No "today" circle in print --- */
    .sp-day-num.today {
        background: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        width: auto !important;
        height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    td.sp-has-events .sp-day-num.today {
        color: #fff !important;
    }

    /* --- Past cells: dimmed in print --- */
    td.sp-past-cell {
        opacity: 0.6;
    }

    /* --- Force colors in print --- */
    td,
    td.sp-has-events,
    td.sp-weekend,
    .sp-day-block,
    .sp-month-title,
    .sp-cal-table th,
    .sp-legend-item .sp-type-badge {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    /* --- Weekend columns slightly grey --- */
    .sp-cal-table td.sp-weekend {
        background: #F8FAFC;
    }

    /* --- Breadcrumbs hidden --- */
    .sp-schedule nav,
    .sp-schedule [class*="breadcrumb"] {
        display: none !important;
    }

    /* No break-inside rules — let everything flow on single page */
}

/* ---------- Responsive Tablet ---------- */

/* ---------- Responsive Mobile Adjustments (screen only) ---------- */
@media screen and (max-width: 639px) {
    .sp-hero {
        padding: 40px 16px 60px;
    }

    .sp-brand {
        font-size: 1.5rem;
    }

    .sp-search-input-wrap {
        flex-direction: column;
    }

    .sp-search-input-wrap .sp-input {
        width: 100%;
    }

    .sp-schedule-header {
        flex-direction: column;
    }

    .sp-actions {
        width: 100%;
    }

    .sp-actions .sp-btn {
        flex: 1;
        text-align: center;
    }

    .sp-filters-compact {
        padding: 8px 10px;
    }
    .sp-filters-row {
        flex-wrap: wrap;
        gap: 4px;
    }
    .sp-filter-btn-sm {
        padding: 3px 8px;
        font-size: 0.688rem;
    }

    .sp-cal-table td {
        height: 36px;
    }

    .sp-day-block {
        min-height: 4px;
    }

    .sp-day-num {
        font-size: 0.75rem;
    }
}

/* ========================================
   CALENDAR SUBSCRIPTION MODAL
   ======================================== */
.sp-cal-modal {
    max-width: 460px;
    position: relative;
    padding: 28px;
}

.sp-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9CA3AF;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.sp-modal-close:hover {
    color: #374151;
}

.sp-cal-modal-desc {
    font-size: 0.875rem;
    color: #6B7280;
    margin: -8px 0 20px 0;
    line-height: 1.4;
}

.sp-cal-label {
    display: block;
    font-size: 0.813rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.sp-cal-input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    color: #111827;
    background: #fff;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.sp-cal-input:focus {
    outline: none;
    border-color: var(--sp-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.sp-cal-types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sp-cal-type-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    font-size: 0.813rem;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    background: #FAFAFA;
    white-space: nowrap;
}

.sp-cal-type-label:hover {
    border-color: #9CA3AF;
    background: #F3F4F6;
}

.sp-cal-type-label.active {
    font-weight: 600;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.sp-cal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.sp-cal-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.sp-cal-btn:hover {
    border-color: var(--sp-primary);
    background: #F0FDF4;
}

.sp-cal-btn-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.sp-cal-btn-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.sp-cal-btn-text strong {
    font-size: 0.875rem;
    color: #111827;
}

.sp-cal-btn-text small {
    font-size: 0.75rem;
    color: #9CA3AF;
}

.sp-cal-google-note {
    font-size: 0.75rem;
    color: #9CA3AF;
    text-align: center;
    margin: 12px 0 0;
    line-height: 1.4;
}

.sp-cal-google-note a {
    color: #6B7280;
    text-decoration: underline;
}

.sp-cal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #F3F4F6;
}

.sp-cal-link-btn {
    background: none;
    border: none;
    color: var(--sp-primary);
    font-size: 0.813rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
}

.sp-cal-link-btn:hover {
    background: #F0FDF4;
}

.sp-cal-separator {
    color: #E5E7EB;
    font-size: 0.813rem;
}

/* Alarm toggle rows */
.sp-cal-alarm-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.sp-cal-alarm-row + .sp-cal-alarm-row {
    border-top: 1px solid #F3F4F6;
}

.sp-cal-alarm-text {
    flex: 1;
    font-size: 0.875rem;
    color: #374151;
}

.sp-cal-alarm-time {
    width: 100px;
    padding: 6px 8px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    color: #111827;
    background: #fff;
    text-align: center;
    transition: border-color 0.15s, opacity 0.15s;
}

.sp-cal-alarm-time:focus {
    outline: none;
    border-color: var(--sp-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.sp-cal-alarm-time:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Toggle switch */
.sp-cal-alarm-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}

.sp-cal-alarm-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.sp-cal-alarm-switch {
    position: absolute;
    inset: 0;
    background: #D1D5DB;
    border-radius: 22px;
    transition: background 0.2s;
}

.sp-cal-alarm-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.sp-cal-alarm-toggle input:checked + .sp-cal-alarm-switch {
    background: var(--sp-primary);
}

.sp-cal-alarm-toggle input:checked + .sp-cal-alarm-switch::after {
    transform: translateX(18px);
}

/* Calendar modal responsive */
@media (max-width: 480px) {
    .sp-cal-modal {
        padding: 20px;
        border-radius: 16px 16px 0 0;
        max-width: 100%;
        max-height: 85vh;
        margin-top: auto;
    }

    .sp-modal-overlay:has(.sp-cal-modal) {
        align-items: flex-end;
    }

    .sp-cal-actions {
        grid-template-columns: 1fr;
    }
}
