:root {
    --color-white: #FFFFFF; /* 60% base */
    --color-black: #2c3e50; /* Darker tone for text/elements */
    --color-blue: #3498db; /* Main blue for buttons, accents */
    --color-purple: #9b59b6; /* Main purple for gradients, accents */
    --gradient-bg: linear-gradient(to right, var(--color-blue), var(--color-purple)); /* Gradient for header */
    --secondary-bg: #ecf0f1; /* Light grey for sections */
    --border-color: #e0e0e0;
    --button-hover-blue: #2980b9; /* Darker blue on hover */
    --button-hover-purple: #8e44ad; /* Darker purple on hover */
    --text-color: #333;
    --star-color: #f39c12; /* Golden yellow for stars */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--secondary-bg); /* Use light grey for overall body background */
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px; /* Adjust based on desired max width */
    background-color: var(--color-white); /* White background for the main content area */
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

/* Header (Top horizontal header) */
.main-header { /* Renamed from .header to match your HTML */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--gradient-bg); /* Gradient background as per image */
    color: var(--color-white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .logo { /* Renamed from .header to match your HTML */
    font-size: 24px;
    font-weight: bold;
    flex-shrink: 0;
    margin-right: 20px; /* Space between logo and search */
}

.search-bar {
    flex-grow: 1;
    display: flex;
    max-width: 500px; /* Max width for search bar */
    background-color: var(--color-white); /* White background for search input area */
    border-radius: 25px; /* Rounded corners for the whole search bar */
    overflow: hidden; /* Ensures contents respect border-radius */
    box-shadow: 0 2px 8px rgba(0,0,0,0.15); /* Subtle shadow for the search bar */
}

.search-bar input {
    flex-grow: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 25px; /* Fully rounded input */
    outline: none;
    background-color: transparent; /* Make input background transparent to show parent's white */
    color: var(--text-color);
    font-size: 16px;
}

.search-bar button {
    background-color: transparent; /* Make button background transparent */
    color: #666; /* Darker icon color for contrast with white input */
    border: none;
    padding: 10px 15px;
    border-radius: 0 25px 25px 0; /* Only right side rounded */
    cursor: pointer;
    font-size: 18px; /* Slightly larger search icon */
    transition: color 0.3s ease;
}

.search-bar button:hover {
    color: var(--color-blue); /* Blue on hover for search icon */
}

.header-icons {
    display: flex;
    gap: 15px;
    margin-left: 20px; /* Space between search and icons */
}

.icon-btn {
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 20px;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}
.icon-btn:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c; /* Red for notification */
    color: var(--color-white);
    border-radius: 50%;
    font-size: 12px;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

/* Main Content */
.main-content {
    padding: 20px;
    background-color: var(--color-white); /* Main content background should be white */
}

/* Shop Info Section */
.shop-info {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background-color: var(--secondary-bg); /* Light grey background for shop info */
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05); /* Subtle shadow for depth */
}

.shop-logo-placeholder img { /* Target the img inside the placeholder */
    width: 90px; /* Slightly larger for visual prominence */
    height: 90px;
    object-fit: cover;
    border-radius: 50%; /* Perfect circle */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Shadow for logo */
}


.shop-details {
    flex-grow: 1;
}

.shop-name {
    font-size: 32px; /* Slightly larger for more prominence */
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--color-black);
}

.shop-rating {
    color: var(--star-color); /* Star color */
    font-size: 18px; /* Slightly larger stars and number */
    margin-bottom: 5px;
}
.shop-rating .fas.fa-star, .fas.fa-star-half-alt, .far.fa-star {
    color: var(--star-color);
}
.shop-rating .review-count {
    font-size: 15px; /* Match image */
    color: #777;
    margin-left: 5px;
}

.followers {
    font-size: 15px; /* Match image */
    color: #777;
}

.shop-actions {
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    gap: 10px; /* Space between stacked buttons */
    flex-shrink: 0;
}

.btn {
    padding: 10px 20px; /* More padding for larger, clickable buttons */
    border: none;
    border-radius: 8px; /* Slightly more rounded for modern look */
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex; /* Allow icon and text to align */
    align-items: center;
    justify-content: center;
    min-width: 120px; /* Ensure buttons have consistent width if needed */
}
.btn i {
    margin-right: 8px; /* Space between icon and text */
    font-size: 18px; /* Icon size */
}

