:root {
    --primary-color: #ff6b35;
    --primary-hover: #e55a2b;
    --primary-light: #fff0eb;
    --text-dark: #333333;
    --text-light: #666666;
    --text-white: #ffffff;
    --background-white: #ffffff;
    --background-light: #f9f9f9;
    --border-color: #e0e0e0;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    background: #f5f5f5 !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    direction: rtl;
}

/* ===== Navbar (أبيض) ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 5%;
    background: #ffffff !important;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-dark);
}

.logo img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 25px;
    align-items: center;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 25px;
    transition: .3s;
    font-size: 16px;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-color);
    color: #ffffff;
}

.nav-user{
    display:flex;
    align-items:center;
    gap:12px;
}

.admin-nav-btn,
.logout-btn,
.login-btn{
    color: var(--text-dark);
    text-decoration:none;
    background:transparent;
    border:none;
    padding:8px 18px;
    font-size:14px;
    transition:.3s;
}

.admin-nav-btn:hover,
.login-btn:hover{
    color: var(--primary-color);
    transform:scale(1.05);
}

.logout-btn:hover{
    color: var(--danger-color);
    transform:scale(1.05);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    background: none;
    border: none;
}

.hamburger span {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* ===== Main Content ===== */
main {
    margin-top: 90px;
    padding: 0 5%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Category Boxes (أبيض) ===== */
.category-boxes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.category-box {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 15px;
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid #e0e0e0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    font-family: inherit;
    width: 100%;
    color: var(--text-dark);
}

.category-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.2);
    border-color: var(--primary-color);
}

.category-box.active {
    border: 3px solid var(--primary-color);
    background: rgba(255, 107, 53, 0.05) !important;
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.15);
}

.category-box .icon {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

.category-box .name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    text-shadow: none;
}

.category-box .count {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 5px;
}

/* ===== Menu Section (أبيض) ===== */
.menu {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 15px;
    padding: 40px 30px;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
}

.menu-heading {
    font-size: 32px;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 10px;
    font-weight: bold;
    text-shadow: none;
}

.menu-subheading {
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 30px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.no-items {
    text-align: center;
    color: var(--text-light);
    font-size: 18px;
    padding: 40px;
    grid-column: 1 / -1;
}

/* ===== Menu Item (أبيض مع ظل خفيف) ===== */
.menu-item {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
    min-height: 340px;
    position: relative;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.item-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #f0f0f0;
}

.item-image-placeholder {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: #ccc;
}

.item-name {
    font-size: 19px;
    color: var(--text-dark);
    margin-bottom: 6px;
    font-weight: bold;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
    line-height: 1.3;
    text-shadow: none;
}

.item-description {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.6;
    flex-grow: 1;
    text-align: center;
}

/* ===== Type Buttons ===== */
.type-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.type-btn {
    flex: 1;
    min-width: 70px;
    padding: 10px 12px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-dark);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-family: inherit;
}

.type-btn:hover:not(.disabled):not(.selected) {
    background: var(--primary-light);
    transform: scale(1.02);
}

.type-btn.selected {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.type-btn .price {
    display: inline-block;
    font-size: 14px;
    margin-top: 3px;
    font-weight: bold;
    color: var(--primary-color);
    background: #ffffff;
    padding: 2px 8px;
    border-radius: 6px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.15);
    text-shadow: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.type-btn.selected .price {
    background: #ffffff;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.type-btn.disabled .price {
    opacity: 0.5;
    border-color: #ccc;
    color: #999;
    background: #f5f5f5;
}

.type-btn.disabled {
    opacity: 0.6;
    cursor: default;
    border-color: #ccc;
    color: #999;
}

.type-btn .no-price {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

/* ===== Order Section ===== */
.order-section {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    flex-wrap: wrap;
    gap: 10px;
}

/* ===== تحسين عرض الأسعار ===== */
.item-price-container {
    background: #ffffff !important;
    border-radius: 8px;
    padding: 4px 10px;
    border: 2px solid var(--primary-color) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.15);
}

.item-price {
    color: var(--primary-color) !important;
    font-weight: bold;
    font-size: 16px;
}

.item-price .currency {
    font-size: 13px;
    color: var(--primary-color);
    margin-right: 2px;
}

.item-footer .item-price-container {
    background: #ffffff !important;
    padding: 4px 12px;
    border-radius: 10px;
    border: 2px solid var(--primary-color) !important;
}

.type-btn .price {
    background: #ffffff !important;
    color: var(--primary-color) !important;
    border-radius: 6px;
    padding: 2px 6px;
    border: 2px solid var(--primary-color) !important;
}

.order-button {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    width: 100%;
}

.order-button:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.order-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    color: #999;
}

