/* Lamda — Operational Order Form Styles */
:root {
  --pink: #E5A99E; --peach: #F5D3C8; --sage: #8EB69B;
  --dark: #4A3E3D; --light: #FDFBF7; --white: #fff;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
  --radius: 16px; --radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: Inter, system-ui, sans-serif; background: var(--light); color: var(--dark); line-height: 1.6; padding-bottom: 80px; }
img { max-width: 100%; display: block; }
a { color: var(--pink); text-decoration: none; }

/* ===== HERO ===== */
.hero { background: linear-gradient(135deg, #FDFBF7 0%, #F5D3C8 40%, #FDFBF7 100%); padding: 48px 20px; text-align: center; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; }
.hero p { font-size: 1rem; color: #6b5a4a; max-width: 500px; margin: 8px auto 0; }
.hero em { font-style: normal; background: var(--pink); color: #fff; padding: 1px 6px; border-radius: 4px; font-size: .85rem; }

/* ===== PACKAGE GRID ===== */
.section { padding: 40px 16px; max-width: 1100px; margin: 0 auto; }
.section h2 { text-align: center; font-size: 1.5rem; margin-bottom: 20px; }
.pkg-grid { display: flex; flex-direction: column; align-items: center; gap: 16px; }
@media (min-width: 600px) { .pkg-grid { gap: 20px; } }

.loading-txt, .empty-txt, .err-txt { text-align: center; color: #999; padding: 40px 0; }
.err-txt { color: #e88080; }

.pkg-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; cursor: pointer; }
.pkg-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.pkg-card.added { outline: 2px solid var(--pink); outline-offset: -1px; }

.pkg-card .img-wrap { position: relative; aspect-ratio: 9/16; overflow: hidden; background: #f5f0eb; }
.pkg-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.pkg-card .img-wrap:hover img { transform: scale(1.04); }
.pkg-card .img-wrap .img-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; }

.pkg-card .img-wrap .tap-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  color: #fff; font-size: .7rem; font-weight: 700; text-align: center;
  padding: 16px 8px 8px; opacity: 0; transition: opacity .2s;
}
.pkg-card .img-wrap:hover .tap-overlay { opacity: 1; }

.pkg-card .badge {
  position: absolute; top: 8px; left: 8px;
  background: #d4a840; color: #fff; font-size: .6rem; font-weight: 700;
  padding: 3px 8px; border-radius: 20px; text-transform: uppercase; z-index: 2;
}

.pkg-card .info { padding: 10px; }
.pkg-card .info .name { font-size: .82rem; font-weight: 700; line-height: 1.3; margin-bottom: 2px; }
.pkg-card .info .price { font-size: .9rem; font-weight: 700; color: var(--pink); }
.pkg-card .info .price .orig { text-decoration: line-through; color: #bbb; font-size: .7rem; margin-left: 4px; font-weight: 400; }
.pkg-card .info .card-status { font-size: .65rem; color: #999; margin-top: 1px; }

/* ===== GALLERY MODAL (legacy — kept for admin) ===== */
.gallery-modal { max-width: 720px !important; width: 96% !important; padding: 0 !important; overflow: hidden !important; }

/* ===== GALLERY PAGE (static) ===== */
.gallery-page { padding-top: 56px; padding-bottom: 80px; }
.gallery-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: #fff; border-bottom: 1px solid #f0ece6;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; height: 48px;
}
.gallery-back { font-weight: 600; font-size: .9rem; color: var(--pink); text-decoration: none; }
.gallery-title { font-weight: 700; font-size: .9rem; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }

.gallery-info { text-align: center; padding: 24px 16px 8px; }
.gallery-info h1 { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.gallery-info .gallery-price { font-size: 1.2rem; font-weight: 700; color: var(--pink); }
.gallery-info .gallery-price .orig { text-decoration: line-through; color: #bbb; font-size: .85rem; margin-left: 6px; font-weight: 400; }
.gallery-info .gallery-desc { font-size: .85rem; color: #888; margin-top: 6px; max-width: 450px; margin-left: auto; margin-right: auto; }
.gallery-info .gallery-hint { font-size: .75rem; color: #bbb; margin-top: 8px; }

.gallery-images { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 0 12px 20px; }
.gallery-loading { text-align: center; padding: 80px 20px; color: #999; font-size: 1rem; }
.gallery-error { text-align: center; padding: 80px 20px; color: #e88080; }

.gallery-header { padding: 16px 20px 8px; text-align: center; }
.gallery-header h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; }
.gallery-header .gallery-price { font-size: 1.15rem; font-weight: 700; color: var(--pink); }
.gallery-header .gallery-price .orig { text-decoration: line-through; color: #bbb; font-size: .82rem; margin-left: 6px; font-weight: 400; }
.gallery-header .gallery-desc { font-size: .82rem; color: #888; margin-top: 6px; max-width: 450px; margin-left: auto; margin-right: auto; }
.gallery-header .gallery-in-cart { display: inline-block; margin-top: 8px; background: var(--sage); color: #fff; font-size: .78rem; font-weight: 600; padding: 5px 14px; border-radius: 20px; }

.gallery-grid { display: flex; flex-direction: column; gap: 14px; padding: 12px 12px 20px; max-height: 72vh; overflow-y: auto; align-items: center; }

.gallery-img-card {
  background: var(--white); border-radius: var(--radius-sm); overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.07); display: flex; flex-direction: column;
  transition: transform .2s; width: 100%; max-width: 100%;
}
.gallery-img-card:hover { transform: translateY(-2px); }
.gallery-img-card img { width: 100%; aspect-ratio: 9/16; object-fit: cover; background: #f5f0eb; }
.gallery-img-card .gallery-placeholder {
  width: 100%; aspect-ratio: 9/16; background: #f5f0eb;
  display: flex; align-items: center; justify-content: center; font-size: 5rem;
}

/* Add to Order button inside gallery */
.gallery-img-card .btn-add-card {
  width: 100%; padding: 10px; border: none;
  background: var(--pink); color: #fff;
  font-size: .75rem; font-weight: 700; cursor: pointer;
  transition: background .2s; letter-spacing: .02em;
}
.gallery-img-card .btn-add-card:hover { background: #d49188; }
.gallery-img-card .btn-add-card.added-btn { background: var(--sage); }
.gallery-img-card .btn-add-card.added-btn:hover { background: #7aa38a; }

.gallery-modal .close { position: absolute; top: 12px; right: 16px; z-index: 10; background: rgba(0,0,0,.35); color: #fff; border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ===== CART FLOATING BAR ===== */
#cartBar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 2px solid var(--pink);
  padding: 10px 16px; z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,.1);
}
.cart-bar-inner { display: flex; justify-content: space-between; align-items: center; max-width: 1100px; margin: 0 auto; }
.cart-bar-count { font-weight: 700; font-size: .85rem; }
.cart-bar-total { color: var(--pink); font-weight: 700; font-size: .95rem; margin-left: 12px; }
.btn-cart-open { padding: 10px 20px; background: var(--pink); color: #fff; border: none; border-radius: 10px; font-weight: 700; font-size: .85rem; cursor: pointer; }

/* ===== ADDED TOAST ===== */
.added-toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: var(--sage); color: #fff; padding: 10px 20px; border-radius: 10px;
  font-size: .82rem; font-weight: 600; z-index: 2000; opacity: 0;
  pointer-events: none; transition: opacity .25s, transform .25s;
  box-shadow: 0 4px 16px rgba(0,0,0,.15); white-space: nowrap;
}
.added-toast.show { opacity: 1; transform: translateX(-50%) translateY(4px); }

/* ===== ORDER MODAL ===== */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.5); align-items: flex-start; justify-content: center; padding: 0; }
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: 20px; max-width: 480px; width: 100%; max-height: calc(100dvh - 24px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 20px; padding-bottom: 24px; animation: slideUp .25s ease; position: relative; margin: 12px 8px; }

/* Fullscreen on mobile */
@media (max-width: 480px) {
  .modal-overlay.open { align-items: stretch; }
  .modal { border-radius: 0; max-width: 100%; max-height: none; height: 100dvh; margin: 0; overflow-y: auto; padding: 20px 16px 32px; }
}
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.modal .close { float: right; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #999; line-height: 1; }
.modal h3 { font-size: 1.05rem; margin-bottom: 12px; }

/* Cart items in modal */
.cart-items { margin-bottom: 4px; }
.cart-item-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 8px 0; border-bottom: 1px solid #f0ece6; font-size: .85rem;
}
.cart-item-name { flex: 1 1 100%; font-weight: 600; }
.cart-item-meta { font-size: .75rem; color: #888; }
.cart-item-qty { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.cart-item-qty button {
  border: 1.5px solid #ddd; background: #fff; border-radius: 50%;
  width: 26px; height: 26px; cursor: pointer; font-size: 1rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: border-color .2s;
}
.cart-item-qty button:hover { border-color: var(--pink); }
.cart-item-qty span { min-width: 20px; text-align: center; font-weight: 600; }

/* Addon section */
.addon-section { background: #fdf8f5; border-radius: var(--radius-sm); padding: 12px; margin-top: 12px; }
.addon-section h4 { font-size: .8rem; color: #888; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.addon-opt {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  cursor: pointer; border-bottom: 1px solid #f0e6e0; user-select: none;
}
.addon-opt:last-child { border-bottom: none; }
.addon-opt input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--pink); cursor: pointer; flex-shrink: 0; }
.addon-label { font-size: .85rem; font-weight: 500; flex: 1; }
.addon-price { font-weight: 700; color: var(--pink); font-size: .82rem; flex-shrink: 0; }

/* Form fields */
.fg { margin-bottom: 10px; }
.fg label { display: block; font-size: .7rem; font-weight: 700; color: #666; text-transform: uppercase; margin-bottom: 3px; }
.fg input, .fg textarea, .fg select { width: 100%; padding: 10px; border: 1.5px solid #e0d6d0; border-radius: var(--radius-sm); font-size: .85rem; outline: none; font-family: inherit; }
.fg input:focus, .fg textarea:focus { border-color: var(--pink); }
.fg textarea { min-height: 50px; resize: vertical; }
.fg-row { display: flex; gap: 10px; }
.fg-row .fg { flex: 1; }

/* Summary */
.summary { background: var(--light); border-radius: var(--radius-sm); padding: 10px; margin-top: 8px; font-size: .8rem; }
.summary .row { display: flex; justify-content: space-between; padding: 2px 0; }
.summary .total { font-weight: 700; font-size: 1rem; margin-top: 4px; padding-top: 6px; border-top: 1.5px solid #e0d6d0; color: var(--pink); }

/* Buttons */
.btn-wa { width: 100%; padding: 14px; background: #25D366; color: #fff; border: none; border-radius: 12px; font-size: .95rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; transition: background .2s; }
.btn-wa:hover { background: #1ebe57; }
.btn-wa:disabled { background: #aaa; cursor: not-allowed; }
.btn-primary { width: 100%; padding: 12px; background: var(--pink); color: #fff; border: none; border-radius: 12px; font-weight: 700; cursor: pointer; font-size: .9rem; }

/* Floating WhatsApp */
.fab-wa { position: fixed; bottom: 80px; right: 20px; z-index: 50; background: #25D366; color: #fff; font-size: 1.3rem; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(37,211,102,.4); text-decoration: none; animation: bounce 2s infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Admin mode banner */
.admin-banner { display: none; background: var(--dark); color: #fff; text-align: center; padding: 6px; font-size: .75rem; }
.admin-banner.show { display: block; }
.admin-banner a { color: var(--peach); margin: 0 6px; }

/* ===== ADMIN DASHBOARD ===== */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar { width: 200px; background: var(--dark); color: #fff; padding: 16px 0; flex-shrink: 0; }
.admin-sidebar a { display: block; color: #fff; padding: 9px 16px; font-size: .85rem; text-decoration: none; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,.1); }
.admin-main { flex: 1; padding: 20px; background: #f8f6f3; }
.admin-main h1 { font-size: 1.3rem; margin-bottom: 16px; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th { background: #f5f0eb; text-align: left; padding: 8px 12px; font-size: .7rem; text-transform: uppercase; color: #666; }
.admin-table td { padding: 8px 12px; border-top: 1px solid #f0ece6; font-size: .8rem; }
.admin-table .thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.admin-table button { background: none; border: 1px solid #ddd; padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: .7rem; margin: 0 1px; }

/* Upload zone */
.upload-zone { border: 2px dashed #e0d6d0; border-radius: 12px; padding: 24px; text-align: center; cursor: pointer; transition: border-color .2s; margin: 12px 0; }
.upload-zone:hover, .upload-zone.drag { border-color: var(--pink); background: #fdf8f5; }
.upload-preview { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.upload-preview img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--light); }
.login-card { background: var(--white); padding: 28px; border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,.08); width: 340px; max-width: 90vw; }
.login-card h1 { text-align: center; font-size: 1.2rem; margin-bottom: 20px; }

.toast { position: fixed; bottom: 20px; right: 20px; padding: 10px 16px; border-radius: 8px; color: #fff; font-size: .8rem; z-index: 2000; }
.toast.success { background: var(--sage); }
.toast.error { background: #e88080; }

@media (max-width: 768px) {
  .admin-sidebar { width: 100%; display: flex; flex-wrap: wrap; padding: 8px; }
  .admin-sidebar a { padding: 6px 10px; font-size: .75rem; }
  .admin-wrap { flex-direction: column; }
  .section { padding: 24px 10px; }
  .gallery-grid { gap: 10px; padding: 12px 14px 16px !important; }
  .gallery-header { padding: 14px 16px 6px; }
  .fab-wa { bottom: 90px; }