.btn-follow {
    background-color: var(--color-blue);
    color: var(--color-white);
}
.btn-follow:hover {
    background-color: var(--button-hover-blue);
    transform: translateY(-2px); /* Slight lift on hover */
}

/* New: Chat button styling */
.btn-chat {
    background-color: var(--color-purple); /* Use purple for chat to differentiate */
    color: var(--color-white);
}
.btn-chat:hover {
    background-color: var(--button-hover-purple);
    transform: translateY(-2px); /* Slight lift on hover */
}


/* Main Navigation Tabs (หน้าหลัก, สินค้า/เมนู, หมวดหมู่) */
.main-nav-tabs {
    display: flex;
    justify-content: space-around;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    background-color: var(--color-white); /* Ensure background is white below shop info */
}

.main-tab-item {
    background: none;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 17px;
    font-weight: bold;
    color: #555;
    position: relative;
    transition: color 0.3s ease;
    flex-grow: 1; /* Distribute space evenly */
    text-align: center;
}

.main-tab-item.active {
    color: var(--color-blue);
}

.main-tab-item.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-bg);
}

.main-tab-item:hover:not(.active) {
    color: var(--color-blue);
}

/* Dynamic Main Content Area */
.dynamic-main-content-area {
    padding-top: 10px; /* Space from tabs */
}

.tab-content {
    display: none; /* Hidden by default */
    animation: fadeIn 0.5s ease-out;
}
.tab-content.active {
    display: block; /* Show active section */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* Business Description Section */
.business-description {
    padding: 20px;
    background-color: var(--secondary-bg);
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Consistent with other sections */
}
.business-description h2 {
    font-size: 22px;
    color: var(--color-black);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.business-description h3 {
    font-size: 18px;
    color: var(--color-black);
    margin-top: 15px;
    margin-bottom: 10px;
}
.business-description p {
    color: #555;
    margin-bottom: 10px;
}
.business-description ul {
    list-style-type: disc;
    margin-left: 20px;
    color: #555;
}
.business-description li {
    margin-bottom: 5px;
}


/* Product Sub Navigation Tabs (แนะนำ, ขายดี, ใหม่, ราคา) */
.product-sub-tabs {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping for responsiveness */
    justify-content: flex-start; /* Align to start */
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    gap: 10px; /* Space between tab items */
}

.sub-tab-item {
    background: none;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 17px;
    font-weight: bold;
    color: #555;
    position: relative;
    transition: color 0.3s ease;
    flex-shrink: 0; /* Prevent shrinking on small screens */
}

.sub-tab-item.active {
    color: var(--color-blue);
}

.sub-tab-item.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-bg);
}

.sub-tab-item:hover:not(.active) {
    color: var(--color-blue);
}

.sub-tab-item-price-sort {
    display: flex;
    align-items: center;
    gap: 5px;
}
.sub-tab-item-price-sort .sub-tab-item {
    padding: 15px 10px; /* Slightly less padding for smaller buttons */
}

.display-style-selector {
    margin-left: auto; /* Pushes to the right */
    padding: 10px 0;
}
.display-style-selector select {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background-color: var(--secondary-bg);
    color: var(--text-color);
    cursor: pointer;
}


/* Product Listing */
.product-listing {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Adjusted min-width slightly */
    gap: 20px;
    margin-bottom: 30px;
}

