/* Location: www.melgeneportal.com/services2/assets/style.css
   Purpose: Shared Facebook-style theme used by all admin pages. */

:root {
    --fb-blue: #1877F2;
    --fb-blue-dark: #166FE5;
    --fb-bg: #F0F2F5;
    --fb-card: #FFFFFF;
    --fb-text: #050505;
    --fb-text-2: #65676B;
    --fb-border: #CED0D4;
    --fb-grey: #E4E6EB;
    --fb-grey-dark: #D8DADF;
    --fb-green: #1A7F37;
    --fb-green-bg: #E7F3E8;
    --fb-radius: 8px;
    --fb-shadow: 0 1px 2px rgba(0,0,0,.10), 0 1px 3px rgba(0,0,0,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--fb-bg);
    color: var(--fb-text);
    line-height: 1.4;
}

/* ---------- Top bar ---------- */
header {
    background: var(--fb-card);
    box-shadow: var(--fb-shadow);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}
header h1 { font-size: 20px; font-weight: 700; color: var(--fb-blue); }
header a {
    color: var(--fb-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    background: var(--fb-grey);
    padding: 8px 14px;
    border-radius: 6px;
}
header a:hover { background: var(--fb-grey-dark); }

/* ---------- Layout ---------- */
.content { padding: 20px 16px; max-width: 680px; margin: 0 auto; }
.content.wide { max-width: 920px; }

.card {
    background: var(--fb-card);
    padding: 20px;
    border-radius: var(--fb-radius);
    box-shadow: var(--fb-shadow);
}

h2 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }

/* ---------- Forms ---------- */
label { display: block; font-size: 14px; font-weight: 600; color: var(--fb-text-2); margin-bottom: 6px; }

