@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&display=swap');

/* ==========================================================================
   FRONTEND - SUSHI GRID LAYOUT (APP-LIKE)
   ========================================================================== */
:root {
    --dmnhd-primary: #CA0D15;
    --dmnhd-primary-hover: rgb(151, 36, 48);
    --dmnhd-bg: #f8fafc;
    --dmnhd-card-bg: #ffffff;
    --dmnhd-text-main: #111827;
    --dmnhd-text-muted: #6b7280;
    --dmnhd-border: #e5e7eb;
    --dmnhd-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --dmnhd-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --dmnhd-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --dmnhd-radius: 12px;
}

.dmnhd-menu-page.dmnhd-sushi-layout,
.dmnhd-modal,
.dmnhd-cart-drawer,
.dmnhd-checkout-page-wrapper,
.dmnhd-menu-page input,
.dmnhd-menu-page textarea,
.dmnhd-modal input,
.dmnhd-modal textarea,
.dmnhd-menu-page.dmnhd-sushi-layout h1,
.dmnhd-menu-page.dmnhd-sushi-layout h2,
.dmnhd-menu-page.dmnhd-sushi-layout h3,
.dmnhd-menu-page.dmnhd-sushi-layout h4,
.dmnhd-menu-page.dmnhd-sushi-layout h5,
.dmnhd-menu-page.dmnhd-sushi-layout h6,
.dmnhd-modal h1,
.dmnhd-modal h2,
.dmnhd-modal h3,
.dmnhd-modal h4,
.dmnhd-modal h5,
.dmnhd-modal h6,
.dmnhd-cart-drawer h1,
.dmnhd-cart-drawer h2,
.dmnhd-cart-drawer h3,
.dmnhd-cart-drawer h4,
.dmnhd-cart-drawer h5,
.dmnhd-cart-drawer h6,
.dmnhd-checkout-page-wrapper h1,
.dmnhd-checkout-page-wrapper h2,
.dmnhd-checkout-page-wrapper h3,
.dmnhd-checkout-page-wrapper h4,
.dmnhd-checkout-page-wrapper h5,
.dmnhd-checkout-page-wrapper h6 {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif !important;
}

/* Hide increment/decrement spinner on number inputs */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

.dmnhd-menu-page.dmnhd-sushi-layout {
    color: var(--dmnhd-text-main);
    background: var(--dmnhd-bg);
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

.dmnhd-menu-page.dmnhd-sushi-layout * {
    box-sizing: border-box;
}

/* --- STICKY WRAPPER --- */
.dmnhd-sticky-wrapper {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--dmnhd-bg);
    margin: -20px -20px 20px -20px;
    padding: 20px 20px 0 20px;
}

/* --- HEADER --- */
.dmnhd-top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    background: var(--dmnhd-card-bg);
    padding: 15px;
    border-radius: var(--dmnhd-radius);
    box-shadow: var(--dmnhd-shadow-sm);
}

.dmnhd-search-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 0 15px;
    max-width: 400px;
}

.dmnhd-search-wrap i {
    color: #94a3b8;
}

.dmnhd-search-wrap input {
    margin: 0;
    background: transparent;
    padding: 10px;
    width: 100%;
    outline: none;
    font-size: 14px;
    box-shadow: none !important;
    border: none;
}

.dmnhd-header-actions {
    position: relative;
    display: flex;
}

.dmnhd-cart-icon-link {
    margin: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dmnhd-primary);
    font-size: 16px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

input.dmnhd-modal-qty {
    margin: 0;
    border: none;
    box-shadow: none;
    padding: 0;
}

.dmnhd-cart-icon-link:hover {
    background: #fee2e2;
}

.dmnhd-cart-badge {
    background: var(--dmnhd-primary);
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: bold;
}

/* --- CATEGORIES CAROUSEL --- */
.dmnhd-categories-carousel {
    padding: 10px 5px 20px 5px;
    margin-bottom: 0;
}

/* Swiper Nav Buttons */
.dmnhd-categories-carousel .swiper-button-next,
.dmnhd-categories-carousel .swiper-button-prev {
    color: var(--dmnhd-primary);
    background: rgba(255, 255, 255, 0.9);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    box-shadow: var(--dmnhd-shadow-md);
    top: 35%;
    margin-top: -8px;
}

.dmnhd-categories-carousel .swiper-button-next::after,
.dmnhd-categories-carousel .swiper-button-prev::after {
    font-size: 14px;
    font-weight: bold;
}

.dmnhd-categories-carousel .swiper-button-prev {
    left: 5px;
}

.dmnhd-categories-carousel .swiper-button-next {
    right: 5px;
}

.dmnhd-categories-carousel .swiper-button-next.swiper-button-disabled,
.dmnhd-categories-carousel .swiper-button-prev.swiper-button-disabled {
    opacity: 0;
    pointer-events: none;
}

/* Swiper Scrollbar */
.dmnhd-categories-carousel .swiper-scrollbar {
    background: #f1f5f9;
    height: 4px;
    bottom: 5px;
    width: calc(100% - 20px);
    left: 10px;
}

.dmnhd-categories-carousel .swiper-scrollbar-drag {
    background: var(--dmnhd-primary);
}

.dmnhd-cat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: var(--dmnhd-text-main);
    gap: 8px;
    transition: all 0.2s;
    user-select: none;
}

