:root {
    --am-red: #c8102e;
    --am-red-dark: #9b0c24;
    --am-red-light: #fff1f3;
    --am-gray: #6c757d;
    --am-dark: #1a1a1a;
    --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 30px rgba(200, 16, 46, 0.08);
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--am-dark);
    background: #fafafa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-main {
    flex: 1;
}

/* Navbar */
.navbar {
    box-shadow: var(--shadow-sm);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--am-red);
    color: #fff;
    font-weight: 700;
    border-radius: 10px;
    font-size: 0.9rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-text small {
    font-size: 0.68rem;
    color: var(--am-gray);
    font-weight: 500;
}

.nav-link {
    font-weight: 500;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--am-red);
    color: #fff;
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.btn-danger {
    background: var(--am-red);
    border-color: var(--am-red);
}

.btn-danger:hover,
.btn-danger:focus {
    background: var(--am-red-dark);
    border-color: var(--am-red-dark);
}

.btn-outline-danger {
    color: var(--am-red);
    border-color: var(--am-red);
}

.btn-outline-danger:hover {
    background: var(--am-red);
    border-color: var(--am-red);
}

.text-danger {
    color: var(--am-red) !important;
}

/* Hero */
.hero-section {
    background: linear-gradient(135deg, var(--am-red) 0%, #9a0c24 55%, #7a0a1d 100%);
    padding: 3.5rem 0 3rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.12) 0%, transparent 45%);
    pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    margin-bottom: 1rem;
    backdrop-filter: blur(4px);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    line-height: 1.1;
    color: #fff;
}

.hero-lead {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 520px;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.hero-cta .hero-btn-primary {
    color: var(--am-red);
    font-weight: 700;
}

.hero-cta .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
}

.hero-cta .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.hero-location {
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    max-width: 480px;
}

.hero-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    border: none;
}

.hero-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--am-text, #111);
}

.hero-steps {
    display: grid;
    gap: 0.85rem;
}

.hero-step {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.hero-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--am-red-light);
    color: var(--am-red);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hero-step strong {
    display: block;
    font-size: 0.92rem;
    color: #111;
    line-height: 1.2;
}

.hero-step small {
    display: block;
    color: var(--am-gray);
    font-size: 0.8rem;
    margin-top: 0.1rem;
}

/* Sections */
.section-title {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.filter-bar {
    border-radius: var(--radius) !important;
}

/* Categories */
.category-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: var(--am-red);
}

.category-img {
    height: 90px;
    overflow: hidden;
}

.product-img {
    height: 160px;
    position: relative;
    overflow: hidden;
}

.catalog-tile-media {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #fff5f6 0%, #f3f4f6 100%);
    overflow: hidden;
}

.catalog-tile-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.catalog-tile-img.is-hidden {
    display: none;
}

.catalog-tile-initials {
    font-weight: 700;
    color: var(--am-red);
    letter-spacing: 0.06em;
    line-height: 1;
    user-select: none;
    z-index: 0;
}

.catalog-tile-media:not(.show-initials):has(.catalog-tile-img:not(.is-hidden)) .catalog-tile-initials {
    visibility: hidden;
}

.category-img .catalog-tile-initials {
    font-size: 1.2rem;
}

.product-img .catalog-tile-initials {
    font-size: 1.6rem;
}

.cart-thumb .catalog-tile-initials {
    font-size: 0.8rem;
}

.category-card span {
    display: block;
    padding: 0.65rem 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
}

/* Products */
.product-card {
    border-radius: var(--radius) !important;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md) !important;
}

.stock-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: var(--am-red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.stock-badge.stock-out {
    background: #6b7280;
}

.shop-pagination .page-link {
    color: var(--am-red);
    border-color: #e8eaed;
}

.shop-pagination .page-item.active .page-link {
    background: var(--am-red);
    border-color: var(--am-red);
}

.product-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--am-red);
    font-weight: 600;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0.25rem 0;
    line-height: 1.3;
}

.product-desc {
    font-size: 0.78rem;
    color: var(--am-gray);
    margin-bottom: 0.75rem;
}