.product-card {
    background-color: var(--color-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.product-card-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--color-black);
    margin-bottom: 10px;
    min-height: 40px; /* Ensure consistent height for titles */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card-price {
    font-size: 20px;
    font-weight: bold;
    color: var(--color-purple);
    margin-bottom: 10px;
}

.product-card .btn-buy {
    width: 100%;
    background-color: var(--color-blue);
    color: var(--color-white);
    padding: 10px 0;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.product-card .btn-buy:hover {
    background-color: var(--button-hover-blue);
}

/* Load More Button */
.btn-load-more {
    display: block;
    width: 200px;
    margin: 20px auto;
    background-color: var(--color-purple);
    color: var(--color-white);
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 18px;
    text-align: center;
}
.btn-load-more:hover {
    background-color: var(--button-hover-purple);
}

/* Shop Details Info */
.shop-details-info, .shop-reviews-section {
    padding: 20px;
    background-color: var(--secondary-bg);
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Consistent with other sections */
}

.shop-details-info h2, .shop-reviews-section h2, .categories-section h2 {
    font-size: 22px;
    color: var(--color-black);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    color: #555;
}
.info-item i {
    font-size: 18px;
    color: var(--color-blue);
    flex-shrink: 0;
}

/* Shop Reviews */
.review-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.review-summary .stars {
    font-size: 24px;
    color: var(--star-color);
}

.btn-write-review {
    background-color: var(--color-purple);
    color: var(--color-white);
    padding: 10px 20px;
}
.btn-write-review:hover {
    background-color: var(--button-hover-purple);
}

.all-reviews-link {
    text-align: right;
    margin-bottom: 15px; /* Add margin below the link */
}
.all-reviews-link a {
    color: var(--color-blue);
    text-decoration: none;
    font-weight: bold;
}
.all-reviews-link a:hover {
    text-decoration: underline;
}

/* Categories Section */
#categories-section { /* Changed to ID selector as in HTML */
    padding: 20px;
    background-color: var(--secondary-bg); /* Add background for consistency */
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* 2 items per row when wide enough */
    gap: 20px;
}

.category-card {
    background-color: var(--color-white); /* Changed to white for distinction from section bg */
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}
.category-info h3 {
    font-size: 20px;
    color: var(--color-black);
    margin-bottom: 5px;
}
.category-info p {
    font-size: 14px;
    color: #777;
}
.category-card .btn-view-more {
    background-color: var(--color-blue);
    color: var(--color-white);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}
.category-card .btn-view-more:hover {
    background-color: var(--button-hover-blue);
}


/* Overlays (Product Detail & Cart) */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.overlay-content {
    background-color: var(--color-white);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    max-height: 90%;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}
.overlay.active .overlay-content {
    transform: translateY(0);
    opacity: 1;
}

.product-detail-content {
    width: 90%;
    max-width: 800px;
    padding: 30px;
}

.cart-content {
    width: 90%;
    max-width: 450px; /* Narrower for cart */
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* To push summary to bottom */
}


.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    color: var(--color-black);
    cursor: pointer;
    z-index: 10;
}
.close-btn:hover {
    color: #e74c3c;
}

/* Product Detail Page Styling (within overlay) */
#product-detail-area {
    padding-top: 20px; /* Space for close button */
}

.product-detail-area h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--color-black);
}

.product-detail-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    color: #555;
}

.product-detail-meta .rating span {
    color: var(--star-color);
    font-weight: bold;
}

.product-detail-meta .sold-count {
    font-size: 16px;
}

.product-detail-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

/* Added shop-chat-btns group to structure the action buttons better if they were to expand */
.product-detail-actions .shop-chat-btns {
    display: flex;
    gap: 10px;
}

.product-detail-actions .shop-chat-btns button {
    background-color: var(--color-black);
    color: var(--color-white);
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    transition: background-color 0.3s ease;
}
.product-detail-actions .shop-chat-btns button:hover {
    background-color: #555;
}

.product-detail-actions .add-to-cart-btn,
.product-detail-actions .buy-now-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.product-detail-actions .add-to-cart-btn {
    background-color: var(--color-blue);
    color: var(--color-white);
}
.product-detail-actions .add-to-cart-btn:hover {
    background-color: var(--button-hover-blue);
}

.product-detail-actions .buy-now-btn {
    background-color: var(--color-purple);
    color: var(--color-white);
}
.product-detail-actions .buy-now-btn:hover {
    background-color: var(--button-hover-purple);
}

.product-image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.product-image-gallery img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease;
}
.product-image-gallery img:hover {
    transform: scale(1.05);
}

.product-description {
    margin-bottom: 20px;
}
.product-description h3 {
    margin-bottom: 10px;
    color: var(--color-black);
}
.product-description p {
    color: #555;
}

.product-reviews-section h3 {
    margin-bottom: 10px;
    color: var(--color-black);
}
.product-reviews-section .review-item {
    background-color: var(--secondary-bg);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}
.product-reviews-section .reviewer-name {
    font-weight: bold;
    color: var(--color-black);
}
.product-reviews-section .review-stars {
    color: var(--star-color);
    margin-bottom: 5px;
}
.product-reviews-section .review-text {
    color: #555;
}

/* Shopping Cart Styling (within overlay) */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.cart-header h2 {
    font-size: 24px;
    color: var(--color-black);
}

.discount-placeholder {
    font-size: 14px;
    color: #888;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 10px; /* For scrollbar */
    margin-bottom: 20px;
}

.empty-cart-message {
    text-align: center;
    color: #888;
    padding: 50px 0;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}
.cart-item:last-child {
    border-bottom: none;
}

