/* Resto M2 Frontend Styles - Version 2.0.0 */

/* Base Styles */
.resto-menu {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 30px 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.resto-menu h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
    position: relative;
    padding-bottom: 15px;
}

.resto-menu h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(45deg, #e74c3c, #f39c12);
    border-radius: 2px;
}

.resto-menu i {
    margin-right: 8px;
    color: #e74c3c;
    font-size: 1.1em;
}

/* Menu Items Grid */
.resto-menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.resto-menu-item {
    background: #fff;
    padding: 20px;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    /* box-shadow will be controlled by inline CSS from settings */
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.resto-menu-item:hover {
    transform: translateY(-5px);
    /* box-shadow will be controlled by inline CSS from settings */
    border-color: #e74c3c;
}

/* Disable hover effects when requested */
.resto-hover-off .resto-menu-item:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border-color: #e1e8ed !important;
}

.resto-menu-item.popup-item {
    cursor: pointer;
}

.resto-menu-item.popup-item:hover {
    background: #fafbfc;
}

/* Item Images */
.resto-menu-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.resto-menu-item:hover img {
    transform: scale(1.05);
}

/* Item Content */
.resto-menu-item h3 {
    font-size: 20px;
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-weight: 600;
    line-height: 1.3;
}

.resto-menu-item h3 strong {
    color: #e74c3c;
    font-weight: 700;
}

.resto-menu-item p {
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.6;
    margin: 10px 0 0 0;
}

/* Action buttons */
.resto-actions {
    margin-top: 12px;
}

.resto-actions .button {
    cursor: pointer;
}

/* Price Styling */
.resto-menu-item .price {
    font-size: 18px;
    font-weight: 700;
    color: #27ae60;
    margin-top: 15px;
    display: inline-block;
    background: #ecf0f1;
    padding: 5px 12px;
    border-radius: 20px;
}

