 :root {
    --brand-red: #ff0a03;
    --brand-yellow: #ffb100;
    --brand-black: #000000;
    --brand-cream: #fef0ef;
    --brand-cream-strong: #fde5e1;
    --brand-border: #f4c9c3;
    --brand-text: #161212;
    --brand-muted: #776665;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--brand-cream);
    color: var(--brand-text);
}

img,
svg,
canvas,
video,
iframe {
    max-width: 100%;
}

a {
    text-decoration: none;
}

.bg-pattern {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(255, 10, 3, 0.09), transparent 28%),
        radial-gradient(circle at bottom right, rgba(255, 177, 0, 0.16), transparent 24%),
        linear-gradient(180deg, #fffaf9 0%, var(--brand-cream) 100%);
    z-index: -2;
}

.public-body .container {
    position: relative;
    z-index: 1;
}

.public-body,
.admin-body,
.public-header,
.admin-layout,
.admin-main,
main,
.container,
.container-fluid,
.row {
    max-width: 100%;
}

.public-header,
.card,
.table,
.admin-sidebar,
.admin-topbar,
.modal-content,
.list-group-item,
.offcanvas,
.form-control,
.form-select {
    background-color: rgba(255, 255, 255, 0.94) !important;
    border-color: rgba(244, 201, 195, 0.95) !important;
    color: var(--brand-text) !important;
    backdrop-filter: blur(12px);
}

.navbar-brand,
.nav-link,
.table,
.form-label,
.form-check-label,
.breadcrumb-item,
.page-link,
.dropdown-item {
    color: var(--brand-text);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-red), #ff483f);
    border-color: var(--brand-red);
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #e10903, var(--brand-red));
    border-color: #e10903;
    color: #fff !important;
}

.btn-outline-light {
    border-color: var(--brand-border);
    color: #a01d1a !important;
    background: #fff;
}

.btn-outline-light:hover,
.btn-outline-light:focus {
    background: #fff5f4;
    border-color: #f2a19c;
    color: #7d1310 !important;
}

.btn-light {
    background: #ffffff;
    border-color: var(--brand-border);
    color: #7d1310 !important;
}

.btn-light.active,
.btn-light:hover,
.btn-light:focus {
    background: #fff5f4;
    border-color: #f2a19c;
    color: #7d1310 !important;
}

.text-secondary,
.text-muted {
    color: var(--brand-muted) !important;
}

.brand-badge {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff;
    border: 2px solid var(--brand-border);
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(255, 10, 3, 0.1);
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 999px;
}

.hero-card,
.catalog-card,
.summary-card,
.stat-card,
.filter-card {
    border-radius: 24px;
    border: 1px solid rgba(244, 201, 195, 0.95);
    box-shadow: 0 18px 45px rgba(255, 10, 3, 0.08);
}

.hero-card {
    padding: 2rem;
    overflow: hidden;
}

.hero-card::after {
    content: '';
    position: absolute;
    inset: auto -80px -80px auto;
    width: 200px;
    height: 200px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 177, 0, 0.18), transparent 65%);
    filter: blur(6px);
}

.hero-badge {
    display: inline-flex;
    padding: .35rem .75rem;
    border-radius: 999px;
    background: rgba(255, 177, 0, .16);
    color: #8d5200;
    font-size: .85rem;
    font-weight: 600;
}

.hero-full {
    width: auto;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.hero-banner {
    position: relative;
    overflow: hidden;
    padding: 5rem 1.25rem;
    background:
        radial-gradient(circle at top left, rgba(255, 177, 0, 0.22), transparent 28%),
        radial-gradient(circle at right center, rgba(255, 10, 3, 0.08), transparent 24%),
        linear-gradient(135deg, #fffaf8 0%, #fff4f3 45%, var(--brand-cream) 100%);
    border-top: 1px solid rgba(244, 201, 195, 0.95);
    border-bottom: 1px solid rgba(244, 201, 195, 0.95);
}

.hero-banner::before,
.hero-banner::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    filter: blur(8px);
}

.hero-banner::before {
    width: 260px;
    height: 260px;
    right: 8%;
    top: -70px;
    background: rgba(255, 10, 3, 0.08);
}

.hero-banner::after {
    width: 220px;
    height: 220px;
    left: 10%;
    bottom: -90px;
    background: rgba(255, 177, 0, 0.2);
}

.hero-banner__content {
    position: relative;
    z-index: 1;
    width: min(100%, 1180px);
    margin: 0 auto;
}

.hero-banner__title {
    max-width: 760px;
    margin-bottom: 1rem;
    font-size: clamp(2.1rem, 4vw, 4.4rem);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #180f0f;
}

.hero-banner__text {
    max-width: 700px;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    color: var(--brand-muted);
}

.hero-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.hero-search {
    flex: 1 1 720px;
    max-width: 760px;
}

.search-shell {
    display: flex;
    gap: .75rem;
    align-items: center;
    padding: .9rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, .95);
    border: 1px solid rgba(244, 201, 195, .95);
    box-shadow: 0 10px 26px rgba(255, 10, 3, .06);
}

