/* Container for the categories grid */
.menury-style-woo-categories-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 20px;
    padding: 0;
    list-style: none;
    overflow: hidden; /* Prevent any accidental scrollbars */
}

/* Individual Category Item */
.menury-style-woo-categories-grid .category-item {
    /* Calculation for 6 columns on desktop: (100% / 6) - (gap adjustment) */
    flex: 0 0 calc(16.666% - 16.66px); 
    text-decoration: none;
    color: #fff; 
    background-color: #1a1e28; 
    border-radius: 8px; 
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 20px;
    
    /* Crucial for structure */
    position: relative;
    overflow: hidden;
    min-height: 220px; /* Adjusted height for stability */
    display: block; /* Ensure the link fills the box */
}

/* Hover effect */
.menury-style-woo-categories-grid .category-item:hover {
    transform: translateY(-8px); 
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5); 
}

/* Inner wrapper for stacking elements */
.menury-style-woo-categories-grid .category-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Title Styling - Placed at the top and covers the background slightly */
.menury-style-woo-categories-grid .category-title {
    padding: 20px 15px;
    position: relative;
    z-index: 2; /* Ensure title is above the image */
    text-align: left;
}

.menury-style-woo-categories-grid .category-title h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

/* Image container for the Pop-Out Effect - THE KEY CHANGE */
.menury-style-woo-categories-grid .category-image-popout {
    /* Position image in the lower right part of the box, pushing slightly out */
    position: absolute;
    bottom: -20px; /* Adjust this value to control how much it pops out */
    right: -10px; /* Adjust this value to control right positioning */
    width: 65%; /* Smaller image size */
    height: 65%;
    border-radius: 4px; 
    overflow: hidden;
    z-index: 1; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.menury-style-woo-categories-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}

/* Image zoom on hover */
.menury-style-woo-categories-grid .category-item:hover img {
    transform: scale(1.1);
}

/* Placeholder for images (matches your current visual output) */
.menury-style-woo-categories-grid .placeholder-image {
    width: 100%;
    height: 100%;
    background-color: #333;
    /* You can use a real image or simple gray box */
    display: flex;
    align-items: center;
    justify-content: center;
}
.menury-style-woo-categories-grid .placeholder-image::after {
    content: "\e04a"; /* Elementor icon for image */
    font-family: eicon;
    font-size: 30px;
    color: #555;
}

/* --- Responsive Adjustments --- */

/* Tablet (max 1024px) - 4 Columns */
@media (max-width: 1024px) {
    .menury-style-woo-categories-grid .category-item {
        flex: 0 0 calc(25% - 15px); 
        min-height: 200px;
    }
}

/* Mobile (max 768px) - 2 Columns */
@media (max-width: 768px) {
    .menury-style-woo-categories-grid {
        gap: 15px;
    }
    .menury-style-woo-categories-grid .category-item {
        flex: 0 0 calc(50% - 7.5px); 
        min-height: 160px;
    }
}

/* ================== Menury Override & New Styles ================== */

/* Section background + header */
.menury-menu {  
    padding: 30px 0 10px;
    color: #e9eef6;
}

.menury-menu-header {
    max-width: 1200px;
    margin: 0 auto 20px;
    text-align: center;
}

.menury-title {
    font-size: 28px;
    letter-spacing: 2px;
    margin: 0 0 6px;
    font-weight: 800;
}

.menury-subtitle {
    opacity: .85;
    letter-spacing: 1.5px;
    margin-bottom: 14px;
}