/* All Menus Container */
.resto-all-menus {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.resto-all-menus .resto-menu {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid #ecf0f1;
}

.resto-all-menus .resto-menu:last-child {
    border-bottom: none;
}

/* Popup Styles - Override all theme styles */
.resto-global-popup {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    background: rgba(0, 0, 0, 0.8);
    display: none !important;
    z-index: 99999 !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px !important;
    margin: 0 !important;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
}

.resto-global-popup.show {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.resto-global-popup .popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.resto-global-popup .popup-container {
    position: relative !important;
    background: #fff;
    border-radius: 16px;
    max-width: 600px !important;
    width: 90%;
    max-height: 90%;
    overflow: auto;
    padding: 30px;
    box-sizing: border-box;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popupSlideIn 0.3s ease-out;
    margin: 0 !important;
    z-index: 2;
}

/* Popup Navigation Buttons - Outside container */
.resto-global-popup .popup-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 20px;
    color: #2c3e50;
}

.resto-global-popup .popup-nav i {
    color: inherit !important;
    font-size: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    font-family: 'FontAwesome' !important;
    font-style: normal !important;
    font-weight: normal !important;
    text-decoration: none !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.resto-global-popup .popup-nav:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transform: translateY(-50%) scale(1.15);
    opacity: 1;
}

.resto-global-popup .popup-nav:hover i {
    color: inherit !important;
}

/* Ensure icons are visible even if FA overridden */
.resto-global-popup .popup-nav i.fa::before {
    font-family: 'FontAwesome' !important;
    display: inline-block !important;
    font-style: normal !important;
    font-weight: normal !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Unicode fallback - show if FontAwesome not loaded */
.resto-global-popup .popup-nav .nav-fallback {
    display: none;
    font-size: 28px;
    line-height: 1;
    font-weight: bold;
}

/* If FontAwesome icon is not visible, show unicode fallback */
.resto-global-popup .popup-nav i.fa:empty+.nav-fallback,
.resto-global-popup .popup-nav:not(:has(i.fa))::before {
    display: inline-block;
}

/* Additional fallback using ::before if all else fails */
.resto-global-popup .popup-nav-prev:not(:has(i))::before {
    content: '‹';
    font-size: 28px;
    line-height: 1;
    font-weight: bold;
}

.resto-global-popup .popup-nav-next:not(:has(i))::before {
    content: '›';
    font-size: 28px;
    line-height: 1;
    font-weight: bold;
}

.resto-global-popup .popup-nav:active {
    transform: translateY(-50%) scale(0.95);
}

/* Style variations */
.resto-global-popup .popup-nav.nav-style-square {
    border-radius: 8px !important;
}

.resto-global-popup .popup-nav.nav-style-rounded {
    border-radius: 50% !important;
}

/* Ensure perfect centering for both styles */
.resto-global-popup .popup-nav.nav-style-square,
.resto-global-popup .popup-nav.nav-style-rounded {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.resto-global-popup .popup-nav.nav-style-square i,
.resto-global-popup .popup-nav.nav-style-rounded i {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: auto !important;
}

/* Fallback centering when shown */
.resto-global-popup .popup-nav .nav-fallback {
    align-items: center;
    justify-content: center;
}

/* Position variations */
.resto-global-popup .popup-nav-prev.nav-pos-edge {
    left: 20px;
}

.resto-global-popup .popup-nav-next.nav-pos-edge {
    right: 20px;
}

.resto-global-popup .popup-nav-prev.nav-pos-side {
    left: calc(50% - 350px);
}

.resto-global-popup .popup-nav-next.nav-pos-side {
    right: calc(50% - 350px);
}

/* Fallback for smaller screens with side position */
@media (max-width: 1200px) {
    .resto-global-popup .popup-nav-prev.nav-pos-side {
        left: 20px;
    }

    .resto-global-popup .popup-nav-next.nav-pos-side {
        right: 20px;
    }
}

.resto-global-popup .popup-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mobile: Smaller buttons */
@media (max-width: 767px) {
    .resto-global-popup .popup-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .resto-global-popup .popup-nav-prev {
        left: 10px !important;
    }

    .resto-global-popup .popup-nav-next {
        right: 10px !important;
    }
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

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

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

.popup-close:hover {
    background: #e9ecef;
    transform: scale(1.1);
}

.popup-close svg {
    width: 16px;
    height: 16px;
    fill: #6c757d;
}

/* Theme variants */
.theme-classic .resto-menu-item {
    border-radius: 8px;
    box-shadow: none;
    border: 1px solid #dee2e6;
}

.theme-classic .resto-menu-item:hover {
    transform: none;
    box-shadow: none;
}

.theme-minimal .resto-menu-item {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.theme-minimal .resto-menu-item h3 {
    font-weight: 600;
}

/* Column helpers (overrides default auto-fit) */
.cols-1 .resto-menu-items {
    grid-template-columns: repeat(1, 1fr);
}

.cols-2 .resto-menu-items {
    grid-template-columns: repeat(2, 1fr);
}

.cols-3 .resto-menu-items {
    grid-template-columns: repeat(3, 1fr);
}

.cols-4 .resto-menu-items {
    grid-template-columns: repeat(4, 1fr);
}

.cols-5 .resto-menu-items {
    grid-template-columns: repeat(5, 1fr);
}

.cols-6 .resto-menu-items {
    grid-template-columns: repeat(6, 1fr);
}

.popup-img-container {
    text-align: center;
    margin-bottom: 25px;
}

.popup-img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.popup-info {
    font-family: inherit;
}

.popup-section {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.popup-name-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.popup-item-name {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.popup-item-price {
    font-size: 20px;
    font-weight: 700;
    color: #27ae60;
    background: #ecf0f1;
    padding: 8px 16px;
    border-radius: 25px;
}

.popup-item-desc {
    font-size: 16px;
    color: #495057;
    line-height: 1.6;
    margin-bottom: 15px;
}

.popup-item-badges {
    margin-bottom: 15px;
}

.popup-item-nutrition {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.5;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
}

/* Responsive Design */
@media (max-width: 768px) {
    .resto-menu {
        padding: 0 15px;
        margin: 20px 0;
    }

    .resto-menu h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .resto-menu-items {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 20px;
    }

    .resto-menu-item {
        padding: 15px;
    }

    .resto-menu-item img {
        height: auto;
        object-fit: cover;
    }

    .resto-menu-item h3 {
        font-size: 18px;
    }

    .resto-global-popup .popup-container {
        width: 95%;
        height: 95%;
        border-radius: 12px;
        padding: 20px;
    }

    .popup-item-name {
        font-size: 20px;
    }

    .popup-item-price {
        font-size: 18px;
        padding: 6px 12px;
    }

    .popup-name-price {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .popup-item-name {
        text-align: left;
    }

    .popup-item-price {
        text-align: right;
    }
}

@media (max-width: 480px) {
    .resto-menu {
        padding: 0 10px;
    }

    .resto-menu h2 {
        font-size: 22px;
    }

    .resto-menu-item {
        padding: 12px;
    }

    .resto-menu-item img {
        height: 160px;
    }

    .resto-global-popup .popup-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        padding: 15px;
    }
}

/* Loading States */
.resto-menu-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.resto-menu-loading:before {
    content: "";
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #e74c3c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Error States */
.resto-menu-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin: 20px 0;
}

/* Accessibility */
.resto-menu-item:focus,
.popup-item:focus {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

.popup-close:focus {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .resto-global-popup {
        display: none !important;
    }

    .resto-menu-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .resto-menu-item:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Responsive columns (class-based overrides) */
@media (max-width: 767px) {
    .cols-m-1 .resto-menu-items {
        grid-template-columns: repeat(1, 1fr) !important;
    }

    .cols-m-2 .resto-menu-items {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .cols-m-3 .resto-menu-items {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .cols-t-1 .resto-menu-items {
        grid-template-columns: repeat(1, 1fr) !important;
    }

    .cols-t-2 .resto-menu-items {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .cols-t-3 .resto-menu-items {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .cols-t-4 .resto-menu-items {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (min-width: 1025px) {
    .cols-d-1 .resto-menu-items {
        grid-template-columns: repeat(1, 1fr) !important;
    }

    .cols-d-2 .resto-menu-items {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .cols-d-3 .resto-menu-items {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .cols-d-4 .resto-menu-items {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .cols-d-5 .resto-menu-items {
        grid-template-columns: repeat(5, 1fr) !important;
    }

    .cols-d-6 .resto-menu-items {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}

/* Image aspect ratios (override fixed height) */
.ratio-1x1 .resto-menu-item img {
    height: auto;
    aspect-ratio: 1 / 1;
}

.ratio-4x3 .resto-menu-item img {
    height: auto;
    aspect-ratio: 4 / 3;
}

.ratio-3x2 .resto-menu-item img {
    height: auto;
    aspect-ratio: 3 / 2;
}

.ratio-16x9 .resto-menu-item img {
    height: auto;
    aspect-ratio: 16 / 9;
}

/* Popup animations */
.resto-global-popup.anim-fade .popup-container {
    animation: popupFade 0.25s ease-out;
}

.resto-global-popup.anim-slide .popup-container {
    animation: popupSlideIn 0.3s ease-out;
}

.resto-global-popup.anim-zoom .popup-container {
    animation: popupZoom 0.25s ease-out;
}

@keyframes popupFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

@keyframes popupZoom {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   LABEL SYSTEM STYLES
   ======================================== */

/* Base label container */
.resto-item-labels {
    position: absolute;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 90%;
}

/* Label positioning */
.label-position-top-left {
    top: 10px;
    left: 10px;
}

.label-position-top-right {
    top: 10px;
    right: 10px;
    justify-content: flex-end;
}

.label-position-bottom-left {
    bottom: 10px;
    left: 10px;
}

.label-position-bottom-right {
    bottom: 10px;
    right: 10px;
    justify-content: flex-end;
}

/* Base label styles */
.resto-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.3s ease;
    line-height: 1.2;
}

.resto-label i {
    font-size: 13px;
    margin: 0;
}

/* Badge style (filled background) */
.resto-label-badge {
    background-color: #007cba;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.resto-label-badge:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

/* Tag style (outlined) */
.resto-label-tag {
    background-color: #fff;
    border: 2px solid #007cba;
    color: #007cba;
    padding: 3px 9px;
}

.resto-label-tag:hover {
    background-color: rgba(0, 124, 186, 0.1);
}

/* Icon only style */
.resto-label-icon {
    background-color: rgba(255, 255, 255, 0.95);
    color: #007cba;
    padding: 6px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.resto-label-icon i {
    margin: 0;
    font-size: 14px;
}

.resto-label-icon:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    transform: scale(1.1);
}

/* Label animations (CSS animations) */
@keyframes labelFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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

@keyframes labelSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

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

@keyframes labelZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes labelPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Apply animations based on settings (will be added dynamically) */
.label-animation-fade .resto-label {
    animation: labelFadeIn 0.4s ease-out;
}

.label-animation-slide .resto-label {
    animation: labelSlideIn 0.4s ease-out;
}

.label-animation-zoom .resto-label {
    animation: labelZoomIn 0.3s ease-out;
}

.label-animation-pulse .resto-label {
    animation: labelPulse 2s ease-in-out infinite;
}

/* Stagger animation for multiple labels */
.resto-item-labels .resto-label:nth-child(1) {
    animation-delay: 0s;
}

.resto-item-labels .resto-label:nth-child(2) {
    animation-delay: 0.1s;
}

.resto-item-labels .resto-label:nth-child(3) {
    animation-delay: 0.2s;
}

.resto-item-labels .resto-label:nth-child(4) {
    animation-delay: 0.3s;
}

.resto-item-labels .resto-label:nth-child(5) {
    animation-delay: 0.4s;
}

/* Responsive label sizing */
@media (max-width: 767px) {
    .resto-label {
        font-size: 11px;
        padding: 3px 8px;
    }

    .resto-label-icon {
        width: 24px;
        height: 24px;
    }

    .resto-item-labels {
        gap: 4px;
    }
}

/* ========================================
   LAYOUT SYSTEM STYLES
   ======================================== */

/* Menu Layout: Tabs */
.menu-layout-tabs .resto-menu {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 24px;
    /* box-shadow will be controlled by inline CSS from settings */
}

.menu-layout-tabs .resto-menu h2 {
    background: #fff;
    padding: 18px 28px;
    border-radius: 12px 12px 0 0;
    margin: -24px -24px 24px -24px;
    border-bottom: 3px solid #007cba;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* Menu Layout: List */
.menu-layout-list .resto-menu {
    background: transparent;
    padding: 0;
}

.menu-layout-list .resto-menu h2 {
    border-bottom: 3px solid #007cba;
    padding-bottom: 12px;
    margin-bottom: 24px;
    font-weight: 600;
    position: relative;
}

.menu-layout-list .resto-menu h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: #007cba;
    border-radius: 2px;
}

/* Sections Layout: Tabs */
.sections-layout-tabs .resto-menu-items {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    /* box-shadow will be controlled by inline CSS from settings */
    transition: box-shadow 0.3s ease, border-radius 0.3s ease;
}

/* Sections Layout: List */
.sections-layout-list .resto-menu-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sections-layout-list .resto-menu-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    /* box-shadow will be controlled by inline CSS from settings */
}

.sections-layout-list .resto-menu-item:hover {
    transform: translateY(-2px);
    /* box-shadow will be controlled by inline CSS from settings */
}

.sections-layout-list .resto-menu-item img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 10px;
}

.sections-layout-list .resto-menu-item .item-content {
    flex: 1;
    min-width: 0;
}

/* Sections Layout: Masonry */
.sections-layout-masonry .resto-menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 20px;
    gap: 20px;
}

.sections-layout-masonry .resto-menu-item {
    grid-row-end: span var(--span, 10);
    transition: transform 0.3s ease;
}

/* Fix for horizontal items in masonry - moved after base rules and increased specificity */
.sections-layout-masonry .resto-menu-items .resto-menu-item.item-layout-horizontal {
    --span: 4 !important;
    grid-row-end: span 4 !important;
    min-height: 0 !important;
    align-self: start;
}

.sections-layout-masonry .resto-menu-item:hover {
    transform: translateY(-4px);
}

.sections-layout-masonry .resto-menu-item:nth-child(3n+1) {
    --span: 12;
}

.sections-layout-masonry .resto-menu-item:nth-child(3n+2) {
    --span: 14;
}

.sections-layout-masonry .resto-menu-item:nth-child(3n+3) {
    --span: 11;
}

/* Responsive layout adjustments */
@media (max-width: 767px) {

    /* Menu Layout: Tabs - Mobile */
    .menu-layout-tabs .resto-menu {
        padding: 16px;
        border-radius: 12px;
    }

    .menu-layout-tabs .resto-menu h2 {
        padding: 14px 20px;
        margin: -16px -16px 16px -16px;
        border-radius: 10px 10px 0 0;
        font-size: 1.3rem;
    }

    /* Menu Layout: List - Mobile */
    .menu-layout-list .resto-menu h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }

    /* Sections Layout: Tabs - Mobile */
    .sections-layout-tabs .resto-menu-items {
        padding: 16px;
        border-radius: 10px;
    }

    /* Sections Layout: List - Mobile */
    .sections-layout-list .resto-menu-items {
        gap: 16px;
    }

    .sections-layout-list .resto-menu-item {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 16px;
        border-radius: 10px;
    }

    .sections-layout-list .resto-menu-item img {
        width: 100%;
        max-width: 220px;
        height: auto;
        aspect-ratio: 1;
    }

    /* Sections Layout: Masonry - Mobile */
    .sections-layout-masonry .resto-menu-items {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 16px;
    }

    .sections-layout-masonry .resto-menu-item {
        grid-row-end: auto;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .sections-layout-masonry .resto-menu-items {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 18px;
    }

    .sections-layout-list .resto-menu-item {
        gap: 20px;
        padding: 18px;
    }

    .sections-layout-list .resto-menu-item img {
        width: 130px;
        height: 130px;
    }
}

/* ========================================
   ITEM LAYOUT SYSTEM STYLES
   ======================================== */

/* Item Layout: Vertical (default - görsel üstte) */
.resto-menu-item.item-layout-vertical {
    display: flex;
    flex-direction: column;
}

.resto-menu-item.item-layout-vertical img {
    width: 100%;
    height: auto;
    margin-bottom: 15px;
}

.resto-menu-item.item-layout-vertical .item-content {
    flex: 1;
}

/* Item Layout: Horizontal (görsel solda) - Tüm cihazlar */
.resto-menu-item.item-layout-horizontal {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px;
}

/* For backend preview (has .item-image container) */
.resto-menu-item.item-layout-horizontal .item-image {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    flex-shrink: 0;
}

.resto-menu-item.item-layout-horizontal .item-image img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

/* For frontend (img directly under .resto-menu-item) */
.resto-menu-item.item-layout-horizontal>img {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.resto-menu-item.item-layout-horizontal .item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

/* item-info: Flex row for name + separator + price */
.resto-menu-item.item-layout-horizontal .item-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    /* Center for better separator alignment */
    gap: 0 !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
}

.resto-menu-item.item-layout-horizontal h3,
.resto-menu-item.item-layout-horizontal h4,
.resto-menu-item.item-layout-horizontal .item-name,
.resto-menu-item.item-layout-horizontal .item-info h3,
.resto-menu-item.item-layout-horizontal .item-info h4 {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    font-size: 14px !important;
    flex: 0 1 auto !important;
    /* Don't grow, so separator can fill */
    min-width: 0 !important;
    white-space: nowrap !important;
    /* For single line horizontal, nowrap is usually better */
    text-overflow: ellipsis;
    overflow: hidden;
}

.resto-menu-item.item-layout-horizontal h3 strong,
.resto-menu-item.item-layout-horizontal h4 strong {
    font-weight: 600;
}

.resto-menu-item.item-layout-horizontal .name-price-separator {
    flex: 1 1 auto !important;
    min-width: 10px !important;
    margin: 0 10px !important;
    align-self: center !important;
    height: 4px !important;
    /* Slightly smaller for sharper look */
}

.resto-menu-item.item-layout-horizontal .item-description,
.resto-menu-item.item-layout-horizontal p {
    font-size: 12px;
    margin: 3px 0 0 0;
    line-height: 1.3;
}

.resto-menu-item.item-layout-horizontal .item-price,
.resto-menu-item.item-layout-horizontal .price,
.resto-menu-item.item-layout-horizontal .item-info .item-price {
    font-size: 14px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

/* Desktop: Larger images and text for horizontal */
@media (min-width: 768px) {
    .resto-menu-item.item-layout-horizontal {
        gap: 15px;
        padding: 15px;
    }

    .resto-menu-item.item-layout-horizontal .item-image {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
    }

    .resto-menu-item.item-layout-horizontal .item-image img {
        height: 100px;
        border-radius: 8px;
    }

    .resto-menu-item.item-layout-horizontal>img {
        width: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
        height: 100px !important;
        border-radius: 8px;
    }

    .resto-menu-item.item-layout-horizontal h3,
    .resto-menu-item.item-layout-horizontal .item-name {
        font-size: 18px;
        margin-bottom: 5px;
    }

    .resto-menu-item.item-layout-horizontal .item-description,
    .resto-menu-item.item-layout-horizontal p {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .resto-menu-item.item-layout-horizontal .item-price {
        font-size: 18px;
    }
}

/* Item Layout: Minimal (kompakt, görsel yok veya küçük) */
.resto-menu-item.item-layout-minimal {
    display: flex;
    flex-direction: column;
    padding: 15px;
}

.resto-menu-item.item-layout-minimal img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    float: left;
    margin-right: 12px;
    margin-bottom: 8px;
}

.resto-menu-item.item-layout-minimal h3 {
    font-size: 16px;
    margin: 0 0 5px 0;
}

.resto-menu-item.item-layout-minimal p {
    font-size: 13px;
    margin: 0;
}

.resto-menu-item.item-layout-minimal .item-price {
    font-size: 14px;
    margin-top: 5px;
}

/* Name-Price Separator Styles */
.name-price-separator {
    flex: 1;
    height: 4px;
    margin: 0 10px;
    align-self: center;
    position: relative;
    overflow: hidden;
}

.name-price-separator.separator-dots {
    background-image: radial-gradient(circle, #000 1px, transparent 1px) !important;
    background-size: 5px 4px !important;
    background-position: center !important;
    background-repeat: repeat-x !important;
    opacity: 1 !important;
}

.name-price-separator.separator-dashes {
    background-image: linear-gradient(to right, #000 0%, #000 50%, transparent 50%, transparent 100%);
    background-size: 10px 1.5px;
    background-position: center;
    background-repeat: repeat-x;
    opacity: 1;
}

.name-price-separator.separator-solid {
    border-bottom: 1.5px solid #000;
    height: 0;
    align-self: center;
    opacity: 1;
    margin-bottom: -1px;
    /* Visual adjustment for alignment */
}

.name-price-separator.separator-none {
    display: none;
}

/* Mobile: Even smaller for very tight spaces */
@media (max-width: 480px) {
    .resto-menu-item.item-layout-horizontal .item-image {
        width: 50px !important;
        min-width: 50px !important;
        max-width: 50px !important;
    }

    .resto-menu-item.item-layout-horizontal .item-image img,
    .resto-menu-item.item-layout-horizontal>img {
        width: 50px !important;
        min-width: 50px !important;
        max-width: 50px !important;
        height: 50px !important;
    }

    .resto-menu-item.item-layout-horizontal h3,
    .resto-menu-item.item-layout-horizontal .item-name,
    .resto-menu-item.item-layout-horizontal h3 strong {
        font-size: 13px !important;
    }

    .resto-menu-item.item-layout-horizontal .item-description,
    .resto-menu-item.item-layout-horizontal p {
        font-size: 11px !important;
    }

    .resto-menu-item.item-layout-horizontal .item-price,
    .resto-menu-item.item-layout-horizontal .price {
        font-size: 13px !important;
    }
}

/* End of File */