.order-button.added-to-cart {
    background: var(--success-color);
}

/* ===== Login Required Message ===== */
.login-required-message {
    text-align: center;
    padding: 15px 20px;
    background: #fff3cd;
    border: 2px solid var(--warning-color);
    border-radius: 10px;
    margin: 20px 0;
}

.login-required-message p {
    color: var(--text-dark);
    font-size: 16px;
    margin: 0;
}

.login-required-message a {
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: none;
}

.login-required-message a:hover {
    text-decoration: underline;
}

/* ===== Cart ===== */
#views-total-orders {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
}

#orders-button {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-family: inherit;
    transition: all 0.3s ease;
}

#orders-button:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

#cart-count {
    background: #ffffff;
    color: var(--primary-color);
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: bold;
    margin-left: 5px;
}

/* ===== Cart Overlay ===== */
.cart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1002;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.cart-overlay.active {
    display: flex;
}

.order-list-container {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 4px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.cart-header .menu-heading {
    font-size: 24px;
    margin: 0;
    color: var(--text-dark);
}

.close-cart-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-dark);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    transition: all 0.3s ease;
}

.close-cart-btn:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

#orders-list {
    display: block;
    height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 5px;
    width: 100%;
}

/* Scrollbar styling */
#orders-list::-webkit-scrollbar {
    width: 6px;
}

#orders-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#orders-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

#orders-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

.empty-cart-message {
    text-align: center;
    color: var(--text-light);
    padding: 40px 20px;
    font-size: 16px;
}

.empty-cart-message .empty-icon {
    font-size: 50px;
    display: block;
    margin-bottom: 10px;
}

.order-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 10px;
    border: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    width: 100%;
}

.order-card:hover {
    border-color: var(--primary-color);
}

.order-card-content {
    flex: 1;
    min-width: 0;
}

.item-name-cart {
    font-weight: bold;
    font-size: 15px;
    color: var(--text-dark);
    word-break: break-word;
}

.item-price-cart {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 14px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.quantity-btn {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    font-family: inherit;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.quantity-display {
    font-weight: bold;
    min-width: 28px;
    text-align: center;
    color: var(--text-dark);
    font-size: 15px;
}

.remove-item-btn {
    background: var(--danger-color);
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    font-family: inherit;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.remove-item-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

.total-price-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 3px solid var(--primary-color);
    margin-bottom: 12px;
    flex-shrink: 0;
}

.total-price-label {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-dark);
}

.total-price-value {
    font-size: 22px;
    font-weight: bold;
    color: var(--primary-color);
}

.checkout-button {
    width: 100%;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkout-button:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.checkout-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-reserve {
    background: var(--info-color) !important;
}

.btn-reserve:hover:not(:disabled) {
    background: #138496 !important;
}

/* ===== Reservation Form ===== */
#reservation-overlay .form-group {
    margin-bottom: 15px;
}

#reservation-overlay .form-group label {
    display: block;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 5px;
    font-size: 14px;
}

#reservation-overlay .form-group label .required {
    color: red;
}

#reservation-overlay .form-group input,
#reservation-overlay .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

#reservation-overlay .form-group input:focus,
#reservation-overlay .form-group textarea:focus {
    outline: none;
    border-color: var(--info-color);
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

#reservation-overlay .reservation-total {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    color: var(--text-dark);
    flex-shrink: 0;
}

#reservation-overlay .reservation-total span {
    font-weight: bold;
    color: var(--primary-color);
}

/* ===== Notification ===== */
.notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.5s ease;
    display: none;
    color: #ffffff;
}

.notification.success {
    background: var(--success-color);
}

.notification.error {
    background: var(--danger-color);
}