.menury-search { position: relative; max-width: 520px; margin: 0 auto; padding-top: 6px; }
.menury-search::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: rgba(255,255,255,.15); }
.menury-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.menury-search-input { width: 100%; background: transparent; border: none; outline: none; border-bottom: 1px solid rgba(255,255,255,.25); padding: 10px 12px 10px 34px; color: #e9eef6; font-size: 14px; }

/* Grid overrides to match the design */
.menury-style-woo-categories-grid { justify-content: space-between; gap: 28px; padding: 12px 16px 24px; max-width: 1200px; margin: 0 auto; }
.menury-style-woo-categories-grid .category-item { flex: 0 0 calc(16.66% - 23px); color: #dfe7f1; background: none; border-radius: 0; margin-bottom: 0; }
.menury-style-woo-categories-grid .category-item:hover .category-card { transform: translateY(-6px); box-shadow: 0 16px 36px rgba(0,0,0,.45); }

/* Card */
.category-card { background: #141c28; border-radius: 16px; padding: 14px 14px 16px; position: relative; overflow: visible; min-height: 190px; box-shadow: 0 10px 24px rgba(0,0,0,.35); transition: transform .3s ease, box-shadow .3s ease; }
.category-image { height: 135px; border-radius: 14px; overflow: hidden; position: relative; box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.category-name { text-align: center; margin-top: 10px; font-weight: 700; font-size: 14px; }
.menury-style-woo-categories-grid .category-item:hover img { transform: scale(1.06); }

/* Responsive tweaks for new layout */
@media (max-width: 1024px) {
    .menury-style-woo-categories-grid .category-item { flex: 0 0 calc(25% - 21px); }
}
@media (max-width: 768px) {
    .menury-style-woo-categories-grid { gap: 16px; padding: 10px 12px 20px; }
    .menury-style-woo-categories-grid .category-item { flex: 0 0 calc(50% - 8px); }
    .category-image { height: 110px; }
}

/* ===== Products list (per-category) ===== */
.menury-products-menu { padding: 26px 0; color: #e9eef6; }
.menury-products-wrapper { max-width: 900px; margin: 0 auto; padding: 0 16px; }
.menury-category-block { margin: 16px 0 24px; }
.menury-category-title { font-size: 18px; font-weight: 800; margin: 0 0 12px; letter-spacing: .5px; }
.menury-products-list { list-style: none; margin: 0; padding: 0; }
.menury-product-item { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.menury-product-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.menury-product-title { font-weight: 700; }
.menury-product-price { opacity: .95; font-weight: 700; }
.menury-product-desc { opacity: .8; font-size: 13px; margin-top: 6px; line-height: 1.6; }

/* Card layout like screenshot */
.menury-card { background: #141c28; color: #e9eef6; border: 1px solid rgba(255,255,255,.06); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.35); padding: 16px; display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: start; }
.menury-card + .menury-card { margin-top: 12px; }
.menury-card-left { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; box-shadow: 0 6px 14px rgba(0,0,0,.28); background: #0f1622; }
.menury-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.menury-card-content { display: flex; flex-direction: column; gap: 6px; }
.menury-card-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.menury-card .menury-product-title { color: #e9eef6; font-weight: 700; }
.menury-card .menury-product-price { color: #e9eef6; font-weight: 700; }
.menury-card .menury-product-desc { color: rgba(233,238,246,.75); margin: 0; }

.menury-product-item { border: none; padding: 0; margin: 12px 0; }

@media (max-width: 560px) {
	.menury-card { grid-template-columns: 60px 1fr; gap: 12px; padding: 12px; }
	.menury-card-left { width: 60px; height: 60px; }
}

@media (max-width: 560px) {
	.menury-products-wrapper { padding: 0 12px; }
	.menury-product-row { gap: 10px; }
}

/* ===== Modal (dark theme) ===== */
html.menury-modal-open { overflow: hidden; }

.menury-modal[hidden] { display: none !important; }
.menury-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: flex-end; justify-content: center; }
.menury-modal__overlay { position: absolute; inset: 0; background: rgba(0,0,0,.66); backdrop-filter: blur(2px); }
.menury-modal__dialog { position: relative; max-width: 860px; width: calc(100% - 24px); margin: 12px; background: #0f1622; color: #e9eef6; border-radius: 16px 16px 0 0; box-shadow: 0 30px 80px rgba(0,0,0,.6); padding: 28px 24px 22px; border: 1px solid rgba(255,255,255,.06); transform: translateY(12px) scale(1); opacity: 0; transition: transform .18s ease, opacity .18s ease; }
.menury-modal__dialog.is-open { transform: translateY(0) scale(1); opacity: 1; }
.menury-modal__close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: #e9eef6; cursor: pointer; line-height: 1; font-size: 20px; }
.menury-modal__close:hover { background: rgba(255,255,255,.12); }
.menury-modal__image { width: 140px; height: 140px; border-radius: 14px; overflow: hidden; box-shadow: 0 12px 26px rgba(0,0,0,.45); margin: -72px auto 16px; background: #0b111a; }
.menury-modal__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.menury-modal__title { text-align: center; font-size: 22px; margin: 6px 0 10px; font-weight: 800; }
.menury-modal__desc { text-align: center; opacity: .85; margin: 0 auto 14px; max-width: 660px; line-height: 1.7; }
.menury-modal__price { text-align: center; font-weight: 800; font-size: 18px; margin-bottom: 6px; }

/* Click hint */
[data-menury-open-modal] { cursor: pointer; }