.search-shell input {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    padding: .75rem 1rem;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--brand-border);
    color: #9d1815;
    transition: .2s ease;
}

.category-pill:hover,
.category-pill.active {
    background: linear-gradient(135deg, var(--brand-red), #ff483f);
    border-color: var(--brand-red);
    box-shadow: 0 10px 22px rgba(255, 10, 3, .16);
    color: #fff;
    transform: translateY(-1px);
}

.category-pill.active,
.category-pill:hover {
    color: #fff;
}

.category-pill:hover {
    background: linear-gradient(135deg, var(--brand-red), #ff483f);
    border-color: var(--brand-red);
}

.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid #f5d8d4;
    background: rgba(255, 255, 255, .96);
    transition: transform .2s ease, box-shadow .2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(255, 10, 3, .08);
}

.product-card .product-image {
    aspect-ratio: 4 / 3;
    width: 100%;
    flex-shrink: 0;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(254, 240, 239, 0.98), rgba(255, 249, 248, 0.96));
}

.product-card-link-image {
    display: block;
}

.product-card .badge-soft {
    display: inline-flex;
    padding: .35rem .65rem;
    border-radius: 999px;
    background: rgba(255, 177, 0, .14);
    color: #9b5a00;
}

.product-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.product-card-title {
    line-height: 1.2;
    min-height: 2.4em;
}

.product-card-link-text {
    color: inherit;
    text-decoration: none;
}

.product-card-link-text:hover {
    color: #9d1815;
}

.product-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3em;
}

.product-card-footer {
    margin-top: auto;
    display: grid;
    gap: .9rem;
}

.product-card-price {
    min-width: 0;
    display: block;
}

.product-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.product-card-actions > .btn {
    flex: 0 0 auto;
}

.product-card-view-btn {
    align-self: center;
}

.product-buy-form {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex: 1 1 100%;
    min-width: 0;
}

.product-qty-input {
    width: 64px;
    min-width: 64px;
    text-align: center;
}

.price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--brand-red);
}

.old-price {
    text-decoration: line-through;
    color: #7b93ad;
}

.admin-body {
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fbff 0%, #edf6ff 100%);
}

.admin-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    padding: 1.5rem;
    border-right: 1px solid rgba(191, 219, 254, 0.95);
}

.sidebar-brand {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.admin-sidebar .nav-link {
    display: flex;
    gap: .75rem;
    align-items: center;
    padding: .85rem 1rem;
    border-radius: 16px;
}

.admin-sidebar .nav-link.active,
.admin-sidebar .nav-link:hover {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
}

.admin-main {
    padding: 1.5rem;
    position: relative;
}

.modal {
    z-index: 1060;
}

.modal-backdrop {
    z-index: 1055;
}

#product-modal .modal-dialog {
    margin: 1rem auto;
}

#product-modal .modal-content {
    max-height: calc(100vh - 2rem);
}

#product-modal .modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
}

#product-modal .modal-footer {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(244, 201, 195, 0.95);
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 24px;
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 1.25rem;
}

.stat-card .icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(219, 234, 254, .95);
    color: #2563eb;
}

.notification-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ef4444;
    display: none;
}

.notification-dot.is-visible {
    display: block;
}

.table {
    border-radius: 20px;
    overflow: hidden;
}

.table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table > :not(caption) > * > * {
    color: #16324f;
    background: transparent;
    border-bottom-color: rgba(191, 219, 254, 0.9);
}

.table-thumb {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid #dbeafe;
    background: #eff6ff;
}

.bulk-actions-bar {
    padding: 1rem 1.1rem;
    border: 1px solid #dbeafe;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.95));
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(255, 10, 3, .38) !important;
    box-shadow: 0 0 0 .25rem rgba(244, 201, 195, .58) !important;
}

.page-link {
    background: #ffffff;
    border-color: var(--brand-border);
    color: #9d1815;
    min-width: 42px;
    text-align: center;
    white-space: nowrap;
}

.pagination-shell {
    overflow-x: auto;
    padding-bottom: .25rem;
}

