body {
    background-color: #fff8f0;
    color: #552915;
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden; 
}

a {
    text-decoration: none;
}

.menu-container {
    padding: 30px 20px;
    min-height: 100vh;
    background-color: #fff8f0;
    margin-left: 260px;
    margin-top: 0px;
    transition: margin-left 0.3s ease, margin-top 0.3s ease;
}

.tab-container {
    display: flex;
    overflow-x: auto;
    border-bottom: 2px solid #e0c8a0;
    margin-bottom: 20px;
    background-color: #fff4e6;
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.tab-button {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    color: #704225;
    transition: color 0.3s, background-color 0.3s, border-bottom 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-button:hover:not(.active) {
    background-color: #f3d9b1;
    color: #552915;
}

.tab-button.active {
    color: #4b3621;
    border-bottom: 3px solid #552915;
    background-color: #fff;
    border-radius: 5px 5px 0 0;
}

.category-section {
    display: none;
    margin-bottom: 40px;
}

.category-title {
    font-size: 1.6em;
    margin-bottom: 12px;
    color: #4b3621;
}

.subcategory-section {
    margin-bottom: 30px;
}

.subcategory-title {
    font-size: 1.3em;
    margin-top: 0;
    margin-bottom: 15px;
    color: #704225;
    border-bottom: 1px dashed #e0c8a0;
    padding-bottom: 5px;
}

.category-products,
.subcategory-products {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    overflow-x: hidden;
    padding-bottom: 10px;
    scroll-behavior: smooth;
}

.product-card {
    flex: 1 1 calc(25% - 15px);
    max-width: 220px;
    box-sizing: border-box;
    min-width: 140px;
    background: #fff;
    border-radius: 12px;
    padding: 20px 15px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.product-card h3 {
    font-size: 1.2em;
    margin-bottom: 8px;
    color: #4b3621;
}

.product-desc-card {
    font-size: 0.9em;
    color: #704225;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 5.8em;
}

.product-card p {
    font-size: 1em;
    margin-bottom: 12px;
    font-weight: 600;
    color: #4b3621;
}

.product-card.unavailable {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(100%);
}

.product-card.unavailable::before {
    content: "UNAVAILABLE";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(85, 41, 21, 0.7);
    color: #fff8f0;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    font-size: 1.2em;
    z-index: 5;
}

.add-cart-btn,
.reviews-btn {
    width: 100%;
    padding: 10px 0;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    margin-bottom: 8px;
}

.add-cart-btn {
    background: #552915;
    color: #fff;
}

.add-cart-btn:hover {
    background-color: #704225;
}

.reviews-btn {
    background: #f3d9b1;
    color: #552915;
}

.reviews-btn:hover {
    background-color: #704225;
    color: #fff;
}

.info-section {
    margin: 60px auto 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    width: auto;
    background-color: #fff4e6;
    padding: 30px 35px;
    border-radius: 15px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
    gap: 25px;
}

.info-section div {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
}

.info-section h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #4b3621;
}

.info-section p,
.info-section a {
    font-size: 1em;
    margin: 5px 0;
    color: #552915;
}

.info-section a:hover {
    color: #704225;
}

.divider {
    width: 100%;
    height: 1px;
    background-color: #f3d9b1;
    margin: 25px 0;
}

.credits {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    font-size: 0.95em;
    color: #4b3621;
    flex-wrap: wrap;
    padding: 15px 0 0 0;
    background-color: #fff4e6;
}

.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    justify-content: center;
    align-items: center;
    z-index: 1200;
}

.popup-content {
    background: #fff8f0;
    padding: 30px 25px;
    border-radius: 12px;
    text-align: center;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    position: relative;
    max-height: 80vh; 
    overflow-y: auto;
}

#loginPopup .popup-content {
    background: #fff;
    border-radius: 14px;
    padding: 40px 30px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

#loginPopup h2 {
    font-size: 1.4em;
    margin-bottom: 15px;
    color: #4b3621;
}

#loginPopup p {
    font-size: 1em;
    margin-bottom: 20px;
    color: #704225;
}

