/*
Theme Name: LinaPrima
Author: Scotty
Description: Authentic Thai Joy, Delivered via MTR. An e-commerce ready WP theme for the LinaPrima brand.
Version: 1.0.0
Text Domain: linaprima
Requires PHP: 7.4
Requires at least: 6.0
*/

:root {
    --primary-color: #ffc600;
    /* Vibrant Orange */
    --secondary-color: #00a2ff;
    /* Sky Blue */
    --bg-color: #fcfcfc;
    --text-color: #333333;
    --border-radius: 8px;
    /* Round 8 */
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Prompt', sans-serif;
}

/* Base styles enforcing the brand constraints */
.button,
button,
input[type="submit"],
input[type="button"],
input[type="reset"],
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce #respond input#submit.alt,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce-checkout button#place_order,
.wc-block-components-button:not(.is-link) {
    background-color: var(--primary-color) !important;
    color: #111827 !important;
    /* High contrast dark text on vibrant orange */
    border: none;
    border-radius: var(--border-radius) !important;
    padding: 10px 20px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    font-weight: 600;
}

.button:hover,
button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.wc-block-components-button:not(.is-link):hover {
    opacity: 0.9;
}

.secondary-button {
    background-color: var(--secondary-color);
    color: #111827 !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Card and Container styling */
.card,
.widget {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaeaea;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-color);
    font-family: 'Anuphan', sans-serif;
}

a {
    color: #0284c7;
    /* Darker blue for AAA contrast on white backgrounds */
    transition: color 0.3s ease;
}

a:hover {
    color: #0369a1;
    /* Even darker on hover */
}

a:visited {
    color: #6b5300;
}

/* Header — base reset (layout handled by Tailwind in header.php) */
.site-header {
    background: rgba(255, 255, 255, 0.95);
}

.site-title {
    margin: 0;
    font-size: 24px;
}

.site-title a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.lp-announcement-language,
.lp-announcement-language:visited {
    color: #111827 !important;
    text-decoration: none;
}

.lp-announcement-language a,
.lp-announcement-language a:visited {
    color: #111827 !important;
}

.lp-announcement-globe {
    display: block;
    width: 16px;
    height: 16px;
}

.lp-announcement-language select {
    max-width: 132px;
    min-height: 24px;
    border: 1px solid rgba(17, 24, 39, 0.22);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.7);
    color: #111827;
    font-size: 0.75rem;
    font-weight: 700;
	padding: 4px 12px;
}

@keyframes lp-pulse-border {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 162, 255, 0.68), 0 18px 36px rgba(0, 162, 255, 0.28);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(0, 162, 255, 0), 0 18px 44px rgba(0, 162, 255, 0.42);
    }
}

.lp-hero-primary-cta {
    border: 2px solid #bae6fd;
    animation: lp-pulse-border 1.8s ease-in-out infinite;
}

.lp-hero-primary-cta,
.lp-hero-primary-cta:visited,
.lp-hero-primary-cta:hover {
    color: #ffffff !important;
}

.lp-hero-secondary-cta,
.lp-hero-secondary-cta:visited {
    color: #ffffff !important;
}

.lp-hero-secondary-cta:hover {
    color: #111827 !important;
}

@media (prefers-reduced-motion: reduce) {
    .lp-hero-primary-cta {
        animation: none;
    }
}

/* Primary nav — WP injects a <ul> we need to neutralise */
#primary-menu,
#mobile-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Desktop nav items */
#primary-menu li a {
    display: block;
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

#primary-menu li a:hover,
#primary-menu li.current-menu-item > a {
    background-color: #ffc60015;
    color: #6b5300; /* #6b5300 on white = 7.34:1 ✅ */
}

/* Mobile nav items */
#mobile-menu li a {
    display: block;
    padding: 0.625rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s;
}

#mobile-menu li a:hover {
    background-color: #f3f4f6;
    color: var(--text-color);
}

/* Shop category filter */
.lp-product-category-filter {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 0 0 1.25rem;
}

.lp-product-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.lp-product-category-label {
    color: #111827;
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.2;
    margin: 0;
}

