/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;700&display=swap');

/* --- CSS Variables (Theme Colors) --- */
:root {
    --primary-color: #2e7d32;   /* Green */
    --primary-darker: #1b5e20;  /* Darker Green */
    --secondary-color: #f9a825; /* Yellow/Gold */
    --secondary-darker: #f57f17;/* Darker Yellow */
    --background-color: #f5f5f5;
    --text-color: #333;
    --card-bg-color: #ffffff;
    --footer-bg-color: #263238;
    --footer-text-color: #eceff1;
    --border-color: #ddd;
}

/* --- General Styling --- */
body {
    font-family: 'Sarabun', sans-serif;
    margin: 0;
    line-height: 1.7;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 16px;
}

.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* --- Header --- */
header {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2.5rem 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

header h1 {
    margin: 0;
    font-size: 2.8rem;
    font-weight: 700;
}

header p {
    margin: 0.5rem 0 0;
    font-size: 1.2rem;
    opacity: 0.9;
}

/* --- Navigation Bar --- */
nav {
    background-color: var(--primary-darker);
    padding: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    display: block;
    font-size: 1.1rem;
    font-weight: 400;
    transition: background-color 0.3s, color 0.3s;
    border-radius: 5px;
}

nav ul li a:hover, nav ul li a.active {
    background-color: var(--secondary-color);
    color: #333;
}

/* --- General Card Styling --- */
.card {
    background: var(--card-bg-color);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.12);
}

/* --- Buttons --- */
.button {
    display: inline-block;
    background-color: var(--secondary-color);
    color: #fff;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s, transform 0.2s;
    border: none;
    cursor: pointer;
    margin-top: 10px;
}

.button:hover {
    background-color: var(--secondary-darker);
    transform: translateY(-2px);
}

.button.secondary {
    background-color: #757575; /* A neutral secondary color */
    margin-top: 8px;
}

.button.secondary:hover {
    background-color: #616161;
}

/* --- Products Page Specific Styling --- */
.category-title {
    text-align: center;
    color: var(--primary-color);
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--secondary-color);
    display: inline-block;
    padding-bottom: 0.5rem;
}

main.text-center, .text-center {
    text-align: center;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    text-align: left;
}

.product-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card h3 {
    min-height: 48px; /* Set a minimum height for titles to align them */
}

.product-card p {
    flex-grow: 1; /* Allow paragraph to take up available space */
}

/* --- Product Detail Pages (E-book, Soap, etc.) --- */
.product-detail h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.book-info {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #fafafa;
    border-left: 5px solid var(--secondary-color);
    border-radius: 0 4px 4px 0;
}
.price .old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 1rem;
    margin-left: 10px;
}
.price .new-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

.table-of-contents {
    list-style: none;
    padding: 0;
}
.table-of-contents li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}
.table-of-contents li span {
    color: #777;
}

/* --- Handmade/Organic Food Product Listing Page Styling --- */
.product-listing {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.product-item {
    display: flex;
    flex-direction: column;
}

.product-item-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: center;
}

@media (min-width: 600px) {
    .product-item-content {
        grid-template-columns: 1fr 2fr; /* Image on left, info on right */
    }
}

.product-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.product-description {
    color: #555;
    font-size: 0.95rem;
}

.product-info .price {
    margin-top: 1rem;
    font-size: 1.2rem;
}

/* --- Payment Zone Styling --- */
.payment-zone {
    margin-top: 2rem;
    border-top: 2px solid var(--border-color);
    padding-top: 1.5rem;
}

.payment-zone h3 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.payment-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

@media (min-width: 768px) {
    .payment-options {
        grid-template-columns: 1fr 1fr;
    }
}

.payment-column {
    text-align: center;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fdfdfd;
}

.payment-column h4 {
    margin-top: 0;
    font-size: 1.2rem;
}

.payment-column p {
    font-size: 0.9rem;
    color: #666;
    min-height: 40px; /* To align text heights */
}

.qr-code {
    max-width: 200px;
    width: 100%;
    height: auto;
    margin: 1rem auto;
    display: block;
    border: 1px solid var(--border-color);
    padding: 5px;
    border-radius: 4px;
}

/* Container for PayPal button to manage its alignment */
#paypal-button-container-ebook,
#paypal-button-container-soap,
#paypal-button-container-shampoo,
#paypal-button-container-salad,
#paypal-button-container-bag1 {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    min-height: 48px; /* reserve space */
}

/* --- Angel & Table Page Styles --- */
.verse-container {
    columns: 2;
    column-gap: 2rem;
}
.verse {
    background: #fff;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
    break-inside: avoid;
}
.verse p { margin-top: 0; }
.verse cite {
    display: block;
    text-align: right;
    font-style: italic;
    color: #555;
}

.table-container {
    overflow-x: auto; /* Makes table responsive */
}
table.c14 {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
table.c14 td, table.c14 th {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    text-align: center;
}
table.c14 a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}
table.c14 a:hover {
    text-decoration: underline;
}
table.c14 tr:nth-of-type(even) {
    background-color: #f8f8f8;
}
table.c14 tr:first-child, table.c14 tr:nth-child(2) {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}
table.c14 tr:nth-child(2) {
    background-color: var(--primary-darker);
}

/* --- Contact Page --- */
.contact-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 768px) {
    .contact-info {
        grid-template-columns: 1fr 1.5fr;
    }
}
address {
    font-style: normal;
}
.map-container {
    position: relative;
    padding-bottom: 75%; /* 4:3 ratio */
    height: 0;
    overflow: hidden;
    width: 100%;
}
.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* --- Footer --- */
footer {
    background-color: var(--footer-bg-color);
    color: var(--footer-text-color);
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    header h1 { font-size: 2.2rem; }
    nav ul { flex-direction: column; text-align: center; }
    .verse-container { columns: 1; }
}

@media (max-width: 480px) {
    header h1 { font-size: 1.8rem; }
    header p { font-size: 1rem; }
    body { font-size: 15px; }
}