/* ==========================================================================
   СРС 3 — Модуль 3: CSS та адаптивна верстка
   Проєкт: Лисі Котики Прага
   ========================================================================== */

/* ==================== BASE & RESET ==================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    line-height: 1.5;
    color: #242424;
    background: #f8f9fa;
}

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3 {
    margin: 0 0 16px;
    line-height: 1.2;
    font-weight: bold;
}

p {
    margin: 0 0 16px;
    opacity: 0.9;
}

/* ==================== LAYOUT & CONTAINER ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
}

/* ==================== TOP BAR ==================== */
.top-bar {
    background: #ff9800;
    color: #000;
    text-align: center;
    padding: 8px;
    font-size: 14px;
}

/* ==================== HEADER ==================== */
.header {
    background: #1a1a1a;
    color: white;
    padding: 15px 0;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    height: 70px;
}

.nav {
    display: flex;
    gap: 25px;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap;
}

.nav a:hover {
    color: #ff9800;
}

.search-cart {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-cart input {
    width: 280px;
    padding: 10px 15px;
    border-radius: 5px;
    border: none;
}

.button {
    background: #ff9800;
    color: #000;
    padding: 10px 25px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    white-space: nowrap;
    display: inline-block;
}

.phone {
    white-space: nowrap;
    font-weight: bold;
}

/* ==================== HERO ==================== */
.hero {
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)),
                url('../images/hero-sphynx.webp') center/cover no-repeat;
    color: white;
    text-align: center;
    padding: 120px 20px;
}

.hero h1 {
    font-size: 48px;
    margin: 0;
}

.hero p {
    font-size: 22px;
    margin: 20px 0;
}

/* ==================== CARDS & COMPONENTS ==================== */
.card,
.cat-card,
.service-card,
.benefit-card,
.step {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.cat-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
}