.lp-category-collapse {
    display: none;
    background: transparent !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
    border-radius: var(--border-radius) !important;
    padding: 0.45rem 0.75rem !important;
    font-size: 0.82rem;
    font-weight: 700;
}

.lp-product-category-filter.is-expanded .lp-category-collapse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lp-product-category-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem;
}

.lp-category-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 132px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    color: #111827;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.lp-category-card:visited {
    color: #111827;
}

.lp-category-card:hover {
    border-color: #fde68a;
    color: #111827;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
    transform: translateY(-1px);
}

.lp-category-card.is-active {
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(255, 198, 0, 0.28);
}

.lp-category-image {
    display: block;
    aspect-ratio: 4 / 3;
    background: #f3f4f6;
    overflow: hidden;
}

.lp-category-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lp-category-title {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 42px;
    padding: 0.45rem 0.5rem;
    color: #111827;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    overflow-wrap: anywhere;
}

.lp-category-extra {
    display: none;
}

.lp-product-category-filter.is-expanded .lp-category-extra {
    display: flex;
}

.lp-product-category-filter.is-expanded .lp-category-more {
    display: none;
}

.lp-category-more {
    cursor: pointer;
    font-family: inherit;
    padding: 0 !important;
    border: 1px dashed #d1d5db !important;
    background: #fffbeb !important;
    color: #111827 !important;
}

.lp-category-more-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 88px;
    color: #b45309;
    font-size: 1.6rem;
}

.lp-category-sheet {
    display: none;
}

.lp-category-sheet-lock {
    overflow: hidden;
}

@media (max-width: 640px) {
    .lp-product-category-filter {
        padding: 0.8rem;
    }

    .lp-product-category-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .lp-category-card {
        min-height: 96px;
        border-radius: 7px;
    }

    .lp-category-title {
        min-height: 34px;
        padding: 0.3rem;
        font-size: 0.62rem;
        line-height: 1.2;
    }

    .lp-category-more-icon {
        min-height: 62px;
        font-size: 1.25rem;
    }

    .lp-product-category-filter.is-expanded .lp-category-extra {
        display: none;
    }

    .lp-product-category-filter.is-expanded .lp-category-more {
        display: flex;
    }

    .lp-product-category-filter.is-expanded .lp-category-collapse {
        display: none;
    }

    .lp-category-sheet {
        position: fixed;
        inset: 0;
        z-index: 99999;
        display: block;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .lp-category-sheet.is-open {
        pointer-events: auto;
        opacity: 1;
    }

    .lp-category-sheet-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(17, 24, 39, 0.55);
    }

    .lp-category-sheet-panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 82dvh;
        background: #fff;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -12px 30px rgba(17, 24, 39, 0.2);
        transform: translateY(100%);
        transition: transform 0.24s ease;
        overflow: hidden;
    }

    .lp-category-sheet.is-open .lp-category-sheet-panel {
        transform: translateY(0);
    }

    .lp-category-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 1rem;
        border-bottom: 1px solid #f3f4f6;
    }

    .lp-category-sheet-header h3 {
        margin: 0;
        color: #111827;
        font-size: 1rem;
        font-weight: 800;
    }

    .lp-category-sheet-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0 !important;
        border-radius: var(--border-radius) !important;
        background: #f3f4f6 !important;
        color: #111827 !important;
    }

    .lp-category-sheet-list {
        max-height: calc(82dvh - 69px);
        overflow-y: auto;
        padding: 0.5rem 1rem 1rem;
    }

    .lp-category-sheet-item {
        display: grid;
        grid-template-columns: 52px minmax(0, 1fr);
        align-items: center;
        gap: 0.75rem;
        padding: 0.55rem 0;
        border-bottom: 1px solid #f3f4f6;
        color: #111827;
        text-decoration: none;
        font-weight: 700;
        font-size: 0.88rem;
    }

    .lp-category-sheet-item:visited {
        color: #111827;
    }

    .lp-category-sheet-item.is-active {
        color: #6b5300;
    }

    .lp-category-sheet-item img {
        width: 52px;
        height: 52px;
        object-fit: cover;
        border-radius: var(--border-radius);
        background: #f3f4f6;
    }
}

