:root {
    --bg: #070713;
    --bg-2: #101024;
    --surface: rgba(16, 16, 36, 0.9);
    --surface-strong: rgba(24, 23, 50, 0.96);
    --text: #f7fbff;
    --muted: #a6b4ce;
    --cyan: #00e5ff;
    --pink: #ff2bd6;
    --yellow: #fcee09;
    --green: #54ff9f;
    --danger: #ff4d6d;
    --border: rgba(0, 229, 255, 0.25);
    --shadow-cyan: 0 0 24px rgba(0, 229, 255, 0.25);
    --shadow-pink: 0 0 24px rgba(255, 43, 214, 0.22);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(255, 43, 214, 0.08), transparent 36%),
        radial-gradient(circle at top right, rgba(0, 229, 255, 0.18), transparent 34%),
        var(--bg);
    color: var(--text);
    font-family: "Rajdhani", Arial, sans-serif;
    font-size: 18px;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, #000, transparent 85%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

img {
    max-width: 100%;
}

.loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    gap: 18px;
    background: #050510;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-ring {
    width: 76px;
    height: 76px;
    border: 3px solid rgba(0, 229, 255, 0.2);
    border-top-color: var(--cyan);
    border-right-color: var(--pink);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 5vw;
    background: rgba(7, 7, 19, 0.86);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-cyan);
}

.logo,
.hero h1,
.section-title h2,
.admin-top h1,
.login-card h1 {
    font-family: "Orbitron", Arial, sans-serif;
}

.logo {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
}

.logo span {
    color: var(--cyan);
    text-shadow: 0 0 16px var(--cyan);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted);
    font-weight: 700;
}

.nav-links a:hover,
.back-link:hover,
.table-actions a:hover {
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan);
}

.menu-button {
    display: none;
    min-height: 42px;
    padding: 0 16px;
    color: var(--cyan);
    background: transparent;
    border: 1px solid var(--cyan);
    border-radius: 6px;
}

.hero {
    width: min(1180px, calc(100% - 32px));
    min-height: 560px;
    margin: 34px auto 28px;
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 24px;
    align-items: center;
    padding: 56px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(7, 7, 19, 0.9), rgba(7, 7, 19, 0.35)),
        url("https://images.unsplash.com/photo-1542838132-92c53300491e?auto=format&fit=crop&w=1800&q=85") center/cover;
    box-shadow: var(--shadow-cyan), inset 0 0 90px rgba(255, 43, 214, 0.18);
    overflow: hidden;
}

.hero-content {
    max-width: 700px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--yellow);
    font-size: 0.86rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.hero h1 {
    margin: 0 0 18px;
    font-size: 4.6rem;
    line-height: 1;
    letter-spacing: 0;
    text-shadow: 0 0 24px rgba(0, 229, 255, 0.5);
}

.hero p {
    color: var(--muted);
    line-height: 1.6;
}

.hero-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.btn,
.buy-form button,
.details-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 6px;
    border: 1px solid var(--cyan);
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover,
.buy-form button:hover,
.details-button:hover {
    transform: translateY(-2px);
}

.btn.primary,
.buy-form button {
    color: #041018;
    background: var(--cyan);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.45);
}

.btn.secondary,
.details-button {
    color: var(--pink);
    background: transparent;
    border-color: var(--pink);
    box-shadow: 0 0 18px rgba(255, 43, 214, 0.2);
}

.btn.full {
    width: 100%;
}

.hero-panel,
.product-card,
.search-zone,
.admin-panel,
.stat-card,
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-cyan);
}

.hero-panel {
    padding: 28px;
    justify-self: end;
    width: min(330px, 100%);
}

.panel-label {
    color: var(--muted);
    font-weight: 700;
}

.hero-panel strong {
    display: block;
    margin: 12px 0;
    color: var(--pink);
    font-family: "Orbitron", Arial, sans-serif;
    font-size: 4rem;
    text-shadow: 0 0 20px var(--pink);
}