.cart-item-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-info h3 {
    font-size: 16px;
    color: var(--color-black);
    margin-bottom: 5px;
}

.cart-item-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--color-purple);
    margin-bottom: 10px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 5px;
}
.quantity-control button {
    width: 30px;
    height: 30px;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.quantity-control button:hover {
    background-color: #e0e0e0;
}
.quantity-control span {
    padding: 0 10px;
    font-size: 16px;
    min-width: 30px;
    text-align: center;
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.total-price {
    display: flex;
    align-items: center;
    font-size: 22px;
    font-weight: bold;
    color: var(--color-black);
}
.total-price input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
}
.total-price label {
    margin-right: 10px;
    cursor: pointer;
}
.total-price span {
    color: var(--color-purple);
}

.btn-checkout {
    background: var(--gradient-bg);
    color: var(--color-white);
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
}
.btn-checkout:hover {
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-header { /* Renamed from .header to match your HTML */
        flex-wrap: wrap;
        padding: 10px;
    }
    .search-bar {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }
    .main-header .logo { /* Renamed from .header to match your HTML */
        flex-basis: auto;
    }
    .header-icons {
        gap: 10px;
    }
    .shop-info {
        flex-direction: column;
        text-align: center;
    }
    .shop-actions {
        margin-top: 15px;
        justify-content: center;
        width: 100%;
    }
    .main-nav-tabs {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    .main-tab-item {
        flex-grow: unset;
        width: calc(33% - 10px); /* For 3 items in a row */
        padding: 10px 15px;
        font-size: 15px;
    }
    .product-sub-tabs {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    .sub-tab-item {
        padding: 10px 15px;
        font-size: 15px;
    }
    .sub-tab-item-price-sort .sub-tab-item {
        padding: 10px 8px;
    }
    .display-style-selector {
        margin-left: unset;
        width: 100%;
        text-align: center;
    }
    .product-listing {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .overlay-content {
        width: 95%;
        margin: 20px;
    }
    .product-detail-content {
        padding: 20px;
    }
    .cart-content {
        padding: 15px;
    }
    .product-detail-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .product-detail-actions .shop-chat-btns {
        display: flex;
        justify-content: space-around;
        width: 100%;
        margin-bottom: 10px;
    }
    .product-detail-actions .shop-chat-btns button {
        flex-grow: 1;
    }
    .product-detail-actions .add-to-cart-btn,
    .product-detail-actions .buy-now-btn {
        width: 100%;
    }
    .product-image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    .cart-summary {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    .btn-checkout {
        width: 100%;
    }
    .category-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
    }
}
/* Styling for Product Listing - List View */
/* When .product-listing has .list-view class */
.product-listing.list-view {
    display: flex; /* Change to flexbox for list layout */
    flex-direction: column; /* Stack items vertically */
    gap: 15px; /* Space between list items */
}

.product-listing.list-view .product-card {
    flex-direction: row; /* Arrange image and info horizontally */
    align-items: flex-start; /* Align items to the top */
    padding: 15px; /* Add padding to list items */
    border-radius: 8px; /* Maintain rounded corners */
    background-color: var(--color-white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.08); /* Lighter shadow for list items */
    transition: all 0.2s ease; /* Smooth transition */
}

.product-listing.list-view .product-card:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.12); /* Slightly stronger shadow on hover */
    transform: translateY(0); /* No vertical lift on hover for list items */
}

.product-listing.list-view .product-card img {
    width: 120px; /* Smaller image for list view */
    height: 120px;
    object-fit: cover;
    border-radius: 5px; /* Rounded corners for image */
    margin-right: 15px; /* Space between image and info */
    flex-shrink: 0; /* Prevent image from shrinking */
}

.product-listing.list-view .product-card-info {
    flex-grow: 1;
    padding: 0; /* Remove internal padding if already handled by product-card */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
}

.product-listing.list-view .product-card-title {
    font-size: 18px; /* Slightly larger title for list view */
    margin-bottom: 5px;
    min-height: unset; /* Remove fixed height constraint */
    -webkit-line-clamp: unset; /* Allow full title to show */
}

.product-listing.list-view .product-card-price {
    font-size: 22px; /* Prominent price */
    margin-bottom: 10px;
}

.product-listing.list-view .product-card .btn-buy {
    width: auto; /* Allow button to size naturally */
    padding: 8px 20px; /* Adjust padding */
    align-self: flex-start; /* Align button to start */
    margin-top: 10px; /* Space above button */
}

/* Responsive adjustments for list view on smaller screens */
@media (max-width: 600px) {
    .product-listing.list-view .product-card {
        flex-direction: column; /* Stack image and info vertically again on small mobile */
        align-items: center; /* Center items */
        text-align: center;
    }
    .product-listing.list-view .product-card img {
        margin-right: 0; /* Remove margin */
        margin-bottom: 10px; /* Add margin below image */
        width: 150px; /* Slightly larger image on small mobile */
        height: 150px;
    }
    .product-listing.list-view .product-card .btn-buy {
        width: 100%; /* Full width button on small mobile */
    }
}
/* Shop Reviews List Styling (for shop_reviews.php output - No Images Version) */
.shop-reviews-list-area {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color); /* Separator from summary */
}

.review-item-display {
    background-color: var(--color-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    overflow: hidden; /* Clear floats / contain children */
}

.review-item-display:last-child {
    margin-bottom: 0; /* No margin for the last review */
}

.review-item-display .reviewer-info-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    position: relative; /* For more-options-btn positioning */
}

.review-item-display .reviewer-avatar {
    width: 48px; /* Larger avatar as per example */
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    flex-shrink: 0; /* Prevent shrinking */
}

.review-item-display .reviewer-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow details to take available space */
}

