* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    background: #d2691e;
    min-height: 100vh;
    padding: 30px 20px;
    color: #333;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(139, 69, 19, 0.1) 2px, rgba(139, 69, 19, 0.1) 4px),
        repeating-linear-gradient(-45deg, transparent, transparent 2px, rgba(139, 69, 19, 0.08) 2px, rgba(139, 69, 19, 0.08) 4px),
        radial-gradient(circle at 20% 30%, rgba(139, 69, 19, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 69, 19, 0.12) 0%, transparent 50%);
}

.menu-wrapper {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.menu-panel {
    background: #fffef0;
    padding: 40px 50px 50px;
    margin: 40px auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 850px;
}

/* Decorative top border */
.menu-panel::before {
    content: '';
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    height: 25px;
    background: #fffef0;
}

header {
    text-align: center;
    margin-bottom: 75px;
    padding-bottom: 15px;
    border-bottom: none;
}

.restaurant-logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.restaurant-logo {
    max-width: 200px;
    max-height: 120px;
    height: auto;
    width: auto;
    object-fit: contain;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.header-text {
    flex: 1;
    text-align: center;
}

.halal-logo {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.halal-cert-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.restaurant-name {
    font-family: 'Cinzel Decorative', 'Georgia', 'Times New Roman', serif;
    font-size: 3.5em;
    color: #2d5016;
    margin-bottom: 40px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1.2;
}

.cuisine-type {
    font-family: 'Arial', sans-serif;
    font-size: 0.9em;
    color: #654321;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 600;
    position: relative;
    display: inline-block;
    padding: 0 20px;
}

.cuisine-type::before,
.cuisine-type::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30px;
    height: 1px;
    background: #654321;
}

.cuisine-type::before {
    left: -40px;
}

.cuisine-type::after {
    right: -40px;
}

.menu-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.menu-column {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.menu-section {
    margin-bottom: 0;
}

.main-category {
    font-family: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
    font-size: 1.4em;
    color: #8b4513;
    margin-bottom: 15px;
    margin-top: 25px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2d5016;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sub-category {
    font-family: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
    font-size: 1.4em;
    color: #8b4513;
    margin-bottom: 15px;
    margin-top: 25px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2d5016;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.menu-items {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 40px;
}

.menu-items.single-column {
    grid-template-columns: 1fr;
    gap: 0;
}

/* Thali items - description stays on left, doesn't extend to right */
.thali-section .item-description {
    margin-top: 3px;
    max-width: 100%;
    font-size: 0.75em;
}

/* Thali items - price on separate line */
.menu-items .menu-item > .item-name {
    display: block;
    margin-bottom: 2px;
}

.menu-items .menu-item > .item-price {
    display: block;
    margin-bottom: 3px;
    text-align: left;
}

.menu-item {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px dotted #ddd;
}

.menu-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Remove border from second-to-last item only if there are an even number of items (2 items in last row) */
.menu-items:has(.menu-item:nth-child(even):last-child) .menu-item:nth-last-child(2) {
    border-bottom: none;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.item-name {
    font-family: 'Arial', sans-serif;
    font-size: 1em;
    color: #654321;
    font-weight: 500;
    flex: 1;
    line-height: 1.4;
}

.item-name .parentheses {
    font-size: 0.75em;
}

.item-price {
    font-family: 'Arial', sans-serif;
    font-size: 1em;
    color: #8b4513;
    font-weight: 700;
    white-space: nowrap;
    margin-left: 15px;
}

.item-description {
    font-family: 'Arial', sans-serif;
    font-size: 0.85em;
    color: #654321;
    font-weight: 400;
    line-height: 1.4;
    margin-top: 3px;
    font-style: italic;
}


/* Divider line */
.divider {
    height: 2px;
    background: #e8e8e8;
    margin: 30px 0;
    width: 100%;
}

/* Responsive Design */
@media (max-width: 968px) {
    .menu-panel {
        padding: 50px 40px 40px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 15px 10px;
    }
    
    .menu-panel {
        padding: 40px 30px 30px;
        margin-top: 30px;
    }
    
    .menu-items {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .header-content {
        flex-direction: column;
    }
    
    .halal-logo {
        position: static;
        transform: none;
        margin-top: 15px;
    }
    
    .halal-cert-logo {
        width: 60px;
        height: 60px;
    }
    
    .restaurant-name {
        font-size: 2.5em;
    }
    
    .main-category {
        font-size: 1.5em;
    }
    
    .sub-category {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .menu-panel {
        padding: 35px 20px 25px;
    }
    
    .restaurant-name {
        font-size: 2em;
    }
    
    .cuisine-type {
        font-size: 0.75em;
        letter-spacing: 2px;
    }
    
    .main-category {
        font-size: 1.3em;
    }
    
    .sub-category {
        font-size: 1.1em;
    }
    
    .item-name,
    .item-price {
        font-size: 0.9em;
    }
}

/* Print Styles */
@media print {
    body {
        background: #d2691e !important;
        background-image: 
            repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(139, 69, 19, 0.1) 2px, rgba(139, 69, 19, 0.1) 4px),
            repeating-linear-gradient(-45deg, transparent, transparent 2px, rgba(139, 69, 19, 0.08) 2px, rgba(139, 69, 19, 0.08) 4px),
            radial-gradient(circle at 20% 30%, rgba(139, 69, 19, 0.15) 0%, transparent 50%),
            radial-gradient(circle at 80% 70%, rgba(139, 69, 19, 0.12) 0%, transparent 50%) !important;
        padding: 10px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .menu-panel {
        box-shadow: none;
        margin-top: 0;
        padding: 20px 35px !important;
    }
    
    .menu-panel::before {
        display: block !important;
        top: -25px !important;
        height: 25px !important;
        background: #fffef0 !important;
    }
    
    .menu-panel::after {
        display: none;
    }
    
    /* Ensure 2-column layout in PDF */
    .menu-items {
        grid-template-columns: 1fr 1fr !important;
        gap: 0 30px !important;
    }
    
    .menu-items.single-column {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    
    /* Page break for 2-page layout */
    .page-break-after {
        page-break-after: always !important;
        break-after: page !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Optimize font sizes and spacing for 2-page fit */
    .restaurant-name {
        font-size: 1.6em !important;
        margin-bottom: 18px !important;
    }
    
    .cuisine-type {
        font-size: 0.63em !important;
    }
    
    .main-category,
    .sub-category {
        font-size: 0.88em !important;
        margin-top: 4px !important;
        margin-bottom: 3px !important;
        padding-bottom: 2px !important;
    }
    
    /* Add extra margin to first category (Appetizers) */
    .menu-content > .menu-section:first-child .main-category {
        margin-top: 12px !important;
    }
    
    /* Add extra margin to first section after page break (Beef Curries) */
    .page-break-after + .menu-section {
        margin-top: 10px !important;
    }
    
    .page-break-after + .menu-section .sub-category {
        margin-top: 10px !important;
    }
    
    .menu-section {
        margin-bottom: 4px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    
    .menu-content {
        gap: 6px !important;
    }
    
    .menu-item {
        margin-bottom: 3px !important;
        padding-bottom: 2px !important;
    }
    
    .item-name,
    .item-price {
        font-size: 0.68em !important;
        line-height: 1.2 !important;
    }
    
    .item-name .parentheses {
        font-size: 0.58em !important;
    }
    
    header {
        margin-bottom: 18px !important;
        padding-bottom: 5px !important;
        border-bottom: none !important;
    }
    
    .restaurant-logo-container {
        margin-bottom: 8px !important;
    }
    
    .restaurant-logo {
        max-width: 150px !important;
        max-height: 80px !important;
    }
    
    .halal-cert-logo {
        width: 60px !important;
        height: 60px !important;
    }
    
    .header-content {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    
    .halal-logo {
        position: absolute !important;
        right: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }
    
    .menu-panel {
        padding: 15px 22px !important;
        margin: 20px auto !important;
        max-width: 800px !important;
        width: 90% !important;
    }
    
    body {
        padding: 15px !important;
    }
    
    .menu-wrapper {
        max-width: 100% !important;
    }
    
    .menu-items {
        gap: 0 23px !important;
    }
    
    .item-row {
        margin-bottom: 1px !important;
    }
}