.pagination {
    flex-wrap: wrap;
    gap: .35rem;
}

.pagination-shell .pagination {
    width: max-content;
    min-width: 100%;
}

.page-link-nav {
    padding-inline: .9rem;
}

.page-link-dots {
    pointer-events: none;
}

.page-item.active .page-link {
    background: var(--brand-red);
    border-color: var(--brand-red);
    color: #fff;
}

.thumb-preview {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid #dbeafe;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 1rem;
    padding: 1rem;
    border-radius: 20px;
    border: 1px solid #dbeafe;
    background: rgba(255, 255, 255, .98);
}

#publicCartCanvas {
    width: min(100vw, 420px);
    max-width: 100%;
}

.mini-cart-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: .9rem;
    align-items: center;
    padding: .85rem;
    border-radius: 18px;
    border: 1px solid rgba(244, 201, 195, 0.95);
    background: rgba(255, 255, 255, 0.96);
    overflow: hidden;
}

.mini-cart-item > div {
    min-width: 0;
}

.mini-cart-thumb {
    display: block;
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    height: 72px;
    max-height: 72px;
    flex-shrink: 0;
    border-radius: 16px;
    object-fit: cover;
    object-position: center;
    background: #fff5f4;
    border: 1px solid rgba(244, 201, 195, 0.95);
}

.mini-cart-link {
    color: var(--brand-text);
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-cart-link:hover {
    color: #9d1815;
}

.mini-cart-summary {
    margin-top: auto;
    border-radius: 22px;
}

.summary-list li {
    display: flex;
    justify-content: space-between;
    padding: .6rem 0;
    border-bottom: 1px solid rgba(219, 234, 254, .95);
}

.summary-list li:last-child {
    border-bottom: 0;
}

.timeline-steps {
    display: grid;
    gap: 1rem;
}

.timeline-step {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: .85rem;
    align-items: start;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    margin-top: .35rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-red), var(--brand-yellow));
    box-shadow: 0 0 0 5px rgba(244, 201, 195, 0.7);
}

.notification-order-card {
    border-radius: 20px;
}

.notification-order-meta {
    display: grid;
    gap: .35rem;
}

.notification-order-items {
    display: grid;
    gap: .45rem;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.login-card {
    width: min(100%, 420px);
    padding: 2rem;
    border-radius: 28px;
}

.progress {
    background: #e0efff;
}

@media (max-width: 991.98px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        border-right: 0;
        border-bottom: 1px solid rgba(191, 219, 254, 0.95);
    }

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

@media (max-width: 767.98px) {
    [data-search-wrapper] {
        margin-bottom: .75rem;
    }

    .hero-card,
    .admin-main {
        padding: 1rem;
    }

    .hero-banner {
        padding: 3rem 1rem;
    }

    .hero-banner__text {
        font-size: .98rem;
    }

    .hero-banner__actions {
        align-items: stretch;
    }

    .hero-search {
        flex-basis: 100%;
    }

    .cart-item {
        grid-template-columns: 1fr;
    }

    .product-card {
        overflow: visible;
    }

    .product-card-link-image {
        overflow: hidden;
        border-radius: 24px 24px 0 0;
    }

    .product-card .product-image {
        aspect-ratio: auto;
        height: 108px;
    }

    .product-card-body {
        padding: 1rem !important;
    }

    .product-card-body > .d-flex {
        margin-bottom: .75rem !important;
    }

    .product-card .badge-soft {
        padding: .3rem .55rem;
        font-size: .78rem;
    }

    .product-card-title {
        min-height: 0;
        font-size: 1rem;
        margin-bottom: .5rem !important;
    }

    .product-card-footer {
        gap: .75rem;
    }

    .product-card-actions {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: center;
        width: 100%;
    }

    .product-card-actions > * {
        width: 100%;
    }

    .product-buy-form {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        justify-items: center;
        gap: .45rem;
        flex: 0 0 auto;
    }

    .product-qty-input {
        width: 58px;
        min-width: 58px;
        padding-inline: .35rem;
    }

    .product-card-actions > .btn,
    .product-buy-form .btn {
        min-height: 38px;
        width: 100%;
        max-width: none;
        padding-inline: .75rem;
        justify-content: center;
    }

    .product-card-view-btn {
        order: 1;
    }

    .product-buy-form {
        order: 2;
    }


    .bulk-actions-bar {
        padding: .85rem;
    }

    .pagination {
        gap: .25rem;
    }

    .page-link {
        min-width: 38px;
        padding: .45rem .65rem;
        font-size: .9rem;
    }

    .page-link-nav {
        padding-inline: .75rem;
    }
}