.review-item-display .reviewer-name {
    font-weight: bold;
    color: var(--color-black);
    font-size: 16px;
    line-height: 1.2;
}

.review-item-display .review-meta {
    font-size: 13px; /* Smaller meta info */
    color: #777;
    display: flex;
    align-items: center;
    gap: 4px; /* Space between stars and date */
}
.review-item-display .review-stars-display {
    color: var(--star-color);
}
.review-item-display .review-stars-display .fas.fa-star,
.review-item-display .review-stars-display .fas.fa-star-half-alt,
.review-item-display .review-stars-display .far.fa-star {
    font-size: 13px; /* Match meta font size */
}

.review-item-display .more-options-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 5px; /* Add padding for easier click */
    border-radius: 50%; /* Make it circular */
    transition: background-color 0.2s ease;
    flex-shrink: 0; /* Prevent shrinking */
}
.review-item-display .more-options-btn:hover {
    background-color: var(--border-color);
}


.review-item-display .review-text-display {
    font-size: 15px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 15px;
}

/* Review Images Container (Left for future use, but won't be displayed for now) */
/*
.review-images-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 15px;
}
@media (max-width: 480px) {
    .review-images-container {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    }
}
.review-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
    border-radius: 6px;
}
.review-image-wrapper .review-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}
.review-image-wrapper .image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--color-white);
    font-size: 24px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
}
*/

/* Review Actions Footer (Like/Share buttons) */
.review-actions-footer {
    display: flex;
    justify-content: flex-end; /* Align buttons to the right */
    gap: 15px;
    padding-top: 10px; /* Space from images/text */
    border-top: 1px solid var(--border-color); /* Separator line */
    margin-top: 10px;
}

.review-actions-footer .review-action-btn {
    background: none;
    border: none;
    color: #777;
    font-size: 14px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.review-actions-footer .review-action-btn:hover {
    background-color: var(--secondary-bg);
    color: var(--color-blue);
}
.review-actions-footer .review-action-btn i {
    margin-right: 5px;
}

/* Adjustments for buttons in product detail actions */
@media (max-width: 600px) {
    .product-detail-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .product-detail-actions .shop-chat-btns {
        width: 100%;
        margin-bottom: 10px;
    }
    .product-detail-actions .shop-chat-btns button {
        flex-grow: 1;
    }
    .product-detail-actions .add-to-cart-btn,
    .product-detail-actions .buy-now-btn {
        width: 100%;
        margin-top: 10px;
    }
    .product-detail-actions .product-detail-price {
        margin-bottom: 10px;
        text-align: center;
    }
}
/* Styling for Login Pop-up (login-overlay) */
.login-content {
    width: 90%;
    max-width: 420px; /* Adjusted slightly wider for better input feel */
    padding: 40px 30px; /* More vertical padding for balanced look */
    text-align: center;
    border-radius: 12px; /* More rounded corners */
    box-shadow: 0 8px 25px rgba(0,0,0,0.2); /* Stronger, softer shadow */
    background-color: var(--color-white); /* Ensure white background */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center content horizontally */
}

.login-content .close-btn { /* Reposition close button to top-right of the modal */
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 32px; /* Larger close icon */
    color: #999;
    transition: color 0.2s ease;
}
.login-content .close-btn:hover {
    color: #333;
}

.login-content h2 {
    font-size: 28px; /* Larger, more prominent title */
    color: var(--color-black);
    margin-bottom: 25px; /* More space below title */
    padding-bottom: 15px; /* More padding below text */
    border-bottom: 2px solid var(--border-color); /* Thicker border */
    width: 100%; /* Ensure border spans full width */
}

.login-form {
    width: 100%; /* Ensure form takes full width */
}

.login-form .form-group {
    margin-bottom: 20px; /* More space between form groups */
    text-align: left;
}

.login-form .form-group label {
    display: block;
    font-size: 16px; /* Slightly larger label font */
    color: var(--text-color);
    margin-bottom: 8px; /* More space between label and input */
    font-weight: 600; /* Bolder label */
}

.login-form .form-group input[type="text"],
.login-form .form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px; /* More padding inside input */
    border: 1px solid var(--border-color);
    border-radius: 8px; /* More rounded input fields */
    font-size: 17px; /* Larger input text */
    color: var(--text-color);
    background-color: var(--secondary-bg); /* Light grey background for input */
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form .form-group input[type="text"]:focus,
.login-form .form-group input[type="password"]:focus {
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3); /* Stronger blue shadow on focus */
}