.dmnhd-cat-pill.active .dmnhd-cat-img-wrap,
.dmnhd-cat-pill:hover .dmnhd-cat-img-wrap {
    border-color: var(--dmnhd-primary);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.dmnhd-cat-pill.active .dmnhd-cat-name {
    color: var(--dmnhd-primary);
    font-weight: 700;
}

.dmnhd-cat-img-wrap {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--dmnhd-card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    overflow: hidden;
    box-shadow: var(--dmnhd-shadow-md);
    transition: all 0.2s;
}

.dmnhd-cat-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dmnhd-cat-emoji {
    font-size: 28px;
    color: var(--dmnhd-text-main);
}

.dmnhd-cat-name {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    width: 100%;
    padding: 0 4px;
}

@media (min-width: 768px) {
    .dmnhd-cat-img-wrap {
        width: 90px;
        height: 90px;
    }

    .dmnhd-cat-emoji {
        font-size: 36px;
    }

    .dmnhd-cat-name {
        font-size: 14px;
    }
}

/* --- CONTENT --- */
.dmnhd-menu-grid-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.dmnhd-section-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--dmnhd-primary);
    margin: 0 0 20px 0;
    border-bottom: 2px solid var(--dmnhd-primary);
    display: inline-block;
    padding-bottom: 5px;
}

.dmnhd-items-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

/* --- PRODUCT CARD --- */
.dmnhd-product-card {
    background: var(--dmnhd-card-bg);
    border-radius: var(--dmnhd-radius);
    border: 1px solid #f1f1f1;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    height: 100%;
}

.dmnhd-product-image {
    height: 180px;
    background-color: #e9e9e93b;
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
}

.dmnhd-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dmnhd-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #cbd5e1;
}

.dmnhd-product-info {
    padding: 0 12px 12px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.dmnhd-product-title {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
}

.dmnhd-product-desc {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 15px 0;
    line-height: 1.4;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dmnhd-product-bottom {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: auto;
}

.dmnhd-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #dc3545;
}

.dmnhd-add-cart-btn {
    background: var(--dmnhd-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 100%;
    margin-top: 15px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
    box-shadow: none;
}

.dmnhd-add-cart-btn:hover {
    background: var(--dmnhd-primary-hover);
}

.dmnhd-add-cart-btn:active {
    transform: scale(0.95);
}

/* --- CART DRAWER --- */
.dmnhd-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.dmnhd-cart-overlay.dmnhd-show {
    opacity: 1;
    visibility: visible;
}

.dmnhd-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 450px;
    max-width: 100vw;
    background: var(--dmnhd-card-bg);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dmnhd-cart-drawer.dmnhd-show {
    transform: translateX(0);
}

.dmnhd-cart-drawer-header {
    padding: 20px;
    border-bottom: 1px solid var(--dmnhd-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dmnhd-close-cart {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--dmnhd-text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.dmnhd-cart-drawer-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.dmnhd-cart-dropdown-item {
    border-bottom: 1px solid var(--dmnhd-border);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.dmnhd-cart-dropdown-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.dmnhd-cart-drawer-summary {
    padding: 20px;
    border-top: 1px solid var(--dmnhd-border);
    background: #fff;
}

.dmnhd-cart-dropdown-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dmnhd-btn {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 15px;
}

.dmnhd-cart-checkout-btn {
    background: var(--dmnhd-primary);
    color: #fff;
}

.dmnhd-cart-checkout-btn:hover {
    background: var(--dmnhd-primary-hover);
}

/* Modals */
.dmnhd-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10001;
    /* Above drawer */
    display: flex;
    align-items: center;
    justify-content: center;
}

.dmnhd-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.dmnhd-modal-content {
    background: var(--dmnhd-card-bg);
    border-radius: var(--dmnhd-radius);
    width: 95%;
    max-width: 550px;
    position: relative;
    z-index: 10002;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--dmnhd-shadow-lg);
    animation: dmnhd-modal-slide 0.3s ease-out;
    overflow: hidden;
}

@keyframes dmnhd-modal-slide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dmnhd-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

.dmnhd-modal-close:hover {
    background: rgba(0, 0, 0, 0.6);
}

.dmnhd-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.dmnhd-qty-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    padding: 4px;
    border-radius: 8px;
    width: max-content;
}

.dmnhd-qty-btn {
    width: 32px;
    height: 32px;
    margin: 0;
    border-radius: 6px;
    border: none;
    background: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: var(--dmnhd-shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.dmnhd-qty-btn:hover {
    background: #f1f5f9;
}

.dmnhd-modal-qty {
    width: 30px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 16px;
    padding: 0;
    -moz-appearance: textfield;
}

.dmnhd-modal-add:hover {
    background: var(--dmnhd-primary-hover) !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dmnhd-menu-page.dmnhd-sushi-layout {
        padding: 10px;
    }

    .dmnhd-sticky-wrapper {
        margin: -10px -10px 20px -10px;
        padding: 10px 10px 0 10px;
    }

    .dmnhd-top-header {
        border-radius: 0;
        margin-bottom: 10px;
    }

    .dmnhd-cart-text {
        display: none;
    }

    .dmnhd-items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .dmnhd-product-image {
        height: 140px;
    }

    .dmnhd-product-title {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .dmnhd-product-desc {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 10px;
    }

    .dmnhd-product-info {
        padding: 10px;
    }

    .dmnhd-product-price {
        font-size: 15px;
    }

    .dmnhd-add-cart-btn {
        width: 100%;
        height: auto;
        margin-top: 10px;
        padding: 8px;
        font-size: 13px;
    }

    .dmnhd-modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .dmnhd-cart-drawer {
        width: 100vw;
    }
}

@media (max-width: 400px) {
    .dmnhd-items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .dmnhd-product-image {
        height: 180px;
    }
}