input[type="text"], input[type="password"], input[type="number"],
textarea, input[type="file"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--fb-border);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
}
input:focus, textarea:focus {
    outline: none;
    border-color: var(--fb-blue);
    box-shadow: 0 0 0 2px rgba(24,119,242,.20);
}
textarea { resize: vertical; min-height: 90px; }
input[type="file"] { padding: 9px 12px; background: #F7F8FA; }

/* ---------- Buttons ---------- */
button, .btn {
    width: 100%;
    padding: 12px;
    background: var(--fb-blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
button:hover, .btn:hover { background: var(--fb-blue-dark); }

.add-row {
    width: auto; background: var(--fb-grey); color: var(--fb-text);
    padding: 8px 14px; font-size: 13px; font-weight: 600; margin-bottom: 6px;
}
.add-row:hover { background: var(--fb-grey-dark); }
.price-row .remove-row {
    width: 42px; background: var(--fb-grey); color: var(--fb-text);
    font-size: 18px; line-height: 1; padding: 0;
}
.price-row .remove-row:hover { background: var(--fb-grey-dark); }

/* ---------- Messages ---------- */
.msg, .error { padding: 12px; border-radius: 6px; font-size: 14px; margin-bottom: 16px; text-align: center; }
.msg.success { background: var(--fb-green-bg); color: var(--fb-green); }
.msg.error, .error { background: #FFEBE9; color: #C0392B; }
.hint { font-size: 12px; color: var(--fb-text-2); margin-top: -10px; margin-bottom: 16px; }

/* ---------- Dashboard menu ---------- */
.menu { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.menu a {
    background: var(--fb-blue); color: #fff; text-decoration: none;
    padding: 12px 18px; border-radius: 6px; font-size: 15px; font-weight: 600;
}
.menu a:hover { background: var(--fb-blue-dark); }

/* ---------- Login ---------- */
.login-wrap {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 20px;
}
.login-brand {
    font-size: 40px; font-weight: 800; color: var(--fb-blue);
    margin-bottom: 14px; letter-spacing: -1px;
}
.login-box {
    background: var(--fb-card); padding: 24px; border-radius: var(--fb-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,.15); width: 100%; max-width: 380px;
}
.login-box h1 { font-size: 18px; text-align: center; margin-bottom: 18px; color: var(--fb-text); }

/* ---------- Search bar ---------- */
.search-bar { display: flex; gap: 8px; margin-bottom: 20px; }
.search-bar input { flex: 1; margin-bottom: 0; }
.search-bar button { width: auto; padding: 12px 20px; font-size: 15px; }
.search-bar a.clear {
    padding: 12px 16px; background: var(--fb-grey); color: var(--fb-text);
    border-radius: 6px; font-size: 14px; font-weight: 600; text-decoration: none;
    display: inline-flex; align-items: center;
}
.search-bar a.clear:hover { background: var(--fb-grey-dark); }

/* ---------- Service cards ---------- */
.service {
    background: var(--fb-card); padding: 16px 18px; border-radius: var(--fb-radius);
    box-shadow: var(--fb-shadow); margin-bottom: 16px;
}
.prices { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.price-tag {
    background: var(--fb-green-bg); color: var(--fb-green); font-weight: 700;
    font-size: 14px; padding: 5px 12px; border-radius: 16px;
}
.details { font-size: 14px; color: #3A3B3C; margin: 8px 0; white-space: pre-line; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumbs img {
    width: 96px; height: 96px; object-fit: cover;
    border-radius: 8px; border: 1px solid var(--fb-grey);
}
.empty { text-align: center; color: var(--fb-text-2); padding: 40px 0; }

/* ---------- Price rows (add form) ---------- */
.price-row { display: flex; gap: 8px; margin-bottom: 8px; }
.price-row input[type="text"] { flex: 1; margin-bottom: 0; }
.price-row input[type="number"] { width: 130px; margin-bottom: 0; }

/* ---------- Record actions (edit / delete) ---------- */
.actions { display: flex; gap: 8px; margin-top: 12px; }
.actions a, .actions button {
    width: auto; font-size: 13px; font-weight: 600; padding: 7px 14px;
    border-radius: 6px; text-decoration: none; cursor: pointer; border: none;
}
.btn-edit { background: var(--fb-grey); color: var(--fb-text); }
.btn-edit:hover { background: var(--fb-grey-dark); }
.btn-delete { background: #FFEBE9; color: #C0392B; }
.btn-delete:hover { background: #FFD9D6; }

/* ---------- Existing images (edit page) ---------- */
.existing-images { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.img-edit { text-align: center; font-size: 12px; color: var(--fb-text-2); }
.img-edit img {
    display: block; width: 90px; height: 90px; object-fit: cover;
    border-radius: 6px; border: 1px solid var(--fb-grey); margin-bottom: 4px;
}
.img-edit label { display: flex; align-items: center; justify-content: center; gap: 4px; font-weight: 400; }
.img-edit input[type="checkbox"] { width: auto; margin: 0; }

/* ====================================================================
   PUBLIC SHOP (index.php) — client-facing, no login
   ==================================================================== */
.shop-header {
    background: var(--fb-card);
    box-shadow: var(--fb-shadow);
    position: sticky; top: 0; z-index: 10;
}
.shop-bar {
    max-width: 1100px; margin: 0 auto; padding: 12px 16px;
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.shop-brand { font-size: 22px; font-weight: 800; color: var(--fb-blue); white-space: nowrap; }
.shop-search { display: flex; gap: 8px; flex: 0 1 520px; min-width: 220px; }
.shop-search input { flex: 1; margin-bottom: 0; }
.shop-search button { width: auto; padding: 10px 18px; font-size: 15px; }

.shop-main { max-width: 1100px; margin: 0 auto; padding: 20px 16px; }
.shop-title { font-size: 22px; font-weight: 700; margin-bottom: 14px; }
.results-note { font-size: 14px; color: var(--fb-text-2); margin-bottom: 16px; }
.results-note a { color: var(--fb-blue); text-decoration: none; font-weight: 600; }

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.product-card {
    background: var(--fb-card); border-radius: var(--fb-radius);
    box-shadow: var(--fb-shadow); overflow: hidden;
    display: flex; flex-direction: column;
}
.product-image { width: 100%; aspect-ratio: 1 / 1; background: var(--fb-bg); }
.product-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-image .no-image {
    width: 100%; height: 100%; display: flex; align-items: center;
    justify-content: center; color: var(--fb-text-2); font-size: 13px;
}
.product-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.product-prices { display: flex; flex-wrap: wrap; gap: 6px; }
.product-name { font-size: 15px; font-weight: 600; margin: 0; }
.product-details {
    font-size: 13px; color: var(--fb-text-2); margin: 0; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Save progress bar (shown while a record is saving) ---------- */
.save-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 4px;
    overflow: hidden; display: none; z-index: 1000; background: rgba(24,119,242,.15);
}
.save-progress.active { display: block; }
.save-progress::before {
    content: ""; position: absolute; top: 0; height: 100%; width: 40%;
    background: var(--fb-blue); animation: save-indeterminate 1.1s infinite ease-in-out;
}
@keyframes save-indeterminate {
    0%   { left: -40%; }
    100% { left: 100%; }
}

/* ====================================================================
   LANDING PAGE (website root /index.php)
   ==================================================================== */
.landing-banner { width: 100%; line-height: 0; background: var(--fb-card); }
.banner-inner { max-width: 1000px; margin: 0 auto; }
.banner-inner img { width: 100%; height: auto; display: block; }

.landing-hero { max-width: 760px; margin: 0 auto; padding: 48px 20px 32px; text-align: center; }
.hero-title { font-size: 30px; font-weight: 800; color: var(--fb-text); margin-bottom: 12px; letter-spacing: -0.5px; }
.hero-text { font-size: 16px; color: var(--fb-text-2); margin-bottom: 28px; line-height: 1.6; }
.hero-cta {
    display: inline-block; background: var(--fb-blue); color: #fff;
    font-size: 17px; font-weight: 700; text-decoration: none;
    padding: 14px 30px; border-radius: 8px; box-shadow: var(--fb-shadow);
    transition: transform .08s ease, background .15s ease;
}
.hero-cta:hover { background: var(--fb-blue-dark); transform: translateY(-1px); }
.hero-cta:active { transform: translateY(0); }

.landing-footer { text-align: center; color: var(--fb-text-2); font-size: 13px; padding: 28px 20px 36px; }

/* ---------- Landing navigation menu ---------- */
.landing-nav { background: var(--fb-card); box-shadow: var(--fb-shadow); position: sticky; top: 0; z-index: 20; }
.nav-inner {
    max-width: 1100px; margin: 0 auto; padding: 10px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.nav-links { display: flex; flex-wrap: wrap; gap: 4px; }
.nav-links a {
    color: var(--fb-text); text-decoration: none; font-size: 15px; font-weight: 600;
    padding: 8px 14px; border-radius: 6px;
}
.nav-links a:hover { background: var(--fb-grey); }
.nav-social { display: flex; flex-wrap: wrap; gap: 8px; }
.nav-social a {
    text-decoration: none; font-size: 14px; font-weight: 600; color: #fff;
    padding: 8px 14px; border-radius: 6px;
}
.nav-social .fb { background: #1877F2; }
.nav-social .fb:hover { background: #166FE5; }
.nav-social .msgr { background: #0084FF; }
.nav-social .msgr:hover { background: #0078E7; }

@media (max-width: 640px) {
    .nav-inner { justify-content: center; }
    .nav-links, .nav-social { justify-content: center; }
}

/* ====================================================================
   CONTACTS PAGE (services2/contacts/contacts.php)
   ==================================================================== */
.header-links { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

.contacts-main { max-width: 1000px; margin: 0 auto; padding: 24px 20px; }
.contacts-title { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.contacts-sub { color: var(--fb-text-2); font-size: 15px; margin-bottom: 18px; }

.contacts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 18px; }
.contact-card { background: var(--fb-card); border-radius: var(--fb-radius); box-shadow: var(--fb-shadow); overflow: hidden; }
.branch-name { font-size: 18px; font-weight: 700; color: var(--fb-blue); padding: 16px 18px 8px; }

.contact-list { list-style: none; padding: 0 18px 14px; margin: 0; }
.contact-list li {
    display: flex; justify-content: space-between; gap: 12px; padding: 8px 0;
    border-bottom: 1px solid var(--fb-bg); font-size: 15px;
}
.contact-list li:last-child { border-bottom: none; }
.contact-list .label { color: var(--fb-text-2); font-weight: 600; }
.contact-list a { color: var(--fb-blue); text-decoration: none; font-weight: 700; white-space: nowrap; }
.contact-list a:hover { text-decoration: underline; }

.map-embed { line-height: 0; }
.map-embed iframe { width: 100%; height: 300px; border: 0; display: block; }

@media (max-width: 420px) {
    .contacts-grid { grid-template-columns: 1fr; }
}

/* ====================================================================
   MOBILE ENHANCEMENTS
   ==================================================================== */
body { -webkit-text-size-adjust: 100%; }

/* Tablets and large phones */
@media (max-width: 768px) {
    .content { padding: 16px 12px; }
    .shop-main { padding: 16px 12px; }
    .contacts-main { padding: 20px 16px; }
    header { padding: 11px 14px; }
    header h1 { font-size: 18px; }
}

/* Phones */
@media (max-width: 480px) {
    /* Shop shows two products per row, like a typical mobile store */
    .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-body { padding: 10px 12px; gap: 5px; }
    .product-name { font-size: 14px; }
    .product-details { font-size: 12px; }
    .price-tag { font-size: 12px; padding: 4px 9px; }

    /* Dashboard: full-width stacked buttons (bigger tap targets) */
    .menu { flex-direction: column; }
    .menu a { width: 100%; text-align: center; }

    /* Cards a touch tighter */
    .card { padding: 16px; }

    /* Search bars wrap with a full-width input */
    .shop-search, .search-bar { flex-wrap: wrap; }
    .shop-search input, .search-bar input { flex: 1 1 100%; }
    .shop-search button, .search-bar button { flex: 1; }
    .search-bar a.clear { flex: 1; justify-content: center; }

    /* Price rows: label on its own line, amount + remove share a line */
    .price-row { flex-wrap: wrap; }
    .price-row input[type="text"] { flex: 1 1 100%; }
    .price-row input[type="number"] { flex: 1 1 auto; width: auto; }

    /* Landing + headings scale down a touch */
    .landing-hero { padding: 32px 16px 24px; }
    .hero-title { font-size: 24px; }
    .login-brand { font-size: 34px; }
    .shop-brand { font-size: 20px; }
    .contacts-title { font-size: 21px; }

    /* Navigation fits more comfortably */
    .nav-links a { padding: 7px 10px; font-size: 14px; }
    .nav-social a { padding: 7px 12px; font-size: 13px; }

    /* Shorter maps to reduce scrolling */
    .map-embed iframe { height: 240px; }
}

/* ====================================================================
   PORTFOLIO FEED (public, Facebook-post style)
   ==================================================================== */
.feed { max-width: 600px; margin: 0 auto; padding: 20px 12px; }
.feed-title { font-size: 22px; font-weight: 800; margin-bottom: 16px; padding: 0 4px; }

.post {
    background: var(--fb-card); border-radius: var(--fb-radius);
    box-shadow: var(--fb-shadow); margin-bottom: 16px; overflow: hidden;
}
.post-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.post-avatar {
    width: 40px; height: 40px; border-radius: 50%; background: var(--fb-blue);
    color: #fff; font-weight: 800; font-size: 15px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.post-meta { display: flex; flex-direction: column; min-width: 0; }
.post-name { font-size: 15px; font-weight: 700; color: var(--fb-text); }
.post-date { font-size: 12px; color: var(--fb-text-2); }

.post-text { padding: 0 14px 12px; font-size: 15px; color: var(--fb-text); white-space: pre-line; line-height: 1.5; }

.post-media { display: grid; gap: 2px; }
.post-media.count-1 { grid-template-columns: 1fr; }
.post-media.count-1 img { width: 100%; max-height: 560px; object-fit: cover; display: block; }
.post-media.grid { grid-template-columns: repeat(2, 1fr); }
.post-media.grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }

.feed .empty { text-align: center; color: var(--fb-text-2); padding: 40px 0; }

/* Smooth in-page scrolling + offset so the sticky nav doesn't cover anchors */
html { scroll-behavior: smooth; }
.feed { scroll-margin-top: 70px; }