#loginPopup .login-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #552915;
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

#loginPopup .login-btn:hover {
    background: #704225;
}

#loginPopup .close-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s;
    margin-top: 15px;
}

#loginPopup .close-btn:hover {
    background: #b91c1c;
}

.cart-popup h2.product-name {
    margin-bottom: 10px;
    font-size: 1.5em;
}

.cart-popup p.product-desc {
    font-size: 1em;
    margin-bottom: 15px;
    line-height: 1.5;
}

.cart-popup .sizes-container>p,
.cart-popup .addons-container>p {
    width: 100%;
    text-align: left;
    font-weight: 600;
    color: #4b3621;
    margin-bottom: 5px;
}

.cart-popup .sizes-container,
.cart-popup .addons-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap; 
}

.cart-popup .sizes-container label,
.cart-popup .addons-container label {
    flex: 1;
    min-width: 150px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background-color: #fff4e6;
    border-radius: 8px;
    border: 1px solid #e0c8a0;
    cursor: pointer;
    transition: background 0.2s, border 0.2s;
    text-align: left;
    box-sizing: border-box; 
}

.cart-popup .sizes-container label.selected,
.cart-popup .addons-container label.selected {
    background-color: #f3d9b1;
    border-color: #704225;
    font-weight: 600;
}

.cart-popup .sizes-container label.unavailable,
.cart-popup .addons-container label.unavailable {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f3f3f3;
}

.cart-popup .sizes-container input[type="radio"],
.cart-popup .addons-container input[type="checkbox"] {
    accent-color: #552915;
    cursor: pointer;
}

.cart-popup .sizes-container label:hover:not(.unavailable),
.cart-popup .addons-container label:hover:not(.unavailable) {
    background-color: #f3e0c9;
    border-color: #704225;
}

.quantity-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    margin-bottom: 20px;
}

.quantity-wrapper button {
    width: 32px;
    height: 32px;
    background-color: #fff4e6;
    color: #704225;
    border: 1px solid #e0c8a0;
    border-radius: 8px;
    font-size: 1.2em;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.quantity-wrapper button:hover {
    background-color: #f3e0c9;
    transform: scale(1.05);
}

.quantity-wrapper input.quantity-input {
    width: 60px;
    padding: 6px 8px;
    text-align: center;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1em;
}

.cart-popup button.confirm-add-cart {
    margin-top: 5px;
    padding: 10px 20px;
    width: 100%;
    max-width: 250px;
    background-color: #552915;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.cart-popup button.confirm-add-cart:hover:not([disabled]) {
    background-color: #704225;
}

.cart-popup button.confirm-add-cart:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.cart-popup .close-cart {
    margin-top: 10px;
    padding: 8px 16px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.2s;
}

.cart-popup .close-cart:hover {
    background: #b91c1c;
}

.popup.reviews-popup {
    z-index: 1300;
    padding: 20px;
    animation: fadeIn 0.3s ease-in-out;
}

.popup.reviews-popup .popup-content {
    background-color: #fff8f0;
    max-width: 520px;
    width: 100%;
    padding: 30px 25px;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.95);
    animation: popupOpen 0.25s forwards;
}

.popup.reviews-popup .close-reviews {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #4b3621;
    line-height: 1;
    padding: 5px;
    transition: color 0.2s;
}

.popup.reviews-popup .close-reviews:hover {
    color: #dc2626;
}

.popup.reviews-popup h3 {
    font-size: 1.6em;
    margin-bottom: 15px;
    color: #4b3621;
}

.feedback-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feedback-list .review-item {
    background-color: #fff4e6;
    border-left: 4px solid #704225;
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    text-align: left;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feedback-list .review-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.feedback-list .review-item p {
    margin-bottom: 0;
    line-height: 1.5;
    font-size: 0.95em;
    color: #552915;
}

.feedback-list .review-item span {
    color: #704225;
    font-weight: bold;
}

.stars-outer {
    position: relative;
    display: inline-block;
    color: #ccc;
    font-size: 16px;
    font-family: Arial, sans-serif;
    margin-bottom: 5px;
}

.stars-inner {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    overflow: hidden;
    color: gold;
}

.stars-outer::before,
.stars-inner::before {
    content: "★★★★★";
}

.rating-number {
    margin-left: 5px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}



#termsPopup .popup-content {
    background-color: #fff8f0;
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    padding: 30px 25px;
    border-radius: 14px;
    text-align: left;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
}

