.afrah-reservation-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    height: 100%;
    margin: 0;
    padding: 1.5rem 1.75rem;
    border-radius: 12px;
    background: var(--afrah-bg, #ffffff);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    font-family: var(--afrah-font-family, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    font-size: var(--afrah-font-size, 16px);
    color: var(--afrah-text, #0f172a);
}

.afrah-reservation-wrapper * {
    font-family: inherit;
}

.afrah-reservation-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.afrah-reservation-header h3 {
    font-size: var(--afrah-title-size, 1.35rem);
    font-weight: 700;
    margin: 0;
    font-family: var(--afrah-title-font, var(--afrah-font-family, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif));
}

.afrah-reservation-table {
    margin: 0;
    font-size: var(--afrah-table-size, 0.95rem);
    color: #6b7280;
}

.afrah-reservation-warning {
    color: #b91c1c;
}

.afrah-reservation-calendar-section {
    margin-bottom: 1.25rem;
    width: 100%;
}

.afrah-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.afrah-calendar-title {
    font-weight: 600;
    font-size: var(--afrah-title-size, 1rem) !important;
    font-family: var(--afrah-title-font, var(--afrah-font-family, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif));
    color: #6b7280;
}

.afrah-calendar-nav {
    border: 1px solid var(--afrah-border, #e5e7eb);
    background: #e5e7eb;
    color: #111827;
    border-radius: 999px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.afrah-calendar-nav:hover {
    background: #d1d5db;
    transform: translateY(-1px);
}

.afrah-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
}

.afrah-calendar-row {
    display: contents;
}

.afrah-calendar-cell {
    min-height: 38px;
}

.afrah-calendar-cell--header {
    font-size: var(--afrah-weekdays-size, 0.7rem);
    text-transform: uppercase;
    font-weight: 600;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--afrah-weekdays-font, var(--afrah-font-family, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif));
}

.afrah-calendar-cell--empty {
    background: transparent;
}

.afrah-calendar-day {
    width: 100%;
    /* Desktop & tablet: rectangle (height ~ half the width) */
    aspect-ratio: 2 / 1;
    border-radius: 8px;
    border: 1px solid var(--afrah-border, #d1d5db);
    cursor: pointer;
    font-size: 0.85em;
    background: var(--afrah-bg, #f9fafb);
    color: var(--afrah-text, #111827);
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 auto;
    line-height: 1;
}

.afrah-calendar-day--enabled:hover {
    background: #e5f0ff;
    box-shadow: 0 0 0 1px var(--afrah-primary-strong, #2563eb);
    transform: translateY(-1px);
}

.afrah-calendar-day--disabled {
    background: #f3f4f6;
    color: var(--afrah-disabled, #9ca3af);
    cursor: default;
}

.afrah-calendar-day--selected {
    background: var(--afrah-primary, #2563eb);
    color: var(--afrah-text-selected, #ffffff);
    box-shadow: 0 0 0 1px var(--afrah-primary-strong, #1d4ed8);
}

.afrah-calendar-help {
    margin-top: 0.5rem;
    font-size: var(--afrah-help-size, 0.8rem);
    color: #6b7280;
}

.afrah-reservation-slots-section h4,
.afrah-reservation-form-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: var(--afrah-slots-title-size, 1rem);
    font-weight: 600;
    color: #6b7280;
}

.afrah-reservation-form-section {
    margin-top: 1.5rem;
}

.afrah-slots-list {
    min-height: 34px;
}

.afrah-slots-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.afrah-slot-btn {
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--afrah-border, #d1d5db);
    background: var(--afrah-bg, #f9fafb);
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.afrah-slot-btn:hover {
    background: #e5f0ff;
    border-color: #2563eb;
    transform: translateY(-1px);
}

.afrah-slot-btn--selected {
    background: var(--afrah-primary, #2563eb);
    border-color: var(--afrah-primary-strong, #1d4ed8);
    color: var(--afrah-text-selected, #ffffff);
}

.afrah-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.afrah-field label {
    font-size: 0.85em;
    font-weight: 500;
    color: #374151;
    font-family: inherit;
}

.afrah-field input {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.4rem 1rem;
    font-size: 0.85em;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.afrah-field input:focus {
    outline: none;
    border-color: var(--afrah-primary, #2563eb);
    box-shadow: 0 0 0 1px var(--afrah-primary, #2563eb20);
}

.afrah-submit-btn {
    width: auto;
    border-radius: 999px;
    border: none;
    padding: 0.7rem 20px;
    background: var(--afrah-btn-bg, var(--afrah-primary, #2563eb));
    color: var(--afrah-btn-text, #ffffff);
    font-weight: 600;
    font-size: var(--afrah-btn-font-size, 0.95rem);
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.1s ease, filter 0.1s ease;
}

.afrah-submit-btn:hover {
    filter: brightness(1.03);
    transform: translateY(-1px);
    box-shadow: none;
}

.afrah-submit-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.afrah-form-message {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.afrah-reservation-complete {
    margin-top: 1rem;
    display: none;
    padding: 2rem 1.75rem;
    text-align: center;
    min-height: 500px;
}

.afrah-reservation-complete-message {
    margin: 0 0 0.75rem 0;
    font-size: var(--afrah-slots-title-size, 1rem);
}

.afrah-back-btn {
    border-radius: 999px;
    border: none;
    padding: 0.6rem 1.25rem;
    background: #e5e7eb;
    color: #111827;
    cursor: pointer;
    font-size: var(--afrah-slots-title-size, 1rem);
    transition: background 0.15s ease, transform 0.1s ease;
}

.afrah-back-btn:hover {
    background: #d1d5db;
    transform: translateY(-1px);
}

.afrah-reservation-wrapper.afrah-complete-visible .afrah-reservation-complete {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.afrah-success {
    color: #15803d;
}

.afrah-error {
    color: #b91c1c;
}

.afrah-warning {
    color: #b45309;
}

.afrah-info {
    color: #0f766e;
}

@media (max-width: 480px) {
    .afrah-reservation-wrapper {
        padding: 1rem 1.1rem;
        border-radius: 10px;
    }

    .afrah-calendar-title {
        font-size: calc(var(--afrah-title-size, 1.35rem) * 0.5) !important;
    }
	.afrah-calendar-cell--header{
		font-size:16px;
	}
    .afrah-calendar-grid {
        gap: 3px;
    }
	.afrah-calendar-help{
		font-size:16px;
		line-height:1.2em;
		font-weight:300;
	}
    .afrah-calendar-day {
        /* On phones, keep squares */
        aspect-ratio: 1 / 1;
        font-size: 0.8rem;
    }

    .afrah-slot-btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.6rem;
    }
}

/* Dark theme (explicit, via CSS variable) */
:root[style*="--afrah-theme:dark"] .afrah-reservation-wrapper {
    background: #020617;
    color: #e5e7eb;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.9);
}

:root[style*="--afrah-theme:dark"] .afrah-reservation-table {
    color: #9ca3af;
}

:root[style*="--afrah-theme:dark"] .afrah-calendar-day {
    background: #020617;
    color: #e5e7eb;
    border: 1px solid #1f2937;
}

:root[style*="--afrah-theme:dark"] .afrah-calendar-day--disabled {
    background: #020617;
    color: #4b5563;
    border-color: #111827;
}

:root[style*="--afrah-theme:dark"] .afrah-calendar-day--enabled:hover {
    background: #1d283a;
    box-shadow: 0 0 0 1px #60a5fa;
}

:root[style*="--afrah-theme:dark"] .afrah-calendar-day--selected {
    background: #2563eb;
    border-color: #1d4ed8;
}

:root[style*="--afrah-theme:dark"] .afrah-calendar-cell--header {
    color: #6b7280;
}

:root[style*="--afrah-theme:dark"] .afrah-field input {
    background: #020617;
    border-color: #1f2937;
    color: #e5e7eb;
}

:root[style*="--afrah-theme:dark"] .afrah-field input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 1px #60a5fa40;
}

:root[style*="--afrah-theme:dark"] .afrah-slot-btn {
    background: #020617;
    border-color: #1f2937;
    color: #e5e7eb;
}

:root[style*="--afrah-theme:dark"] .afrah-slot-btn:hover {
    background: #1d283a;
    border-color: #60a5fa;
}