/* Footer */
.site-footer {
    background: #222;
    color: #fff;
    padding: 40px 0;
    margin-top: 60px;
    text-align: center;
}

.site-footer p {
    margin: 0;
}

/* WooCommerce adjustments for LinaPrima */

/* Reset any sidebar-layout floats/widths WooCommerce or WP core may apply */
.woocommerce-page #primary,
.woocommerce-page .content-area,
.woocommerce #primary,
.woocommerce .content-area {
    float: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 1200px !important;
    padding: 40px 20px !important;
    box-sizing: border-box;
    margin-left: auto !important;
    margin-right: auto !important;
}

.woocommerce span.onsale {
    background-color: var(--secondary-color) !important;
    border-radius: var(--border-radius) !important;
}

/* WooCommerce Product Grid Overrides (Shop & Related) */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; /* mobile: 2 col */
    gap: 0.75rem !important;
    margin: 0 !important;
    padding: 0 !important;
}

@media (min-width: 640px) {
    .woocommerce ul.products {
        gap: 1.25rem !important;
    }
}

@media (min-width: 1024px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(4, 1fr) !important; /* desktop: 4 cols */
        gap: 1.5rem !important;
    }
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important;
}

.woocommerce ul.products li.product {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #eaeaea;
    width: 100% !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.woocommerce ul.products li.product:hover {
    box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
    display: block;
    margin-bottom: 0;
}

.woocommerce ul.products li.product img {
    border-radius: 0 !important;
    width: 100% !important;
    height: 200px !important;
    object-fit: cover;
    margin: 0 0 12px 0 !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 16px 8px 16px !important;
    padding: 0 !important;
    line-height: 1.35 !important;
}

.woocommerce ul.products li.product .price {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #92400e !important; /* amber-800: 7.09:1 on white ✅ */
    margin: 0 16px 12px 16px !important;
    padding: 0 !important;
}

/* Add to Cart — full-width prominent CTA */
.woocommerce ul.products li.product .button {
    display: block !important;
    width: calc(100% - 32px) !important;
    margin: auto 16px 16px 16px !important;
    text-align: center !important;
    padding: 10px 16px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    border-radius: var(--border-radius) !important;
    box-shadow: 0 2px 8px rgba(255, 198, 0, 0.35) !important;
    letter-spacing: 0.01em !important;
}

.woocommerce ul.products li.product .button:hover {
    box-shadow: 0 4px 14px rgba(255, 198, 0, 0.55) !important;
    transform: translateY(-1px);
}

/* "View cart →" link that appears after AJAX add-to-cart — outline style */
.woocommerce a.added_to_cart,
.woocommerce ul.products .added_to_cart {
    display: block !important;
    width: calc(100% - 32px) !important;
    margin: 6px 16px 16px 16px !important;
    padding: 9px 16px !important;
    text-align: center !important;
    background: transparent !important;
    color: #92400e !important;
    border: 2px solid #ffc600 !important;
    border-radius: var(--border-radius) !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    box-shadow: none !important;
    transition: background 0.2s, color 0.2s !important;
    letter-spacing: 0.01em !important;
}

.woocommerce a.added_to_cart:hover,
.woocommerce ul.products .added_to_cart:hover {
    background: #ffc600 !important;
    color: #111827 !important;
    opacity: 1 !important;
    transform: none !important;
}

.woocommerce section.related.products h2 {
    margin-bottom: 30px;
    font-size: 2rem;
}

/* ==========================================================================
   Modernized Form Inputs (Tailwind Mimic)
   ========================================================================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
textarea,
select,
.woocommerce form .form-row input.input-text, 
.woocommerce form .form-row textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #111827;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus,
.woocommerce form .form-row input.input-text:focus, 
.woocommerce form .form-row textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 198, 0, 0.3);
}

/* ==========================================================================
   WooCommerce Notices Modernization
   ========================================================================== */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    border: none !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.woocommerce-message::before,
.woocommerce-error::before,
.woocommerce-info::before {
    display: none !important; /* Hide default icons */
}

.woocommerce-message {
    background-color: #ecfdf5;
    color: #065f46;
    border-left: 4px solid #10b981 !important;
}

.woocommerce-error {
    background-color: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #ef4444 !important;
    list-style: none;
}
.woocommerce-error li { margin-left: 0; }

.woocommerce-info {
    background-color: #eff6ff;
    color: #1e40af;
    border-left: 4px solid #3b82f6 !important;
}

.woocommerce-message a.button,
.woocommerce-error a.button,
.woocommerce-info a.button {
    margin-left: auto;
    flex-shrink: 0;
    background-color: transparent !important;
    border-radius: 0.5rem !important;
    padding: 0.5rem 1.25rem !important;
    font-weight: 700 !important;
    font-size: 0.875rem !important;
    transition: background 0.2s, color 0.2s !important;
}
.woocommerce-message a.button {
    color: #065f46 !important;
    border: 2px solid #10b981 !important;
}
.woocommerce-message a.button:hover {
    background: #10b981 !important;
    color: #fff !important;
    opacity: 1 !important;
}
.woocommerce-error a.button {
    color: #991b1b !important;
    border: 2px solid #ef4444 !important;
}
.woocommerce-error a.button:hover {
    background: #ef4444 !important;
    color: #fff !important;
    opacity: 1 !important;
}
.woocommerce-info a.button {
    color: #1e40af !important;
    border: 2px solid #3b82f6 !important;
}
.woocommerce-info a.button:hover {
    background: #3b82f6 !important;
    color: #fff !important;
    opacity: 1 !important;
}

/* ==========================================================================
   WooCommerce Tables Modernization
   ========================================================================== */
.woocommerce table.shop_table {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 2rem;
}

.woocommerce table.shop_table th {
    background-color: #f9fafb;
    color: #374151;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.woocommerce table.shop_table td {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
    background-color: #ffffff;
}

.woocommerce table.shop_table tr:last-child td {
    border-bottom: none;
}

.woocommerce-cart-form__contents .product-thumbnail img {
    border-radius: 0.5rem;
    width: 80px !important;
    height: 80px !important;
    object-fit: cover;
}

/* Tabs & Product Details */
.woocommerce div.product .woocommerce-tabs ul.tabs {
    border-bottom: 2px solid #e5e7eb;
    padding: 0;
    margin: 0 0 2rem 0;
    display: flex;
    gap: 1.5rem;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li {
    border: none;
    background: transparent;
    border-radius: 0;
    margin: 0;
    padding: 0;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
    display: none;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    color: #6b7280;
    font-weight: 600;
    padding: 1rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ==========================================================================
   Checkout — Modern 2-column layout
   ========================================================================== */

/* Hide unused WooCommerce cols */
.woocommerce-checkout .col2-set .col-2,
.woocommerce-checkout .woocommerce-additional-fields {
    display: none !important;
}

/* Narrower page width for checkout — less whitespace */
body.woocommerce-checkout #primary,
body.woocommerce-checkout .content-area {
    max-width: 1040px !important;
    padding: 32px 20px 60px !important;
}

/* ── Two-column grid on desktop ───────────────────────────────────────────── */
@media (min-width: 768px) {
    form.woocommerce-checkout {
        display: grid;
        grid-template-columns: 1fr 360px;
        gap: 2rem;
        align-items: start;
    }
    form.woocommerce-checkout #customer_details {
        grid-column: 1;
        grid-row: 1;
    }
    form.woocommerce-checkout #order_review {
        grid-column: 2;
        grid-row: 1;
        position: sticky;
        top: 1.5rem;
    }
}

/* ── Col-1 (billing) — card shell ────────────────────────────────────────── */
.woocommerce-checkout .col2-set {
    width: 100% !important;
    margin: 0 !important;
}
.woocommerce-checkout .col2-set .col-1 {
    width: 100% !important;
    float: none !important;
    max-width: 100% !important;
    padding: 0 !important;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* ── Billing section heading ─────────────────────────────────────────────── */
.woocommerce-checkout .col2-set .col-1 > h3 {
    display: flex !important;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 !important;
    padding: 0.9rem 1.25rem !important;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    letter-spacing: -0.01em;
}
.woocommerce-checkout .col2-set .col-1 > h3::before {
    content: '1';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    background: #ffc600;
    color: #111827;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

/* ── Billing fields wrapper ──────────────────────────────────────────────── */
.woocommerce-checkout .woocommerce-billing-fields,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper {
    padding: 1.5rem 1.5rem 0.75rem !important;
}
/* Extra elbow room between each field row */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row {
    margin-bottom: 1rem !important;
}

/* ── Order Review — card shell ───────────────────────────────────────────── */
.woocommerce-checkout #order_review {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* ── Order review heading ────────────────────────────────────────────────── */
#order_review_heading {
    display: flex !important;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 !important;
    padding: 0.9rem 1.25rem !important;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    letter-spacing: -0.01em;
}
#order_review_heading::before {
    content: '2';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    background: #00a2ff;
    color: #fff;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

/* ── Order review table — override global shop_table ────────────────────── */
.woocommerce-checkout-review-order-table.shop_table {
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    margin: 0 !important;
    width: 100%;
}
.woocommerce-checkout-review-order-table thead th {
    background: #fafafa !important;
    font-size: 0.68rem !important;
    padding: 0.55rem 1.1rem !important;
    color: #9ca3af !important;
    border-bottom: 1px solid #f3f4f6 !important;
    letter-spacing: 0.06em !important;
}
.woocommerce-checkout-review-order-table .cart_item td {
    padding: 0.8rem 1.1rem !important;
    border-bottom: 1px solid #f3f4f6 !important;
    font-size: 0.875rem !important;
    vertical-align: middle !important;
    background: #fff !important;
}
.woocommerce-checkout-review-order-table .product-name {
    font-weight: 600 !important;
    color: #111827 !important;
}
.woocommerce-checkout-review-order-table .product-name .product-quantity {
    color: #6b7280 !important;
    font-weight: 500 !important;
    font-size: 0.82rem !important;
}
.woocommerce-checkout-review-order-table .product-total {
    text-align: right !important;
    font-weight: 700 !important;
    color: #92400e !important;
    white-space: nowrap !important;
}
/* Subtotal / fee rows */
.woocommerce-checkout-review-order-table .cart-subtotal th,
.woocommerce-checkout-review-order-table .cart-subtotal td,
.woocommerce-checkout-review-order-table .woocommerce-shipping-totals th,
.woocommerce-checkout-review-order-table .woocommerce-shipping-totals td {
    padding: 0.6rem 1.1rem !important;
    font-size: 0.82rem !important;
    color: #6b7280 !important;
    border-bottom: none !important;
    background: #fafafa !important;
}
/* Grand total row */
.woocommerce-checkout-review-order-table .order-total th,
.woocommerce-checkout-review-order-table .order-total td {
    border-top: 2px solid #e5e7eb !important;
    padding: 0.9rem 1.1rem !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: #111827 !important;
    background: #fafafa !important;
    border-bottom: none !important;
}

/* ── Payment section ─────────────────────────────────────────────────────── */
#payment {
    background: transparent !important;
    border-radius: 0 !important;
    border: none !important;
    float: none !important;
}
#payment .wc_payment_methods {
    border: none !important;
    border-top: 1px solid #e5e7eb !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}
/* Each payment method row */
#payment .wc_payment_methods .wc_payment_method {
    border-bottom: 1px solid #f3f4f6 !important;
    background: transparent !important;
    padding: 0 !important;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
#payment .wc_payment_methods .wc_payment_method > label {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.85rem 1.1rem !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    color: #111827 !important;
    margin: 0 !important;
    transition: background 0.15s !important;
    user-select: none !important;
}
#payment .wc_payment_methods .wc_payment_method > label:hover {
    background: #fffbeb !important;
}
/* ── Custom radio button (replaces native appearance) ───────────────────── */
#payment .wc_payment_methods .wc_payment_method input[type="radio"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    border: 2px solid #d1d5db !important;
    border-radius: 50% !important;
    background: #fff !important;
    cursor: pointer !important;
    margin: 0 !important;
    margin-left: 1em !important;
    position: relative !important;
    transition: border-color 0.15s, background 0.15s !important;
    flex-shrink: 0 !important;
}
#payment .wc_payment_methods .wc_payment_method input[type="radio"]:checked {
    border-color: #ffc600 !important;
    background: #fff !important;
    box-shadow: inset 0 0 0 4px #ffc600 !important;
}
#payment .wc_payment_methods .wc_payment_method input[type="radio"]:focus {
    outline: 2px solid #ffc60055 !important;
    outline-offset: 2px !important;
}
/* Payment description box */
#payment .payment_box {
    background: #fffbeb !important;
    border: none !important;
    border-top: 1px solid #fef3c7 !important;
    border-radius: 0 !important;
    padding: 0.7rem 1.1rem 0.7rem 1.1rem !important;
    font-size: 0.82rem !important;
    color: #92400e !important;
    margin: 0 !important;
}
#payment .payment_box p {
    margin: 0 !important;
    line-height: 1.5 !important;
}
#payment .payment_box::before {
    display: none !important;
}