.notification.info {
    background: var(--info-color);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .category-boxes {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width:768px){
    .hamburger{
        display:flex;
    }

    .nav-menu{
        display:none;
        position:absolute;
        top:100%;
        left:0;
        width:100%;
        background:#ffffff;
        flex-direction:column;
        padding:20px;
        gap:10px;
        text-align:center;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

    .nav-menu.active{
        display:flex;
    }

    .nav-user{
        flex-direction:column;
        width:100%;
        gap:8px;
    }

    .nav-user a{
        width:100%;
        text-align:center;
    }

    .navbar{
        padding:12px 5%;
    }

    .logo{
        font-size:20px;
    }

    .logo img{
        width:38px;
        height:38px;
    }

    .order-list-container {
        padding: 15px;
        max-width: 95%;
        max-height: 85vh;
    }

    #orders-list {
        max-height: 45vh;
        min-height: 80px;
    }

    .cart-header .menu-heading {
        font-size: 20px;
    }

    .item-name-cart {
        font-size: 14px;
    }

    .quantity-btn {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }

    #orders-button {
        padding: 12px 20px;
        font-size: 14px;
    }
}

@media (max-width:480px){
    .type-btn{
        min-width:55px;
        padding:5px;
    }

    .type-btn .price{
        font-size:10px !important;
    }

    .item-price{
        font-size:13px !important;
    }

    .item-price-container{
        padding:2px 6px;
    }

    .item-price {
        font-size: 14px !important;
        white-space: nowrap !important;
        display: inline-block !important;
    }
    
    .type-btn .no-price {
        display: block;
        font-size: 11px;
        color: #999;
        margin-top: 3px;
    }
    
    .item-price .currency {
        font-size: 11px !important;
    }
    
    .menu-item {
        padding: 10px !important;
        min-height: 250px !important;
    }
    
    .item-name {
        font-size: 13px !important;
        min-height: 32px !important;
    }
    
    .item-image {
        height: 100px !important;
    }
    
    .item-image-placeholder {
        height: 100px !important;
        font-size: 35px !important;
    }
    
    .order-section {
        margin-top: 8px !important;
        gap: 6px !important;
    }
    
    .item-footer {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 5px !important;
        flex-wrap: nowrap !important;
    }
    
    .order-button {
        font-size: 10px !important;
        padding: 6px 10px !important;
        width: auto !important;
        flex: 1 !important;
    }
    
    .menu-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .order-list-container {
        padding: 12px;
        max-height: 90vh;
    }

    #orders-list {
        max-height: 35vh;
        min-height: 60px;
    }

    .cart-header .menu-heading {
        font-size: 18px;
    }

    .order-card {
        padding: 10px;
        flex-wrap: wrap;
    }

    .item-name-cart {
        font-size: 13px;
    }

    .item-price-cart {
        font-size: 12px;
    }

    .quantity-btn {
        width: 18px;
        height: 18px;
        font-size: 11px;
    }

    .quantity-display {
        font-size: 13px;
        min-width: 24px;
    }

    .remove-item-btn {
        padding: 4px 8px;
        font-size: 10px;
    }

    .total-price-label {
        font-size: 15px;
    }

    .total-price-value {
        font-size: 18px;
    }

    .checkout-button {
        padding: 10px;
        font-size: 13px;
    }

    #orders-button {
        padding: 10px 16px;
        font-size: 12px;
        bottom: 15px;
        right: 15px;
    }

    #cart-count {
        padding: 1px 8px;
        font-size: 12px;
    }

    .close-cart-btn {
        font-size: 24px;
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 380px) {
    .type-btn {
        font-size: 10px !important;
        padding: 4px 6px !important;
        min-width: 40px !important;
    }
    
    .type-btn .price {
        font-size: 9px !important;
        padding: 1px 4px !important;
    }
    
    .item-price {
        font-size: 12px !important;
    }
    
    .item-price-container {
        padding: 2px 6px !important;
    }
    
    .type-btn .no-price {
        display: block;
        font-size: 11px;
        color: #999;
        margin-top: 3px;
    }
    
    .item-name {
        font-size: 12px !important;
    }
    
    .menu-item {
        padding: 8px !important;
        min-height: 220px !important;
    }
    
    .item-image {
        height: 80px !important;
    }
    
    .order-button {
        font-size: 9px !important;
        padding: 4px 8px !important;
    }

    #orders-list {
        max-height: 30vh;
    }
}

/* ===== إجبار الأسعار على عدم التفاف ===== */
.type-btn .price,
.item-price,
.item-price-container,
.currency,
.price {
    white-space: nowrap !important;
    display: inline-block !important;
    max-width: 100% !important;
}

#orders-list {
    flex-shrink: 0;
    width: 100%;
}

.order-card {
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.order-card-content {
    min-width: 0;
    width: 100%;
}

.item-name-cart,
.item-price-cart {
    overflow-wrap: break-word;
    word-break: break-word;
}