.login-form .btn-primary {
    background: var(--gradient-bg); /* Use gradient for primary button */
    color: var(--color-white);
    padding: 15px 30px; /* More padding for a bigger button */
    border-radius: 10px; /* More rounded button */
    font-size: 20px; /* Larger button text */
    font-weight: bold;
    cursor: pointer;
    border: none;
    width: 100%;
    margin-top: 25px; /* More space above button */
    transition: opacity 0.3s ease, transform 0.2s ease;
    letter-spacing: 0.5px; /* Slightly more spaced letters */
}

.login-form .btn-primary:hover {
    opacity: 0.95; /* Slightly less opacity change for subtler hover */
    transform: translateY(-3px); /* More pronounced lift on hover */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); /* Shadow on hover */
}

.message-text {
    margin-top: 15px; /* More space for messages */
    font-size: 15px; /* Consistent font size */
    color: #e74c3c; /* Red for error messages */
    text-align: center;
    min-height: 20px;
    font-weight: 500;
}
.message-text.success { /* Style for success messages */
    color: #27ae60; /* Green */
}
.message-text.loading { /* Style for loading messages */
    color: #3498db; /* Blue */
}

/* Responsive adjustments for login pop-up */
@media (max-width: 480px) {
    .login-content {
        padding: 30px 20px; /* Reduce padding on very small screens */
        max-width: 95%; /* Adjust max width */
    }
    .login-content h2 {
        font-size: 24px;
    }
    .login-form .form-group input {
        font-size: 15px;
        padding: 10px 12px;
    }
    .login-form .btn-primary {
        font-size: 18px;
        padding: 12px 25px;
    }
}
.message-text {
    margin-top: 10px;
    font-size: 14px;
    color: #e74c3c; /* Red for error messages */
    text-align: center;
    min-height: 20px; /* Reserve space for messages */
}
/* Styling for the new Signup link in Login Pop-up */
.signup-link-container {
    position: relative; /* Make it a positioning context for absolute child */
    width: 100%; /* Take full width of form */
    height: 40px; /* Give it some height for positioning */
    margin-top: 15px; /* Space above the signup link container */
}

.signup-link {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    color: var(--color-blue); /* Theming with primary blue */
    text-decoration: none; /* No underline by default */
    cursor: pointer;
    padding: 5px 10px; /* Padding for clickable area */
    border-radius: 5px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.signup-link:hover {
    color: var(--button-hover-blue); /* Darker blue on hover */
    background-color: var(--secondary-bg); /* Light background on hover */
}

.signup-link::after { /* Optional: subtle underline effect */
    content: '';
    display: block;
    width: 0;
    height: 1px;
    background: var(--color-blue);
    transition: width 0.3s ease;
    margin: auto;
}

.signup-link:hover::after {
    width: 100%;
}
.menu-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 2 คอลัมน์ขึ้นไป, ปรับขนาดได้ */
    gap: 20px; /* ระยะห่างระหว่างเมนู */
    padding: 20px;
}

.product-card {
    /* สไตล์การ์ดแต่ละเมนู */
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.product-card img {
    width: 100%;
    height: 180px; /* หรือตามที่คุณต้องการ */
    object-fit: cover;
}