.product-price {
    color: var(--am-dark);
    font-size: 1rem;
}

/* Cart */
.cart-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.qty-input {
    width: 52px !important;
}

.summary-card {
    top: 90px;
    border-radius: var(--radius) !important;
}

/* Auth */
.auth-card {
    border-radius: var(--radius) !important;
}

/* Orders */
.im-here-panel {
    background: linear-gradient(135deg, var(--am-red-light), #fff);
    border: 2px solid rgba(200, 16, 46, 0.15);
}

.im-here-btn {
    animation: pulse-soft 2s infinite;
    font-weight: 700;
    letter-spacing: 0.04em;
}

@keyframes pulse-soft {
    0%, 100% { box-shadow: 0 0 0 0 rgba(200, 16, 46, 0.35); }
    50% { box-shadow: 0 0 0 12px rgba(200, 16, 46, 0); }
}

.success-icon i {
    font-size: 4rem;
}

.order-detail-card {
    border-radius: var(--radius) !important;
}

/* Admin layout */
.admin-layout {
    background: linear-gradient(180deg, #f8f9fb 0%, #f3f4f6 100%);
    min-height: calc(100vh - 72px);
}

.admin-topbar {
    background: #fff;
    border-bottom: 1px solid #ececec;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 72px;
    z-index: 1020;
}

.admin-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    flex-wrap: wrap;
}

.admin-topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-topbar-brand strong {
    display: block;
    line-height: 1.2;
    font-size: 0.95rem;
}

.admin-topbar-brand small {
    color: var(--am-gray);
    font-size: 0.72rem;
}

.admin-topbar-nav {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.admin-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    color: var(--am-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.admin-nav-link:hover {
    background: var(--am-red-light);
    color: var(--am-red);
}

.admin-nav-link.active {
    background: var(--am-red);
    color: #fff;
}

.admin-content {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.admin-eyebrow {
    color: var(--am-red);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-alert {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

/* Integration status cards */
.integration-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #fff;
    border-radius: var(--radius);
    padding: 1.15rem;
    border: 1px solid #eee;
    box-shadow: var(--shadow-sm);
    height: 100%;
    transition: transform 0.15s, box-shadow 0.15s;
}

.integration-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.integration-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.integration-card.is-connected .integration-icon {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.integration-card.is-pending .integration-icon {
    background: var(--am-red-light);
    color: var(--am-red);
}

.integration-label {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.integration-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.integration-card.is-connected .integration-status {
    color: #198754;
}

.integration-card.is-pending .integration-status {
    color: var(--am-gray);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Settings tabs & panels */
.admin-settings-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    padding: 0.55rem 1.1rem;
    color: var(--am-dark);
    font-weight: 500;
    border: 1px solid transparent;
    background: #fff;
    box-shadow: var(--shadow-sm);
    margin-right: 0.35rem;
    margin-bottom: 0.35rem;
}

.admin-settings-tabs .nav-link:hover {
    color: var(--am-red);
    border-color: rgba(200, 16, 46, 0.15);
}

.admin-settings-tabs .nav-link.active {
    background: var(--am-red);
    color: #fff;
    border-color: var(--am-red);
}

.settings-panel-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid #eee;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.settings-panel-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.35rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #fff 0%, var(--am-red-light) 120%);
}

.settings-panel-header.compact {
    padding: 1rem 1.5rem;
}

.settings-panel-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.settings-panel-header p {
    margin: 0;
    color: var(--am-gray);
    font-size: 0.88rem;
}

.settings-panel-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--am-red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.settings-panel-icon.small {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
}

.settings-panel-body {
    padding: 1.5rem;
}

.settings-hint-box {
    background: #f8f9fa;
    border: 1px solid #ececec;
    border-left: 4px solid var(--am-red);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
    color: #444;
}

.settings-hint-box code {
    word-break: break-all;
    color: var(--am-red-dark);
}

.settings-save-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding: 1.15rem 1.25rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    position: sticky;
    bottom: 1rem;
    z-index: 10;
}

.admin-settings-page .admin-save-btn {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .admin-topbar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-topbar-nav {
        justify-content: center;
    }

    .admin-store-link {
        width: 100%;
    }

    .admin-page-header {
        flex-direction: column;
    }

    .admin-save-btn {
        width: 100%;
    }

    .settings-save-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-save-bar .btn {
        width: 100%;
    }
}

/* Admin dashboard stats (existing) */
.admin-dashboard .stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f0f0f0;
}

.stat-label {
    display: block;
    font-size: 0.78rem;
    color: var(--am-gray);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card.stat-alert .stat-value {
    color: var(--am-red);
}

.arrival-item {
    border-left: 4px solid var(--am-red) !important;
}

/* Auth */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1.25rem 0;
    color: var(--am-gray);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e9ecef;
}

/* Floating AJAX cart */
.floating-cart-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    border: none;
    border-radius: 50%;
    background: var(--am-red);
    color: #fff;
    font-size: 1.35rem;
    box-shadow: 0 8px 24px rgba(200, 16, 46, 0.45);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-cart-fab:hover {
    transform: scale(1.06);
    box-shadow: 0 10px 28px rgba(200, 16, 46, 0.5);
}

.floating-cart-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.floating-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    z-index: 1055;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.floating-cart-overlay:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
}

.floating-cart-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 25vw;
    min-width: 300px;
    max-width: 400px;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.15);
    transform: translateX(-105%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-cart-panel.is-open {
    transform: translateX(0);
}

.floating-cart-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.floating-cart-panel-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.floating-cart-close {
    border: none;
    background: #f3f4f6;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #374151;
}

.floating-cart-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.floating-cart-panel-footer {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid #eee;
    background: #fafafa;
    flex-shrink: 0;
}

.fc-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    align-items: flex-start;
}

.fc-item-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(145deg, #fff5f6, #f3f4f6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fc-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fc-item-initials {
    font-weight: 700;
    color: var(--am-red);
    font-size: 0.85rem;
}

.fc-item-info {
    flex: 1;
    min-width: 0;
}

.fc-item-name {
    display: block;
    font-size: 0.88rem;
    line-height: 1.3;
    margin-bottom: 0.15rem;
}

.fc-item-price {
    font-size: 0.78rem;
    color: var(--am-gray);
}

.fc-item-qty {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.4rem;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 2px;
}

.fc-qty-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: #fff;
    border-radius: 6px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    color: #374151;
}

.fc-qty-val {
    min-width: 20px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.fc-item-end {
    text-align: right;
    flex-shrink: 0;
}

.fc-item-line {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
}

.fc-remove-btn {
    border: none;
    background: none;
    color: #9ca3af;
    padding: 0;
    cursor: pointer;
    font-size: 0.95rem;
}

.fc-remove-btn:hover {
    color: var(--am-red);
}

body.floating-cart-open {
    overflow: hidden;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #dadce0;
    color: #3c4043;
    font-weight: 500;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #dadce0;
    color: #202124;
}

.otp-input {
    letter-spacing: 0.5em;
    font-weight: 700;
    font-size: 1.5rem;
}

.admin-subnav .btn {
    border-radius: 999px;
}

/* Legacy - kept for compatibility */
.settings-card {
    border-radius: var(--radius) !important;
}

.settings-card .card-header {
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
}

/* Footer */
.site-footer {
    background: #fff;
    border-top: 1px solid #eee;
}

.site-footer a {
    color: var(--am-gray);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--am-red);
}

.order-map-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.order-map-wrap iframe {
    display: block;
    width: 100%;
    min-height: 280px;
    border: 0;
}

/* Responsive */
@media (max-width: 576px) {
    .hero-section {
        padding: 2.25rem 0 1.75rem;
    }

    .hero-card {
        padding: 1.25rem;
    }

    .product-img {
        height: 130px;
    }

    .im-here-btn {
        width: 100%;
    }

    .floating-cart-panel {
        width: 88vw;
        min-width: 0;
        max-width: none;
    }

    .floating-cart-fab {
        bottom: 16px;
        right: 16px;
    }
}

@media (min-width: 992px) {
    .sticky-lg-top {
        position: sticky;
        top: 90px;
        z-index: 10;
    }
}
