/* ================================
   RESET + VARIABLES
=================================== */
:root {
    /* Paleta crema + rosa (mobile-first) */
    --color-primary: #e86b8b;
    --color-primary-light: #f2a9bc;
    --color-secondary: #c84d6e;

    --color-bg: #fff6f2;            /* crema */
    --color-surface: #ffffff;
    --color-muted: #8b7a7a;
    --color-dark: #2a1e22;

    --radius: 16px;
    --shadow: 0 10px 30px rgba(42, 30, 34, 0.10);

    --transition: 0.2s ease;
    --font-main: "Inter", "Roboto", sans-serif;
}

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

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    background: var(--color-bg);
    font-family: var(--font-main);
    color: var(--color-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* ================================
   CONTAINER
=================================== */
.container {
    width: 92%;
    margin: 0 auto;
    padding-top: 18px;
    padding-bottom: 28px;
    max-width: 1080px;
}

/* ================================
   NAVBAR
=================================== */
.navbar {
    width: 100%;
    background: linear-gradient(135deg, #f5b8c8, var(--color-primary));
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.nav-brand {
    color: var(--color-surface);
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 18px;
}

.nav-links a {
    color: var(--color-surface);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    opacity: 0.8;
}

@media (max-width: 600px) {
    .navbar {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 10px;
    }
    .nav-links {
        width: 100%;
        gap: 10px;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .nav-links a {
        display: inline-flex;
        align-items: center;
        padding: 10px 12px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.18);
    }
}

/* ================================
   TITULOS
=================================== */
h1, h2, h3 {
    margin-bottom: 14px;
    font-weight: 700;
}

/* ================================
   BUTTONS
=================================== */
.btn,
.btn-secondary,
.btn-danger,
.btn-small {
    display: inline-block;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}

.btn {
    background: var(--color-primary);
    color: var(--color-surface);
}

.btn:hover {
    background: var(--color-secondary);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    color: var(--color-dark);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.btn-secondary:hover {
    background: #cfd6dd;
}

.btn-danger {
    background: #d9534f;
    color: white;
}

.btn-danger:hover {
    background: #c9302c;
}

.btn-small {
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* ================================
   CARDS
=================================== */
.card {
    background: var(--color-surface);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.card:hover {
    transform: translateY(-4px);
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 600px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 900px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.price {
    font-weight: bold;
    color: var(--color-primary);
    margin-bottom: 12px;
}

/* ================================
   FORMULARIOS
=================================== */
.form {
    background: var(--color-surface);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-main);
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.9);
}

input:focus,
select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.25);
}

/* ================================
   TABLES
=================================== */
.table {
    width: 100%;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-collapse: collapse;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

@media (max-width: 700px) {
    /* Evita overflow lateral por tablas en mobile */
    .table,
    .service-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.table th,
.table td {
    padding: 14px;
    text-align: left;
}

.table th {
    background: var(--color-primary);
    color: white;
    font-weight: 600;
}

.table tr:nth-child(even) {
    background: #f8f9fc;
}

.table tr:hover {
    background: #eef5ff;
}

/* ================================
   TOASTS
=================================== */
.toast {
    position: fixed;
    left: 50%;
    bottom: -100px;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    transition: all 0.4s ease;
    font-weight: 600;
}

.toast.visible {
    bottom: 30px;
    opacity: 1;
}

.service-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.service-table th,
.service-table td {
  padding: 12px;
  border-bottom: 1px solid #ddd;
}

.btn-edit {
  background-color: #3498db;
  padding: 6px 12px;
  border: none;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}

.btn-delete {
  background-color: #e74c3c;
  padding: 6px 12px;
  border: none;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}

.btn-edit:hover,
.btn-delete:hover {
  opacity: 0.8;
}

.admin-menu {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ================================
   CLIENT UI (Mobile-first)
=================================== */
.page-header {
    margin-bottom: 14px;
}

.muted {
    color: var(--color-muted);
}

.mini {
    font-size: 0.92rem;
    color: var(--color-muted);
    font-weight: 600;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(232, 107, 139, 0.12);
    color: var(--color-secondary);
    font-weight: 800;
}

.btn-full {
    width: 100%;
    text-align: center;
}

.link-back {
    display: inline-block;
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--color-secondary);
    font-weight: 700;
}

.hero {
    padding: 12px 0 6px;
}

.hero-card {
    background: radial-gradient(1200px 600px at 20% 0%, rgba(232, 107, 139, 0.25), rgba(255, 246, 242, 0)),
                linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.65));
    border-radius: 22px;
    padding: 22px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(232, 107, 139, 0.18);
}

.hero-kicker {
    color: var(--color-secondary);
    font-weight: 800;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
}

.hero-title {
    font-size: 1.9rem;
    line-height: 1.15;
    margin-bottom: 10px;
}

.hero-subtitle {
    color: var(--color-muted);
    margin-bottom: 16px;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.service-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.service-title {
    margin-bottom: 0;
}

.service-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 14px;
}

.service-detail {
    max-width: 520px;
}

.service-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.form-card {
    max-width: 720px;
}

.field label {
    display: block;
    font-weight: 800;
    margin-bottom: 6px;
}

.hint {
    display: block;
    margin-top: 6px;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 700px) {
    .hero-title { font-size: 2.2rem; }
    .grid-2 { grid-template-columns: 1fr 1fr; }
}

/* ================================
   ADMIN WEEK CAROUSEL
=================================== */
.week-shell {
    background: linear-gradient(135deg, #f8fbff, #eef3ff);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.week-label {
    color: var(--color-gray);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.week-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.week-carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 6px 4px 12px;
    max-width: 100%;
    overscroll-behavior-x: contain;
}

.week-carousel::-webkit-scrollbar {
    height: 10px;
}

.week-carousel::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 999px;
}

.day-slide {
    min-width: clamp(260px, 65vw, 340px);
    background: var(--color-white);
    border-radius: 16px;
    padding: 14px;
    box-shadow: var(--shadow);
    scroll-snap-align: start;
    border: 1px solid #e8ecf4;
}

.day-chip {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef5ff;
    color: var(--color-primary);
    font-weight: 700;
    margin-bottom: 10px;
}

.appointment-card {
    border: 1px dashed #dfe5ef;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fafbff;
}

.appointment-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.appointment-top .time {
    color: var(--color-primary);
}

.appointment-sub {
    color: var(--color-gray);
    margin: 6px 0 10px;
}

.actions {
    display: flex;
    gap: 8px;
}

.no-turns {
    color: var(--color-gray);
    margin: 6px 0;
}

.status-confirmed {
    border-color: #6dd66d;
    background: #f2fff2;
}

.status-pending {
    border-color: #f4c95d;
    background: #fffaf0;
}

.status-cancelled {
    border-color: #f08a8a;
    background: #fff5f5;
}

.carousel-controls {
    display: none;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
}

.control-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
}

.control-btn:hover {
    background: var(--color-secondary);
}

@media (min-width: 900px) {
    .week-carousel {
        overflow-x: hidden;
    }
    .carousel-controls {
        display: flex;
    }
}

/* ================================
   UTILITY CLASSES
=================================== */
.text-center { text-align: center; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mt-4 { margin-top: 24px; }