/* ==================== CAT DETAIL PAGE (cat.php) ==================== */
.cat-detail {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.cat-detail-image {
    width: 100%;
    max-width: 420px;
    border-radius: 8px;
    object-fit: cover;
}

.cat-detail-info {
    flex: 1;
    min-width: 260px;
}

.cat-detail-info .button {
    margin: 6px 6px 0 0;
}

/* ==================== SECTIONS LAYOUT ==================== */
.benefits,
.services {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.benefit-card,
.service-card {
    flex: 1;
    min-width: 280px;
}

.steps {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.step {
    width: 220px;
}

/* ==================== CONTACTS ==================== */
.contacts-section {
    background: #f1f1f1;
}

/* ==================== FORM ==================== */
form {
    max-width: 520px;
    margin: 0 auto;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 16px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #ff9800;
}

/* ==================== FOOTER ==================== */
footer {
    background: #1a1a1a;
    color: white;
    padding: 40px 0;
    text-align: center;
}

/* ==========================================================================
   ADAPTIVE LAYOUT — MOBILE-FIRST
   ========================================================================== */

/* ── Базові стилі (мобільні < 768px) ── */
.header .container {
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.nav {
    flex-direction: column;
    gap: 8px;
    width: 100%;
    text-align: center;
}

.benefits,
.services {
    flex-direction: column;
    gap: 16px;
}

.benefit-card,
.service-card {
    width: 100%;
}

/* .cats-grid — задається в HTML-файлі або іншому css, тут лише адаптив */
.cats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

form {
    max-width: 100%;
}

/* ── Планшет (≥ 768px) ── */
@media (min-width: 768px) {
    .header .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .nav {
        flex-direction: row;
        gap: 25px;
        width: auto;
    }
    
    .benefits,
    .services {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }
    
    .benefit-card,
    .service-card {
        flex: 1;
        min-width: 280px;
    }
    
    .cats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    form {
        max-width: 520px;
    }
}

/* ── Десктоп (≥ 1024px) ── */
@media (min-width: 1024px) {
    .cats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .benefits,
    .services {
        gap: 24px;
    }
    
    .hero {
        padding: 160px 20px;
    }
}

/* ── Дуже великий екран (≥ 1200px) ── */
@media (min-width: 1200px) {
    .cats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Дуже маленькі екрани (< 480px) — додатковий сценарій СРС 3 ── */
@media (max-width: 479px) {
    .benefits,
    .services,
    .cats-grid {
        gap: 12px;
    }
    
    .cat-card,
    .benefit-card,
    .service-card {
        padding: 12px;
        font-size: 15px;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .hero p {
        font-size: 18px;
    }
    
    .section-title {
        font-size: 26px;
    }

}

/* ==========================================================================
   ЛР8 — додаткові стилі (форма + мобільне меню)
   ========================================================================== */
.contact-form {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.form-message {
    margin-top: 20px;
    font-weight: bold;
    text-align: center;
    min-height: 60px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    color: white;
    cursor: pointer;
}

@media (max-width: 767px) {
    .mobile-menu-btn {
        display: block;
    }
    .nav {
        display: none;
        flex-direction: column;
        width: 100%;
        text-align: center;
    }
    .nav.active {
        display: flex;
    }
}

/* ==========================================================================
   Helpers (перенесено з inline style="" у HTML)
   ========================================================================== */

.section--white {
    background: #fff;
}

.section--light {
    background: #f8f9fa;
}

.text-center {
    text-align: center;
}

.mt-15 {
    margin-top: 15px;
}

.mb-30 {
    margin-bottom: 30px;
}

.my-30 {
    margin: 30px 0;
}

.search-input {
    width: 300px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* filter-btn reuses .button's look; .active marks the selected color --
   without this there was no visual difference between filters at all. */
.filter-btn {
    opacity: 0.6;
    border: 2px solid transparent;
}

.filter-btn.active {
    opacity: 1;
    border-color: #000;
}

.cats-container-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.delivery-price-btn {
    padding: 15px 30px;
    font-size: 18px;
}

.price-highlight {
    font-size: 20px;
    color: #ff9800;
}

.testimonials-row {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.testimonial-card {
    max-width: 350px;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.load-reviews-btn {
    margin: 30px auto;
    display: block;
}

.managers-row {
    display: flex;
    gap: 50px;
    justify-content: center;
    flex-wrap: wrap;
}

.manager-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
}

.about-lead {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 18px;
}

.requests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* .delete-link used to be an <a>; it's now a <button> inside a one-button
   <form> (so deletion can be a real POST -- see docs/report.md Editor's
   notes), so the default button chrome needs resetting to keep the same
   plain red inline-link look. */
.delete-link {
    color: red;
    margin-left: 10px;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.error-text {
    color: red;
}

/* Status filter pills / pagination on admin_requests.php */
.status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.button.active {
    background: #000;
    color: #fff;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
}

.status-new {
    background: #fff3cd;
    color: #856404;
}

.status-in_progress {
    background: #cfe2ff;
    color: #084298;
}

.status-closed {
    background: #d1e7dd;
    color: #0f5132;
}

/* ==========================================================================
   Таблиці (admin_requests.php)
   ========================================================================== */

.table-card {
    padding: 0;
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: #1a1a1a;
    color: #fff;
    position: sticky;
    top: 0;
}

.data-table tbody tr:hover {
    background: #fff7e8;
}

.data-table td:last-child,
.data-table th:last-child {
    white-space: nowrap;
}

/* ==========================================================================
   Header actions: language switcher + auth/cart (added with i18n + accounts)
   ========================================================================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.logo-link {
    display: inline-block;
    line-height: 0;
}

/* Language switcher — flag pills, identical layout on desktop and mobile */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #2a2a2a;
    border-radius: 999px;
    padding: 4px;
}

.lang-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 28px;
    border-radius: 999px;
    font-size: 17px;
    line-height: 1;
    text-decoration: none;
    filter: grayscale(55%);
    opacity: 0.7;
    transition: filter .15s, opacity .15s, background .15s;
}

.lang-link:hover {
    filter: none;
    opacity: 1;
}

.lang-link.active {
    background: #ff9800;
    filter: none;
    opacity: 1;
}

/* Auth buttons — one cohesive pair (no "pretty + plain text" mismatch) */
.btn-ghost,
.btn-solid,
.btn-account {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.btn-ghost {
    color: #fff;
    background: transparent;
    border: 1.5px solid #555;
}

.btn-ghost:hover {
    border-color: #ff9800;
    color: #ff9800;
}

.btn-solid {
    color: #000;
    background: #ff9800;
    border: 1.5px solid #ff9800;
}

.btn-solid:hover {
    filter: brightness(1.06);
}

.btn-account {
    color: #fff;
    background: #2a2a2a;
    border: 1.5px solid #555;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-account:hover {
    border-color: #ff9800;
}

.btn-account__icon {
    font-size: 14px;
}

.cart-link {
    position: relative;
    font-size: 22px;
    text-decoration: none;
    line-height: 1;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ff9800;
    color: #000;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    padding: 0 4px;
}

.nav-admin {
    color: #ff9800 !important;
}

/* Catalog / treats filter buttons — flex row that wraps cleanly (they used
   to overlap on narrow phones because they were loose inline-blocks). */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.filter-row .button {
    padding: 9px 18px;
}

.search-input {
    max-width: 100%;
}

/* ==========================================================================
   Auth pages (login / register) + OAuth buttons
   ========================================================================== */
.auth-card {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 460px;
    margin: 0 auto;
}

.auth-divider {
    text-align: center;
    border-bottom: 1px solid #ddd;
    line-height: 0.1em;
    margin: 24px 0;
}

.auth-divider span {
    background: #fff;
    padding: 0 12px;
    color: #888;
    font-size: 14px;
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.oauth-btn {
    text-align: center;
    width: 100%;
    color: #fff;
}

.oauth-google {
    background: #4285f4;
    color: #fff;
}

.oauth-github {
    background: #24292e;
    color: #fff;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
}

/* ==========================================================================
   Aside block (about.php / delivery.php)
   ========================================================================== */
.aside {
    background: #fff7e8;
    padding: 40px 0;
}

.aside ul {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}