/* Shop Page Styles */

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.section-title {
    font-size: 28px;
    color: #00B050;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 1px;
}

.section-line {
    flex-grow: 1;
    height: 2px;
    background: linear-gradient(to right, #00B050, transparent);
    opacity: 0.3;
}

.shop-section-desc {
    font-size: 16px;
    color: #666;
    line-height: 1.8;
    max-width: 700px;
    margin-bottom: 40px;
}

.shop-section {
    padding: 40px 0;
}

.shop-layout {
    display: flex;
    gap: 40px;
}

/* Sidebar Styles */
.shop-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.filter-group {
    margin-bottom: 30px;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.filter-group h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 35px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.search-box input:focus {
    outline: none;
    border-color: #2e7d32;
}

.search-box i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    padding: 8px 0;
    cursor: pointer;
    color: #555;
    transition: color 0.3s, padding-left 0.3s;
    border-bottom: 1px solid #eee;
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list li:hover {
    color: #2e7d32;
    padding-left: 5px;
}

.category-list li.active {
    color: #2e7d32;
    font-weight: 600;
}

/* Main Content Styles */
.shop-main {
    flex-grow: 1;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.results-count {
    color: #666;
    font-size: 0.95rem;
}

.sort-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-selector label {
    color: #555;
    font-size: 0.95rem;
}

.sort-selector select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    background-color: white;
}

.sort-selector select:focus {
    outline: none;
    border-color: #2e7d32;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    cursor: pointer;
}

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

.product-image {
    height: 200px;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid #eee;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #2e7d32;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    color: #888;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.product-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.4;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 15px;
    margin-top: auto;
}

.enquire-btn {
    width: 100%;
    padding: 10px;
    background-color: #fff;
    color: #25D366;
    /* WhatsApp Green */
    border: 1px solid #25D366;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    display: block;
    box-sizing: border-box;
    margin-top: auto;
    /* push down if flex */
}

.enquire-btn:hover {
    background-color: #25D366;
    color: white;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 50px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.no-results i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 15px;
}

.no-results h3 {
    margin-bottom: 10px;
    color: #333;
}

.no-results p {
    color: #666;
    margin-bottom: 20px;
}

.btn-primary {
    padding: 10px 20px;
    background-color: #2e7d32;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #1b5e20;
}

/* Product Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    background-color: #fefefe;
    margin: 4% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 860px;
    max-height: 88vh;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(-50px);
    transition: transform 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    color: #333;
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #e53935;
}

.modal-body {
    display: flex;
    flex-wrap: nowrap;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.modal-image {
    flex: 0 0 300px;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-image img {
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: cover;
}

.modal-info {
    flex: 1;
    min-width: 0;
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-category {
    color: #888;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.modal-title {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 15px;
}

.modal-price {
    font-size: 1.4rem;
    color: #2e7d32;
    font-weight: bold;
    margin: 0 0 14px;
}

.enquire-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #fff;
    color: #25D366;
    border: 1.5px solid #25D366;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
    margin-bottom: 18px;
    width: 100%;
    box-sizing: border-box;
}

.enquire-btn:hover {
    background-color: #25D366;
    color: #fff;
}

.modal-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Ingredients Table — 2-column side-by-side layout */
.modal-ingredients {
    margin-bottom: 20px;
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
}

.ingredients-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2e7d32;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.ingredients-columns {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ingredients-table {
    flex: 1;
    width: 0;
    /* force equal flex widths */
    border-collapse: collapse;
    font-size: 0.8rem;
}

.ingredients-table thead th {
    background-color: #2e7d32;
    color: #fff;
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.ingredients-table tbody tr:nth-child(even) {
    background-color: #f1f8f2;
}

.ingredients-table tbody tr:hover {
    background-color: #dceee0;
}

.ingredients-table td {
    padding: 5px 10px;
    color: #444;
    border-bottom: 1px solid #e8e8e8;
}



/* ─── Responsive Design ─────────────────────────────────────── */

/* Tablets & below */
@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Shop layout */
    .shop-layout {
        flex-direction: column;
    }

    .shop-sidebar {
        width: 100%;
    }

    .shop-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .sort-selector {
        width: 100%;
    }

    .sort-selector select {
        flex-grow: 1;
    }

    /* Products grid — 2 columns on tablet */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    /* Modal — stack image above info */
    .modal-content {
        margin: 0;
        width: 100%;
        max-width: 100%;
        max-height: 100dvh;
        border-radius: 0;
        transform: translateY(100px);
    }

    .modal.show .modal-content {
        transform: translateY(0);
    }

    .modal-body {
        flex-direction: column;
        flex-wrap: nowrap;
        overflow-y: auto;
        overflow-x: hidden;
        max-height: 100dvh;
    }

    /* Fixed-height image banner at top */
    .modal-image {
        flex: 0 0 220px;
        width: 100%;
        min-height: 220px;
    }

    .modal-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Info panel — let the parent body scroll, not the panel */
    .modal-info {
        flex: 1;
        overflow-y: visible;
        overflow-x: hidden;
        padding: 20px 16px 30px;
        min-width: 0;
    }

    .modal-title {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }

    .modal-price {
        font-size: 1.2rem;
    }

    /* Ingredients: single column on mobile */
    .ingredients-columns {
        flex-direction: column;
        gap: 8px;
    }

    .ingredients-table {
        width: 100%;
        flex: none;
    }

    /* Close button — keep it clear of notches */
    .close-modal {
        right: 14px;
        top: 12px;
        font-size: 24px;
    }
}

/* Phones — single column grid */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .shop-section-desc {
        font-size: 0.95rem;
    }

    .modal-image {
        flex: 0 0 180px;
        min-height: 180px;
    }
}