.search-zone,
.section,
.bakery-section,
.category-strip,
.footer {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.search-zone {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 20px;
    align-items: end;
    padding: 22px;
}

.search-zone h2,
.section-title h2,
.bakery-copy h2 {
    margin: 0;
    font-size: 2.2rem;
    letter-spacing: 0;
}

.search-controls {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 12px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    color: var(--text);
    background: rgba(4, 8, 20, 0.8);
    border: 1px solid rgba(0, 229, 255, 0.28);
    border-radius: 6px;
    outline: none;
}

textarea {
    padding-top: 12px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.14);
}

.category-strip {
    display: flex;
    gap: 10px;
    padding: 22px 0 8px;
    overflow-x: auto;
}

.category-chip {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 14px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    cursor: pointer;
    transition: 0.2s ease;
}

.category-chip span {
    margin-left: 6px;
    color: var(--yellow);
}

.category-chip.active,
.category-chip:hover {
    color: var(--bg);
    background: var(--yellow);
    box-shadow: 0 0 18px rgba(252, 238, 9, 0.35);
}

.section {
    padding: 52px 0 10px;
}

.section-title {
    margin-bottom: 18px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 18px;
}

.product-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
    transform: translateY(-6px);
    border-color: var(--pink);
    box-shadow: var(--shadow-pink);
}

.product-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: block;
    object-fit: cover;
    background: var(--bg-2);
    filter: saturate(1.12) contrast(1.04);
}

.promo-badge,
.stock-badge {
    position: absolute;
    top: 12px;
    z-index: 2;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
}

.promo-badge {
    left: 12px;
    color: #12030f;
    background: var(--pink);
    box-shadow: 0 0 18px rgba(255, 43, 214, 0.6);
}

.stock-badge {
    right: 12px;
    color: #120b00;
    background: var(--yellow);
}

.product-info {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.product-category {
    width: fit-content;
    color: var(--cyan);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.product-info h3 {
    min-height: 52px;
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.2;
}

.product-info p {
    min-height: 72px;
    margin: 0;
    color: var(--muted);
    line-height: 1.35;
}

.price-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
}

.price-row strong {
    display: block;
    color: var(--green);
    font-size: 1.55rem;
    text-shadow: 0 0 12px rgba(84, 255, 159, 0.28);
}

.price-row small {
    color: var(--muted);
    text-decoration: line-through;
}

.price-row span {
    color: var(--yellow);
    font-weight: 800;
}

.buy-form {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 10px;
}

.buy-form button:disabled,
.buy-form input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.details-button {
    width: 100%;
}

.promo-section {
    padding: 44px 18px;
    border-top: 1px solid rgba(255, 43, 214, 0.32);
    border-bottom: 1px solid rgba(255, 43, 214, 0.32);
}

.bakery-section {
    display: grid;
    grid-template-columns: 0.72fr 1.28fr;
    gap: 24px;
    align-items: start;
    margin-top: 52px;
    padding: 28px;
    border: 1px solid rgba(252, 238, 9, 0.35);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(252, 238, 9, 0.11), rgba(255, 43, 214, 0.06)),
        rgba(16, 16, 36, 0.74);
    box-shadow: 0 0 24px rgba(252, 238, 9, 0.12);
}

.bakery-copy {
    position: sticky;
    top: 100px;
}

.bakery-copy p:last-child {
    color: var(--muted);
    line-height: 1.55;
}

.empty-state {
    display: none;
    margin: 24px 0;
    padding: 18px;
    color: var(--yellow);
    border: 1px solid rgba(252, 238, 9, 0.4);
    border-radius: 8px;
    background: rgba(252, 238, 9, 0.07);
}

.toast,
.form-message {
    width: min(1180px, calc(100% - 32px));
    margin: 18px auto;
    padding: 14px 16px;
    border-radius: 8px;
    font-weight: 800;
}

.toast.sucesso,
.form-message.sucesso {
    color: var(--green);
    border: 1px solid rgba(84, 255, 159, 0.42);
    background: rgba(84, 255, 159, 0.08);
}