/* ── Alipay QR preview inside checkout payment box ─────────────────────── */
.lp-alipay-qr-checkout {
    text-align: center;
    margin: 0.75rem 0 0.5rem;
}
.lp-alipay-qr-checkout img {
    max-width: 100%;
    width: 400px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    display: inline-block;
}
.lp-alipay-account {
    background: #fafafa;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    margin-top: 0.5rem;
    font-size: 0.82rem;
}
.lp-alipay-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
}
.lp-alipay-row span {
    color: #6b7280;
}
.lp-alipay-row strong {
    color: #111827;
}

/* ── Place order area ────────────────────────────────────────────────────── */
#payment .place-order {
    padding: 1.1rem 1.1rem 1.25rem !important;
    background: #f9fafb !important;
    border-top: 1px solid #e5e7eb !important;
    margin: 0 !important;
}
/* Place order button — full-width, high-impact */
#place_order {
    width: 100% !important;
    padding: 0.95rem 1.5rem !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 16px rgba(255, 198, 0, 0.45) !important;
    transition: box-shadow 0.2s, transform 0.15s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
}
#place_order:hover {
    box-shadow: 0 6px 22px rgba(255, 198, 0, 0.65) !important;
    transform: translateY(-1px) !important;
}
/* Privacy / terms note under button */
#payment .place-order .woocommerce-privacy-policy-text {
    font-size: 0.72rem !important;
    color: #9ca3af !important;
    text-align: center !important;
    margin-top: 0.6rem !important;
    line-height: 1.5 !important;
}
/* Trust badge row under the button */
#payment .place-order::after {
    content: '🔒 ชำระเงินผ่านช่องทางที่ปลอดภัย';
    display: block;
    text-align: center;
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 0.55rem;
    font-weight: 500;
}