#termsPopup h2 {
    font-size: 1.6em;
    margin-bottom: 15px;
    color: #4b3621;
}

#termsPopup .terms-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    margin-bottom: 15px;
}

#termsPopup p {
    font-size: 1em;
    margin-bottom: 12px;
    line-height: 1.5;
    color: #552915;
}

#termsPopup .close-terms {
    align-self: center;
    padding: 10px 20px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background 0.2s;
}

#termsPopup .close-terms:hover {
    background: #b91c1c;
}

.favorite-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1.5em;
    cursor: pointer;
    color: #704225;
    opacity: 0.7;
    transition: transform 0.2s, color 0.2s, opacity 0.2s;
    z-index: 10;
}

.product-card:hover .favorite-icon {
    opacity: 1;
}

.favorite-icon.favorited {
    color: #d9464a;
    transform: scale(1.1);
    opacity: 1;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: #4CAF50;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes popupOpen {
    to {
        transform: scale(1);
    }
}


@media (min-width: 768px) {
    .product-card {
        flex: 1 1 calc(33.33% - 15px);
    }
}

@media (min-width: 1024px) {
    .product-card {
        flex: 1 1 calc(25% - 15px);
    }
}

@media (max-width: 1024px) {
    .menu-container {
        margin-left: 200px;
        padding: 20px 15px;
    }

    .product-card {
        min-width: 180px;
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    .menu-container {
        margin-left: 0;
        margin-top: 0;
        padding: 20px 15px;
    }

    .category-products,
    .subcategory-products {
        gap: 12px;
    }

    .product-card {
        flex: 1 1 calc(50% - 10px);
        min-width: 140px;
        max-width: none;
        padding: 15px 12px;
    }

    .product-card h3 {
        font-size: 1em;
    }

    .info-section {
        flex-direction: column;
        padding: 20px;
        gap: 15px;
    }
    
    .popup-content,
    #loginPopup .popup-content,
    .popup.reviews-popup .popup-content,
    #termsPopup .popup-content {
        max-width: 90vw; 
        width: 90vw; 
        padding: 20px 15px;
        max-height: 80vh; 
    }
    
    .cart-popup .sizes-container label,
    .cart-popup .addons-container label {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .product-card {
        flex: 0 0 calc(50% - 7.5px); 
        min-width: 130px;
        max-width: 100%; 
        padding: 12px;
    }

    .add-cart-btn,
    .reviews-btn {
        font-size: 0.9em;
        padding: 8px 0;
    }

    .info-section h3 {
        font-size: 1.1em;
    }
    
    .popup {
        padding: 0; 
    }
    
    .popup-content,
    #loginPopup .popup-content,
    .popup.reviews-popup .popup-content,
    #termsPopup .popup-content {
        width: 90%; 
        max-width: 90%;
        margin: 15px auto; 
        max-height: 65vh; 
        overflow-y: auto;
        padding: 15px 10px; 
    }
    
    .cart-popup h2.product-name {
        font-size: 1.2em; 
    }
    .cart-popup p.product-desc {
        font-size: 0.85em; 
    }

    #loginPopup .popup-content {
        padding: 20px 15px;
    }

    .cart-popup .sizes-container,
    .cart-popup .addons-container {
        gap: 6px; 
    }
    
    .cart-popup .sizes-container label,
    .cart-popup .addons-container label {
        width: 100%; 
        min-width: unset; 
        padding: 6px 8px; 
        font-size: 0.85em; 
    }
    
    .cart-popup button.confirm-add-cart {
        max-width: 100%; 
        font-size: 1em;
        padding: 10px 0;
    }
    
    .cart-popup .close-cart {
        padding: 8px 0;
    }
}