.toast.erro,
.form-message.erro {
    color: var(--danger);
    border: 1px solid rgba(255, 77, 109, 0.42);
    background: rgba(255, 77, 109, 0.08);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    place-items: center;
    padding: 18px;
    background: rgba(2, 4, 12, 0.78);
    backdrop-filter: blur(12px);
}

.modal.open {
    display: grid;
}

.modal-card {
    position: relative;
    width: min(860px, 100%);
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    overflow: hidden;
    border: 1px solid var(--cyan);
    border-radius: 8px;
    background: var(--surface-strong);
    box-shadow: var(--shadow-cyan), var(--shadow-pink);
}

.modal-card img {
    width: 100%;
    height: 100%;
    min-height: 360px;
    object-fit: cover;
}

.modal-content {
    padding: 28px;
}

.modal-content h2 {
    margin: 8px 0 12px;
    font-family: "Orbitron", Arial, sans-serif;
    font-size: 2.1rem;
}

.modal-content p {
    color: var(--muted);
    line-height: 1.55;
}

.modal-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.modal-meta strong {
    color: var(--green);
    font-size: 1.6rem;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    color: var(--text);
    background: rgba(255, 43, 214, 0.25);
    border: 1px solid var(--pink);
    border-radius: 6px;
    cursor: pointer;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-top: 56px;
    padding: 28px 0 40px;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

.footer strong {
    color: var(--cyan);
}

.admin-body {
    display: grid;
    grid-template-columns: 260px 1fr;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    padding: 24px;
    background: rgba(7, 7, 19, 0.94);
    border-right: 1px solid var(--border);
}

.admin-user {
    margin: 18px 0;
    color: var(--muted);
}

.admin-sidebar nav {
    display: grid;
    gap: 10px;
}

.admin-sidebar nav a {
    padding: 12px;
    color: var(--muted);
    border: 1px solid transparent;
    border-radius: 6px;
}

.admin-sidebar nav a:hover {
    color: var(--cyan);
    border-color: var(--cyan);
    background: rgba(0, 229, 255, 0.08);
}

.admin-main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 60px;
}

.admin-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.admin-top h1 {
    margin: 0;
    font-size: 2.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    padding: 18px;
}

.stat-card span {
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    color: var(--cyan);
    font-family: "Orbitron", Arial, sans-serif;
    font-size: 1.75rem;
}

.stat-card.danger strong,
.danger-text {
    color: var(--danger);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.admin-panel {
    padding: 20px;
}

.admin-panel h2 {
    margin: 0 0 16px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--cyan);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.table-actions {
    display: flex;
    gap: 12px;
    font-weight: 800;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid.single-column {
    grid-template-columns: 1fr;
}

.form-grid label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 800;
}

.full-field {
    grid-column: 1 / -1;
}

.switches {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.switches label {
    display: inline-flex;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
}

.switches input {
    width: auto;
    min-height: auto;
}

.login-body {
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
}

.login-shell {
    width: min(460px, calc(100% - 32px));
}

.login-card {
    padding: 30px;
}

.login-card h1 {
    margin: 0 0 10px;
    font-size: 2.6rem;
}

.login-hint,
.back-link {
    color: var(--muted);
}

.login-card label {
    display: grid;
    gap: 8px;
    margin: 16px 0;
    color: var(--muted);
    font-weight: 800;
}

.back-link {
    display: block;
    margin-top: 16px;
    text-align: center;
}

@media (max-width: 980px) {
    .hero,
    .search-zone,
    .bakery-section,
    .modal-card,
    .admin-body,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding: 36px;
    }

    .hero h1 {
        font-size: 3.2rem;
    }

    .hero-panel {
        justify-self: stretch;
    }

    .bakery-copy {
        position: static;
    }

    .admin-sidebar {
        position: relative;
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .admin-sidebar nav {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }
}

@media (max-width: 720px) {
    body {
        font-size: 16px;
    }

    .navbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .menu-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-links.open {
        display: flex;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .search-controls,
    .form-grid,
    .buy-form {
        grid-template-columns: 1fr;
    }

    .admin-top,
    .footer {
        align-items: stretch;
        flex-direction: column;
    }

    .modal-card img {
        min-height: 240px;
    }
}