/* ==========================================================================
   Mobile / Responsive Overrides
   ========================================================================== */

/* ── WooCommerce page padding ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .woocommerce-page #primary,
    .woocommerce-page .content-area,
    .woocommerce #primary,
    .woocommerce .content-area {
        padding: 20px 16px !important;
    }
}

/* ── Product grid: compact 2-col cards on mobile ─────────────────────────── */
@media (max-width: 639px) {
    .woocommerce ul.products li.product img {
        height: 140px !important;
        margin: 0 0 8px 0 !important;
    }
    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 0.8rem !important;
        margin: 0 10px 6px 10px !important;
        /* Clamp to 2 lines */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .woocommerce ul.products li.product .price {
        font-size: 0.88rem !important;
        margin: 0 10px 8px 10px !important;
    }
    .woocommerce ul.products li.product .button {
        width: calc(100% - 20px) !important;
        margin: auto 10px 10px 10px !important;
        padding: 8px 10px !important;
        font-size: 0.8rem !important;
        box-shadow: 0 1px 6px rgba(255, 198, 0, 0.3) !important;
    }
    .woocommerce a.added_to_cart,
    .woocommerce ul.products .added_to_cart {
        width: calc(100% - 20px) !important;
        margin: 4px 10px 10px 10px !important;
        padding: 7px 10px !important;
        font-size: 0.78rem !important;
    }
}

