@import url('https://fonts.googleapis.com/css2?family=Parisienne&family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --accent: #EC4899;       /* rosa/magenta vibrante, tomado del header de acmofoto.com */
  --accent-dark: #C2317A;
  --pink-soft: #FBD3DE;    /* rosa pastel del fondo de acmofoto.com */
  --pink-softer: #FDEDF2;
  --ink: #1A1A1A;
  --muted: #767676;
  --bg: #FDEDF2;
  --card: #ffffff;
  --border: #F3D9E1;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); overflow-x: hidden; }
a { color: var(--accent-dark); }
h1, h2, h3 { font-family: 'Poppins', -apple-system, sans-serif; font-weight: 700; letter-spacing: -0.01em; }

/* --- Login --- */
body.centered { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--pink-soft); }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 28px; width: 100%; box-shadow: 0 4px 24px rgba(236, 73, 153, 0.08);
  box-sizing: border-box; margin-bottom: 20px;
}
body.centered .card { max-width: 420px; }
.card h1 { margin-top: 0; font-size: 22px; }
label { display: block; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
input[type=text], input[type=password], input[type=email], input[type=number], select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 15px; color: var(--ink);
  font-family: inherit;
}
small { color: var(--muted); }
button, .btn {
  display: inline-block; background: var(--accent); color: white; border: none;
  padding: 11px 22px; border-radius: 999px; font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none; font-family: 'Poppins', sans-serif;
}
button:hover, .btn:hover { background: var(--accent-dark); }
button:disabled { background: #ccc; cursor: not-allowed; }
.btn.small { font-size: 13px; padding: 7px 14px; }
.error { color: #b23a3a; }
.success { color: #2f7d4f; }

/* --- Admin layout --- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.topbar-brand { text-decoration: none; color: inherit; }
.topbar h1 {
  font-size: 18px; margin: 0; display: flex; align-items: center; gap: 10px;
}
.topbar h1::before {
  content: "";
  display: inline-block; width: 30px; height: 30px; flex-shrink: 0;
  background-image: url("logo.png");
  background-size: contain; background-repeat: no-repeat; border-radius: 50%;
}
.topbar nav { display: flex; gap: 8px; align-items: center; font-size: 14px; flex-wrap: wrap; }
.topbar nav a {
  display: inline-block; padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  text-decoration: none; background: var(--pink-softer); color: var(--accent-dark);
  border: 1px solid transparent; transition: background 0.15s ease, color 0.15s ease;
  font-family: 'Poppins', sans-serif;
}
.topbar nav a:hover { background: var(--accent); color: white; }
.topbar nav a[href="logout.php"] { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.topbar nav a[href="logout.php"]:hover { background: #f3e6e6; color: #b23a3a; border-color: #f0c9c9; }
.topbar nav span { color: var(--muted); font-size: 13px; padding: 0 4px; }

.nav-dropdown { position: relative; }
.nav-dropdown summary {
  list-style: none; cursor: pointer; display: inline-block;
  padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--pink-softer); color: var(--accent-dark); border: 1px solid transparent;
  font-family: 'Poppins', sans-serif; transition: background 0.15s ease, color 0.15s ease;
}
.nav-dropdown summary::-webkit-details-marker,
.nav-dropdown summary::marker { display: none; content: ""; }
.nav-dropdown summary:hover { background: var(--accent); color: white; }
.nav-dropdown[open] > summary { background: var(--accent); color: white; }
.nav-dropdown-panel {
  position: absolute; top: calc(100% + 6px); right: 0; background: white;
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 220px; padding: 6px; z-index: 200; display: flex; flex-direction: column; gap: 2px;
}
.nav-dropdown-panel a, .nav-dropdown-panel .nav-dropdown-label {
  padding: 9px 12px; border-radius: 8px; font-size: 13px; text-decoration: none; color: var(--ink); text-align: left;
}
.nav-dropdown-panel a:hover { background: var(--pink-softer); }
.nav-dropdown-panel .nav-dropdown-label {
  color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border);
  margin-bottom: 4px; padding-bottom: 8px; font-size: 12px;
}
.nav-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--ink); padding: 4px 10px; }

@media (max-width: 780px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .topbar h1 { font-size: 15px; flex: 1; }
  .topbar h1::before { width: 24px; height: 24px; }
  .gallery-header::before { width: 52px; height: 52px; margin-bottom: 6px; }
  .nav-toggle { display: block; }
  .topbar nav#topbar-nav {
    display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 6px;
  }
  .topbar nav#topbar-nav.nav-open { display: flex; }
  .topbar nav#topbar-nav a, .topbar nav#topbar-nav span {
    width: 100%; text-align: center; box-sizing: border-box; padding: 10px 14px;
  }
  .nav-dropdown { width: 100%; }
  .nav-dropdown summary { width: 100%; text-align: center; box-sizing: border-box; }
  .nav-dropdown-panel {
    position: static; box-shadow: none; border: none; margin-top: 4px; padding-left: 12px;
  }
  .nav-dropdown-panel a, .nav-dropdown-panel .nav-dropdown-label { text-align: center; }
  .container { padding: 0 14px; overflow-x: auto; }
  .actions-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .actions-row .btn { width: 100%; text-align: center; }
  .table { font-size: 13px; }
  .table th, .table td { padding: 8px; }

  /* Tabla -> tarjetas apiladas en móvil (agrega la clase "stacked-table" y
     data-label="..." en cada <td> para que funcione). No requiere JS ni
     duplicar el HTML entre desktop/mobile. */
  .stacked-table thead { display: none; }
  .stacked-table, .stacked-table tbody, .stacked-table tr, .stacked-table td { display: block; width: 100%; }
  .stacked-table tr {
    margin-bottom: 14px; border: 1px solid var(--border); border-radius: 12px;
    padding: 4px 14px; background: var(--card);
  }
  .stacked-table td {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); text-align: right;
  }
  .stacked-table td:last-child { border-bottom: none; }
  .stacked-table td::before {
    content: attr(data-label); font-weight: 600; color: var(--muted);
    text-align: left; flex-shrink: 0;
  }
  .stacked-table td.cell-title {
    padding-top: 14px; font-size: 16px; font-weight: 700; color: var(--ink);
    display: block; text-align: left;
  }
  .stacked-table td.cell-title::before { content: none; }
  .stacked-table td.cell-actions {
    flex-direction: column; align-items: stretch; gap: 6px; padding-bottom: 14px;
  }
  .stacked-table td.cell-actions::before { content: none; }
  .stacked-table td.cell-actions .btn { width: 100%; text-align: center; margin: 0; }
  .modal-box { max-height: 85vh; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; padding: 12px; }
  body.centered { padding: 20px; box-sizing: border-box; }
  body.centered .card { max-width: 420px; width: 100%; padding: 24px 20px; }
  body.centered input[type=text], body.centered input[type=password] {
    padding: 12px 14px; font-size: 16px;
  }
}
.container { max-width: 1000px; margin: 24px auto; padding: 0 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.container.narrow { max-width: 520px; }
.actions-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { background: var(--pink-softer); font-size: 12px; text-transform: uppercase; color: var(--muted); }
.link-input { width: 100%; font-size: 12px; background: var(--pink-softer); border: none; padding: 6px 8px; border-radius: 6px; }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-yellow { background: #fdf0d5; color: #a3690f; }
.badge-green { background: #e1f4e5; color: #2f7d4f; }
.badge-red { background: #fde2e2; color: #b23a3a; }
.badge-orange { background: #ffe8d1; color: #b5591a; }
.selection-list { columns: 2; }

/* --- Explorador de carpetas de OneDrive --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,10,14,0.55); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: white; border-radius: 14px; width: 100%; max-width: 480px;
  max-height: 80vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--muted); padding: 4px; }
.breadcrumb { padding: 10px 20px; font-size: 13px; border-bottom: 1px solid var(--border); }
.breadcrumb button { background: none; border: none; color: var(--accent-dark); cursor: pointer; font-size: 13px; padding: 0; }
.breadcrumb span { color: var(--muted); }
.folder-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.folder-item { padding: 10px 20px; cursor: pointer; font-size: 14px; }
.folder-item:hover { background: var(--pink-softer); }
.muted-loading { color: var(--muted); font-size: 13px; padding: 12px 20px; }
.modal-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}
.modal-footer .muted-loading { padding: 0; flex: 1; word-break: break-all; }

/* --- Client-facing gallery --- */
.gallery-body { padding-bottom: 90px; }
.gallery-header {
  text-align: center; padding: 34px 16px 14px; background: var(--pink-soft); border-bottom: 1px solid var(--border);
}
.gallery-header::before {
  content: "";
  display: block; width: 64px; height: 64px; margin: 0 auto 10px;
  background-image: url("logo.png"); background-size: contain; background-repeat: no-repeat; background-position: center;
}
.gallery-header h1 {
  margin: 0 0 6px; font-size: 30px; font-family: 'Parisienne', cursive; font-weight: 400; color: var(--accent-dark);
}
.counter { margin-top: 10px; display: inline-block; background: white; padding: 6px 16px; border-radius: 999px; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
#counter-extra-note { color: var(--accent-dark); font-weight: 600; }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; padding: 20px;
}
.photo-card { position: relative; border-radius: 10px; overflow: hidden; background: #eee; aspect-ratio: 1 / 1; }
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.no-thumb { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 12px; }
.heart-btn {
  position: absolute; top: 8px; right: 8px; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.9); border: 2px solid rgba(0,0,0,0.06); font-size: 18px; color: #b0b0b0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.heart-btn.liked {
  background: var(--accent); color: white; border-color: var(--accent);
  box-shadow: 0 3px 10px rgba(236, 73, 153, 0.45);
}
.heart-btn.locked { cursor: default; opacity: 0.85; }
.heart-btn.locked:not(.liked) { opacity: 0.35; }
.dl-check-btn {
  position: absolute; bottom: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.9); border: 2px solid rgba(0,0,0,0.06); font-size: 16px; color: #999; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.dl-check-btn.checked {
  background: #2f7d4f; color: white; border-color: #2f7d4f;
  box-shadow: 0 3px 10px rgba(47, 125, 79, 0.4);
}
.heart-btn:active { transform: scale(0.9); }
.photo-thumb, .no-thumb { cursor: zoom-in; }
.zoom-btn {
  position: absolute; top: 8px; left: 8px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.85); border: none; font-size: 15px; color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.zoom-btn:hover { background: white; }
.download-btn {
  position: absolute; bottom: 8px; left: 8px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.85); border: none; font-size: 15px; color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0; text-decoration: none;
}
.download-btn:hover { background: white; }
.download-actions {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px;
}
.btn.outline {
  background: white; color: var(--accent-dark); border: 1px solid var(--border);
}
.btn.outline:hover { background: var(--pink-softer); }
.lightbox-download {
  position: absolute; bottom: 14px; left: 14px; width: 48px; height: 48px; font-size: 20px;
  background: white; color: var(--ink);
}

/* --- Lightbox --- */
.lightbox {
  position: fixed; inset: 0; background: rgba(20,10,14,0.92); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.lightbox-content { position: relative; max-width: 100%; max-height: 100%; display: flex; align-items: center; justify-content: center; }
.lightbox-content img { max-width: 100%; max-height: 88vh; border-radius: 8px; object-fit: contain; display: block; }
.lightbox-close, .lightbox-nav {
  position: absolute; background: rgba(255,255,255,0.15); border: none; color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.lightbox-close { top: 18px; right: 18px; width: 40px; height: 40px; font-size: 18px; z-index: 210; }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 28px; z-index: 210; }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-heart {
  position: absolute; bottom: 14px; right: 14px; width: 48px; height: 48px; font-size: 22px;
  background: white; color: #b0b0b0; border: 2px solid rgba(0,0,0,0.06);
}
.lightbox-heart.liked {
  background: var(--accent); color: white; border-color: var(--accent);
  box-shadow: 0 3px 10px rgba(236, 73, 153, 0.45);
}
@media (max-width: 640px) {
  .lightbox-nav { width: 38px; height: 38px; font-size: 22px; }
  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
}
.gallery-footer {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--card);
  border-top: 1px solid var(--border); padding: 14px; text-align: center;
}
.gallery-footer .btn { width: 100%; max-width: 360px; }
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: white; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; opacity: 0; transition: opacity 0.2s ease; pointer-events: none;
}
.toast.show { opacity: 1; }
.delivery-section { padding: 20px; text-align: center; }
.delivery-section h2 { margin-bottom: 4px; }
.delivery-section .grid { padding: 16px 0; }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 0 20px; }
.print-banner { margin: 10px 0; }
.comments-box { text-align: left; margin-bottom: 12px; }
.comments-box label { font-size: 13px; font-weight: 600; color: var(--ink); display: block; }
.comments-box textarea {
  width: 100%; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 14px; resize: vertical; box-sizing: border-box;
}
.resume-print-banner {
  background: #fff4e0; border-top: 1px solid #f0d9a8; border-bottom: 1px solid #f0d9a8;
  padding: 14px 20px; text-align: center;
}
.resume-print-banner p { margin: 6px 0; font-size: 14px; }
.resume-print-banner .btn { margin-top: 8px; }

/* Botón flotante de WhatsApp — en todas las páginas públicas (via public_nav.php) */
.whatsapp-float {
  position: fixed; bottom: 20px; right: 20px; z-index: 250;
  height: 52px; padding: 0 18px 0 14px; border-radius: 999px; background: #25D366;
  display: inline-flex; align-items: center; gap: 9px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25); transition: transform 0.15s ease;
  text-decoration: none; white-space: nowrap;
}
.whatsapp-float:hover { transform: scale(1.04); }
.whatsapp-float-text { color: white; font-size: 14px; font-weight: 600; }
.whatsapp-float-text-short { display: none; }
@media (max-width: 640px) {
  /* En celular no hay espacio para el texto largo sin que la píldora se
     salga de la pantalla — se acorta a "WhatsApp", pero se mantiene visible
     (no solo el ícono), que es justo el punto de agregarlo. */
  .whatsapp-float { height: 48px; padding: 0 16px 0 12px; bottom: 16px; right: 16px; }
  .whatsapp-float-text-full { display: none; }
  .whatsapp-float-text-short { display: inline; }
}