/* ── Cart & order tables: scroll on overflow ─────────────────────────────── */
.woocommerce-cart-form,
.woocommerce-order-details,
.woocommerce-customer-details {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
    .woocommerce table.shop_table th {
        padding: 0.6rem 0.85rem;
        font-size: 0.7rem;
    }
    .woocommerce table.shop_table td {
        padding: 0.85rem;
        font-size: 0.875rem;
    }
    /* Thumbnail size in cart */
    .woocommerce-cart-form__contents .product-thumbnail img {
        width: 56px !important;
        height: 56px !important;
    }
}

/* ── Checkout mobile tweaks ───────────────────────────────────────────────── */
@media (max-width: 767px) {
    body.woocommerce-checkout #primary,
    body.woocommerce-checkout .content-area {
        padding: 16px 4px 48px !important;
    }
    .woocommerce-checkout .col2-set .col-1 {
        border-radius: 0px;
        border: 0px;
        box-shadow: 0 0px 0px rgba(0, 0, 0, 0);
    }
    .woocommerce-checkout #order_review {
        border-radius: 10px;
        margin-top: 1.25rem;
    }
    .woocommerce-checkout .col2-set .col-1 > h3,
    #order_review_heading {
        padding: 0.8rem 1rem !important;
        font-size: 0.85rem !important;
    }
    .woocommerce-checkout .woocommerce-billing-fields,
    .woocommerce-checkout .woocommerce-billing-fields__field-wrapper {
        padding: 0rem !important;
    }
    .woocommerce-checkout-review-order-table thead th {
        padding: 0.5rem 0.9rem !important;
    }
    .woocommerce-checkout-review-order-table .cart_item td {
        padding: 0.7rem 0.9rem !important;
        font-size: 0.82rem !important;
    }
    .woocommerce-checkout-review-order-table .order-total th,
    .woocommerce-checkout-review-order-table .order-total td {
        padding: 0.8rem 0.9rem !important;
        font-size: 0.95rem !important;
    }
    #payment .wc_payment_methods .wc_payment_method > label {
        padding: 0.8rem 0.9rem !important;
        font-size: 0.82rem !important;
    }
    #payment .payment_box {
        padding: 0.6rem 0.9rem 0.6rem 2.25rem !important;
    }
    #payment .place-order {
        padding: 0.9rem !important;
    }
}

/* ── Footer: less top margin on mobile ───────────────────────────────────── */
@media (max-width: 640px) {
    .site-footer {
        margin-top: 32px;
        padding: 28px 0;
    }
}

/* ── WooCommerce notices: stack on mobile ────────────────────────────────── */
@media (max-width: 480px) {
    .woocommerce-message,
    .woocommerce-error,
    .woocommerce-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.85rem 1rem;
    }

    .woocommerce-message a.button,
    .woocommerce-error a.button,
    .woocommerce-info a.button {
        margin-left: 0;
        align-self: flex-end;
    }
}

/* ── Single product: tabs scroll on mobile ───────────────────────────────── */
@media (max-width: 640px) {
    .woocommerce div.product .woocommerce-tabs ul.tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        padding-bottom: 2px;
    }

    .woocommerce div.product .woocommerce-tabs ul.tabs li a {
        white-space: nowrap;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   WooCommerce Block Store Notice (.wc-block-store-notice)
   Fixes: misaligned warning icon, oversized/off-brand close button
   ═══════════════════════════════════════════════════════════════════════════ */

/* Outer wrapper — match theme card style */
.wc-block-store-notice,
.wc-block-components-notice-banner {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.625rem !important;
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    border-radius: 10px !important;
    padding: 0.875rem 1rem !important;
    margin-bottom: 1rem !important;
    font-family: 'Prompt', sans-serif !important;
    font-size: 0.875rem !important;
    color: #92400e !important;
    line-height: 1.55 !important;
}

.wc-block-store-notice.is-error,
.wc-block-components-notice-banner.is-error {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

.wc-block-store-notice.is-info,
.wc-block-components-notice-banner.is-info {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1e40af !important;
}

/* Icon — pin to top, fixed size, no distortion */
.wc-block-store-notice .wc-block-components-notice-banner__icon,
.wc-block-components-notice-banner .wc-block-components-notice-banner__icon,
.wc-block-store-notice svg:first-child,
.wc-block-components-notice-banner svg:first-child {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    flex-shrink: 0 !important;
    margin-top: 2px !important;  /* optical alignment with first line of text */
    color: currentColor !important;
    fill: currentColor !important;
}

/* Text content — fills available space */
.wc-block-store-notice .wc-block-components-notice-banner__content,
.wc-block-components-notice-banner .wc-block-components-notice-banner__content {
    flex: 1 !important;
    min-width: 0 !important;
}
.wc-block-store-notice .wc-block-components-notice-banner__content p,
.wc-block-components-notice-banner .wc-block-components-notice-banner__content p {
    margin: 0 !important;
    font-size: 0.875rem !important;
}

/* Dismiss (×) button — small, subtle, brand-coloured on hover */
.wc-block-store-notice .wc-block-components-notice-banner__dismiss,
.wc-block-components-notice-banner .wc-block-components-notice-banner__dismiss {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    color: currentColor !important;
    opacity: 0.55 !important;
    transition: opacity 0.15s, background 0.15s !important;
    box-shadow: none !important;
}
.wc-block-store-notice .wc-block-components-notice-banner__dismiss:hover,
.wc-block-components-notice-banner .wc-block-components-notice-banner__dismiss:hover {
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.06) !important;
}
.wc-block-store-notice .wc-block-components-notice-banner__dismiss svg,
.wc-block-components-notice-banner .wc-block-components-notice-banner__dismiss svg {
    width: 14px !important;
    height: 14px !important;
    pointer-events: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Policy Notice Components (.lp-policy-notice)
   Used on: cart, checkout, and thank-you pages
   ═══════════════════════════════════════════════════════════════════════════ */

.lp-policy-notice {
    border-radius: 12px;
    padding: 1rem 1.125rem;
    margin-bottom: 1.25rem;
    font-family: 'Prompt', sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ── Header row (icon + title + optional sub-label) ─────────────────────── */
.lp-pn-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.lp-pn-header strong {
    font-weight: 700;
    font-size: 0.9rem;
}

.lp-pn-icon {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

.lp-pn-sub {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-left: auto;
}

/* ── Body paragraph ─────────────────────────────────────────────────────── */
.lp-pn-body {
    margin: 0.25rem 0 0;
    color: inherit;
    opacity: 0.9;
}

/* ── Row list (pickup summary) ──────────────────────────────────────────── */
.lp-pn-rows {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0.5rem 0;
}

.lp-pn-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.lp-pn-label {
    min-width: 130px;
    font-weight: 600;
    flex-shrink: 0;
    opacity: 0.85;
}

.lp-pn-val {
    font-weight: 500;
}

.lp-pn-footer {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid currentColor;
    opacity: 0.6;
    font-size: 0.8rem;
}

/* ── Date policy notice (blue) ──────────────────────────────────────────── */
.lp-date-notice {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* ── Minimum order — unmet (amber) ─────────────────────────────────────── */
.lp-min-order-notice.lp-pn-unmet {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

/* ── Minimum order — met (green) ────────────────────────────────────────── */
.lp-min-order-notice.lp-pn-met {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* ── Progress bar ───────────────────────────────────────────────────────── */
.lp-min-progress {
    height: 8px;
    background: #fde68a;
    border-radius: 999px;
    overflow: hidden;
    margin: 0.6rem 0 0.3rem;
}

.lp-min-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffc600, #f59e0b);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.lp-min-label {
    font-size: 0.78rem;
    text-align: right;
    opacity: 0.7;
    margin-bottom: 0.1rem;
}

/* ── Pickup summary on thank-you page (green) ───────────────────────────── */
.lp-pickup-summary {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* ── Mobile: compact padding ────────────────────────────────────────────── */
@media (max-width: 640px) {
    .lp-policy-notice {
        padding: 0.875rem 1rem;
        font-size: 0.82rem;
    }

    .lp-pn-label {
        min-width: 110px;
    }
}
