/*
Theme Name: pommchu-theme
Theme URI: https://pommchu.net/
Author: Your Name
Author URI: https://your-website.com/
Description: A custom WordPress theme for the pommchu.net site.
Version: 1.5.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: custom-background, post-formats, theme-options, translation-ready, accessibility-ready, blog, portfolio
Text Domain: pommchutheme
*/

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* --- General & Core Layout --- */
body {
    background-color: #FDF5E6;
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    color: #795548;
    margin: 0;
    padding: 20px;
}

#container {
    position: relative;
    display: flex;
    flex-direction: column;
    max-width: 1300px;
    margin: 0 auto;
    background-color: #FFFCF5;
    border: 8px solid #F5D76E;
    padding: 15px;
    box-shadow: 10px 10px 0px #F39C12;
    border-radius: 20px;
    min-height: 600px;
}

a {
    color: #E67E22;
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: #D35400;
}

/* --- Header & Logo --- */
.site-header {
    text-align: center;
    margin-bottom: 20px;
    margin-top: 20px;
}
.site-title a, .site-logo {
    font-family: 'Righteous', cursive;
    font-size: 80px;
    color: #F39C12;
    text-shadow: 3px 3px 0 #4CAF50, 6px 6px 0 #E67E22;
    margin: auto;
    text-decoration: none;
    display: inline-block;
}
.custom-logo-link img {
    max-width: 600px;
    height: auto;
}

/* --- Navigation Menu --- */
.main-navigation {
    width: 100%;
    text-align: right;
}
#primary-menu {
    margin: 0;
    padding: 0;
    list-style: none;
    display: inline-block;
}
#primary-menu li {
    display: inline-block;
    margin: 0 5px;
}
#primary-menu a {
    font-family: 'Righteous', cursive;
    font-size: 22px;
    color: #8D6E63;
    background-color: #F9E79F;
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid #F5D76E;
    box-shadow: 3px 3px 0px #F39C12;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    display: block;
}
#primary-menu a:hover,
#primary-menu .current-menu-item > a {
    background-color: #FFFCF5;
    color: #D35400;
    box-shadow: 1px 1px 0px #F39C12;
    transform: translate(2px, 2px);
}

/* --- Sub-Menu Dropdown Styles --- */
#primary-menu li {
    position: relative; /* Required for sub-menu positioning */
}

#primary-menu ul.sub-menu {
    display: none; /* Hide sub-menus by default */
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #FFFCF5;
    border: 2px solid #F5D76E;
    border-radius: 10px;
    box-shadow: 3px 3px 5px rgba(0,0,0,0.1);
    padding: 10px 0;
    min-width: 200px;
    z-index: 1000;
    list-style: none;
}

#primary-menu li:hover > ul.sub-menu {
    display: block; /* Show on hover */
}

#primary-menu ul.sub-menu li {
    display: block; /* Stack items vertically */
    margin: 0;
    width: 100%;
}

#primary-menu ul.sub-menu a {
    padding: 10px 15px;
    font-size: 18px;
    background-color: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    text-align: left;
    color: #8D6E63;
}

#primary-menu ul.sub-menu a:hover {
    background-color: #F9E79F;
    color: #D35400;
    transform: none; /* Reset transform from parent link */
    box-shadow: none; /* Reset box-shadow from parent link */
}

/* Add a dropdown indicator arrow */
#primary-menu .menu-item-has-children > a::after {
    content: ' ▾';
    display: inline-block;
}


/* --- Main Content & Sidebars --- */
.main-area-flex {
    display: flex;
    gap: 20px;
}

#left-sidebar, #right-sidebar {
    width: 250px;
    flex-shrink: 0;
}

#main-post-area {
    flex-grow: 1;
    position: relative;
    background-color: #F1F8E9;
    border: 2px solid #C5E1A5;
    border-radius: 10px;
    padding: 30px; /* Add base padding */
    min-width: 0; /* Prevents overflow in a flex container */
}

/* --- Post Styles (Archive & Single) --- */
.post {
    position: relative;
    margin-bottom: 40px;
}
.post-date {
    position: absolute;
    top: -25px; /* Adjust based on new padding */
    left: -30px;
    background-color: #F39C12;
    padding: 10px 15px;
    text-align: center;
    color: #fff;
    font-weight: 100;
    border-radius: 5px;
    z-index: 5;
    box-shadow: 2px 2px 3px rgba(0,0,0,0.2);
    font-family: 'Righteous', cursive;
}
.post-date::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -8px;
    width: 12px;
    height: 12px;
    background: #FFFCF5;
    border: 2px solid #F39C12;
    border-radius: 50%;
    transform: translateY(-50%);
}

.post-content {
    padding-left: 45px; /* Space for the date banner */
}

.entry-title {
    font-family: 'Righteous', cursive;
    color: #33691E;
    margin-bottom: 10px;
    margin-top: 0;
}
.entry-title a {
    color: #33691E;
    text-decoration: none;
}
.entry-title a:hover {
    color: #4CAF50;
}

.entry-meta {
    font-size: 0.9em;
    color: #8D6E63;
    margin-bottom: 15px;
}
.entry-meta span {
    margin-right: 15px;
}
.meta-category::before {
    content: '☆';
    margin-right: 5px;
}
.meta-comments::before {
    margin-right: 5px;
}
.entry-content ul {
    list-style: none;
    padding-left: 0;
}
.entry-content li {
    margin-bottom: 5px;
    padding-left: 20px;
    position: relative;
}
.entry-content li::before {
    position: absolute;
    left: 0;
    top: -2px;
}

/* Page content on page.php should not have date padding */
.page .post-content {
    padding-left: 0;
}


/* --- Widget Styles --- */
.widget {
    margin-bottom: 20px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background-color: #FFFCF5;
}
.widget-title {
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 2px dotted #ccc;
    font-size: 20px;
    font-family: 'Righteous', cursive;
}
.widget ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.widget ul li {
    margin-bottom: 8px;
    position: relative;
}

/* --- Comments --- */
#comments {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #F9E79F;
}
.comment-list {
    list-style: none;
    padding: 0;
}
.comment-body {
    background-color: #FFFCF5;
    border: 2px solid #F9E79F;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
}
.comment-author .fn {
    font-family: 'Righteous', cursive;
    color: #E67E22;
    font-weight: 100;
    font-style: normal;
}
.comment-metadata a {
    font-size: 12px;
    color: #a08a7e;
    text-decoration: none;
}
#reply-title {
    font-family: 'Righteous', cursive;
    color: #E67E22;
    margin-bottom: 10px;
}
#commentform input,
#commentform textarea {
    width: 100%;
    padding: 8px;
    border: 2px solid #F5D76E;
    border-radius: 5px;
    margin-bottom: 10px;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 16px;
    background-color: #FFFCF5;
}
#commentform input[type="submit"] {
    font-family: 'Righteous', cursive;
    background-color: #fff;
    border: 2px solid #FF8A65;
    color: #BF360C;
    padding: 8px 15px;
    cursor: pointer;
    width: auto;
}

/* --- Footer --- */
.site-footer {
    text-align: center;
    margin-top: 30px;
    font-family: 'Josefin Sans', sans-serif;
    color: #a08a7e;
    font-size: 14px;
}
.site-footer p {
    margin: 5px 0;
}

/* --- WooCommerce Specific Styles --- */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    text-align: center;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-family: 'Righteous', cursive;
    color: #33691E;
    font-size: 1.2em;
}
.woocommerce ul.products li.product .price {
    color: #BF360C;
    font-family: 'Righteous', cursive;
    font-size: 1.1em;
}
.woocommerce .widget_price_filter .price_slider_amount .button {
    font-family: 'Righteous', cursive;
    background-color: #fff;
    border: 2px solid #FF8A65;
    color: #BF360C;
}
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit.alt,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
    font-family: 'Righteous', cursive;
    background-color: #FFCCBC;
    color: #BF360C;
    padding: 10px 20px;
    border: 2px solid #FF8A65;
    box-shadow: 3px 3px 0px #FF8A65;
    transition: all 0.1s ease-in-out;
}
.woocommerce #respond input#submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit.alt:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover {
    background-color: #FBE9E7;
    box-shadow: 1px 1px 0px #FF8A65;
    transform: translate(2px, 2px);
    color: #BF360C;
}

/* --- Homepage Specific Widget Control --- */
/* Hide default widgets only on the homepage */
.home #left-sidebar .widget_pages,
.home #left-sidebar .widget_archive,
.home #left-sidebar .widget_categories,
.home #left-sidebar .widget_meta,
.home #left-sidebar .widget_search,
.home #right-sidebar .widget_pages,
.home #right-sidebar .widget_archive,
.home #right-sidebar .widget_categories,
.home #right-sidebar .widget_meta,
.home #right-sidebar .widget_search {
    display: none;
}

/* --- Product Category Section --- */
.product-categories-section {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background-color: #F9E79F;
    border: 2px dashed #F5D76E;
    border-radius: 10px;
}
.product-categories-section .section-title {
    font-family: 'Righteous', cursive;
    color: #E67E22;
    margin: 0 0 20px 0;
    font-size: 2em;
}
.product-categories-section .category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}
.product-categories-section .category-list a {
    font-family: 'Righteous', cursive;
    font-size: 18px;
    color: #8D6E63;
    background-color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    border: 2px solid #F5D76E;
    box-shadow: 2px 2px 0px #F39C12;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}
.product-categories-section .category-list a:hover,
.product-categories-section .category-list a.active {
    background-color: #FFFCF5;
    color: #D35400;
    box-shadow: 1px 1px 0px #F39C12;
    transform: translate(1px, 1px);
}

.active-filter {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-family: 'Righteous', cursive;
    background-color: #E8F5E9;
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid #A5D6A7;
}
.active-filter span {
    color: #33691E;
}
.clear-filter {
    font-size: 24px;
    font-weight: bold;
    color: #BF360C;
    text-decoration: none;
    line-height: 1;
}
.clear-filter:hover {
    color: #E67E22;
}


/* --- Atomic Age Front Page Products --- */
.front-page-products {
    background-color: #F0EAD6 !important;
    background-image: radial-gradient(#BFB6A1 1px, transparent 1px);
    background-size: 15px 15px;
    border-color: #efd7b3 !important;
}
.front-page-products .page-title {
    font-family: 'Righteous', cursive;
    color: #D2691E;
    text-shadow: 2px 2px 0px #fff, 4px 4px 0px #BF360C;
    font-size: 2.5em;
}
.product-grid {
    display: grid;
    /* This allows the grid items to shrink properly and prevents overflow */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 25px; /* Reduced the gap to fit items better */
}
.product-item {
    background-color: #fff;
    border: 2px dashed #D2691E;
    padding: 15px;
    text-align: center;
    box-shadow: 5px 5px 0px #A99D8B;
    position: relative;
    transition: transform 0.2s ease-in-out;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.product-grid .product-item:nth-child(4n+1) { transform: rotate(-2deg); }
.product-grid .product-item:nth-child(4n+2) { transform: rotate(1deg); }
.product-grid .product-item:nth-child(4n+3) { transform: rotate(3deg); }
.product-grid .product-item:nth-child(4n+4) { transform: rotate(-1deg); }
.product-item:hover {
    transform: rotate(0) scale(1.05);
    z-index: 10;
}
.product-title {
    font-family: 'Righteous', cursive;
    color: #33691E;
    font-size: 1.4em;
    margin: 10px 0;
}
.product-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0; /* Prevents flex item from overflowing its container */
}
.product-image-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 0;
}
.product-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.product-price-tag {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #FFD700;
    color: #BF360C;
    font-family: 'Righteous', cursive;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    font-size: 1.2em;
    padding-top: 5px; /* Adjust text position in star */
}
.product-price-tag .price,
.product-price-tag .woocommerce-Price-amount.amount {
    font-size: 0.9em; /* Reduced font size to accommodate longer prices */
    color: #BF360C;
    position: relative;
    bottom: 4px;
    line-height: 1; /* Helps with vertical centering */
}
.product-add-to-cart .button {
    background-color: #008080 !important; /* Teal */
    color: #fff !important;
    border: 2px outset #38A8A8 !important;
    border-radius: 5px;
    box-shadow: none !important;
    padding: 3px;
    text-shadow: 1px 1px 1px #000;
}
.product-add-to-cart .button:hover {
    background-color: #38A8A8 !important;
    transform: none !important;
}

.pagination-container {
    text-align: center;
    margin-top: 40px;
}
.pagination-container a, .pagination-container span {
    font-family: 'Righteous', cursive;
    background-color: #fff;
    border: 2px solid #A99D8B;
    padding: 8px 15px;
    margin: 0 5px;
    text-decoration: none;
    color: #D2691E;
    border-radius: 5px;
}
.pagination-container span.current,
.pagination-container a:hover {
    background-color: #D2691E;
    color: #fff;
}

/* --- Single Product Page Styles --- */
/* The .single-product class is added by WordPress to the body tag of product pages */
.single-product #main-post-area {
    background-color: #FFFCF5; /* Match the main container background for a cleaner look */
    border: none;
}

.single-product div.product {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 40px;
    align-items: start;
}

.single-product .woocommerce-product-gallery {
    width: 100%;
    cursor: pointer;
}

.single-product .summary.entry-summary {
    width: 100%;
}

.single-product .product_title {
    font-family: 'Righteous', cursive;
    color: #33691E;
    font-size: 1.5em;
    margin-bottom: 15px;
    text-align: left;
}

.summary.entry-summary {
    width: 75%;
}

.woocommerce #content div.product div.images, .woocommerce div.product div.images, .woocommerce-page #content div.product div.images, .woocommerce-page div.product div.images {
    width: 100%;
}

.woocommerce #content div.product div.summary, .woocommerce div.product div.summary, .woocommerce-page #content div.product div.summary, .woocommerce-page div.product div.summary {
    width: 75%;
}

.single-product .woocommerce-product-details__short-description {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: left;
}

.single-product p.price {
    font-family: 'Righteous', cursive;
    color: #BF360C;
    font-size: 2em;
    margin-bottom: 20px;
    text-align: left;
}

.single-product form.cart {
    background-color: #F9E79F;
    border: 2px dashed #F5D76E;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 0;
}

.single-product form.cart .variations {
    margin-bottom: 20px;
    border-collapse: collapse;
    width: 100%;
}

.single-product form.cart .variations td,
.single-product form.cart .variations th {
    padding: 10px 0;
    border: none;
    text-align: left;
}

.single-product form.cart .variations label {
    font-family: 'Righteous', cursive;
    font-size: 1.2em;
    color: #8D6E63;
}

.single-product form.cart .variations select {
    width: 100%;
    padding: 8px;
    border: 2px solid #F5D76E;
    border-radius: 5px;
    font-size: 1em;
}

/* --- WooCommerce Quantity Buttons --- */
/* Use a more specific selector to override default WooCommerce styles */
.woocommerce div.product form.cart .quantity {
    display: inline-flex;
    align-items: center;
    border: 2px solid #E0D6C3; /* A softer brown border to match image */
    border-radius: 8px;
    margin-right: 15px;
    background-color: #F8F5F0; /* Light beige background */
    overflow: hidden;
    vertical-align: top; /* Align with add to cart button */
    height: 48px; /* Match add to cart button height */
}

.woocommerce div.product form.cart .variations {
    margin-bottom: -10px;
}

.woocommerce div.product form.cart .quantity .qty {
    width: 50px;
    height: 100%;
    text-align: center;
    border: none;
    background-color: transparent;
    font-family: 'Righteous', cursive;
    color: #795548;
    font-size: 1.2em;
    -moz-appearance: textfield;
}
.woocommerce div.product form.cart .quantity .qty::-webkit-outer-spin-button,
.woocommerce div.product form.cart .quantity .qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.woocommerce div.product form.cart .quantity .quantity-button {
    background-color: transparent;
    border: none;
    color: #A99D8B;
    cursor: pointer;
    font-size: 24px;
    font-weight: normal;
    width: 40px;
    height: 100%;
    line-height: 44px;
}
.woocommerce div.product form.cart .quantity .quantity-button.minus {
    border-right: 2px solid #E0D6C3;
}
.woocommerce div.product form.cart .quantity .quantity-button.plus {
    border-left: 2px solid #E0D6C3;
}
.woocommerce div.product form.cart .quantity .quantity-button:hover {
    background-color: #EFEAE1;
}

.single-product .single_add_to_cart_button {
    width: auto;
    font-size: 1.2em !important;
    padding: 15px !important;
    height: 48px;
    vertical-align: top;
}

/* --- WooCommerce Breadcrumbs --- */
.woocommerce .woocommerce-breadcrumb {
    font-family: 'Josefin Sans', sans-serif;
    color: #a08a7e;
    margin: 0 0 20px 0;
    font-size: 0.9em;
    padding-bottom: 15px;
    border-bottom: 2px dotted #F5D76E;
}
.woocommerce-breadcrumb a {
    color: #E67E22;
}
.woocommerce-breadcrumb a:hover {
    color: #D35400;
}

/* --- WooCommerce Alerts --- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    background-color: #F9E79F !important;
    border-top-color: #F39C12 !important;
    color: #8D6E63 !important;
    font-family: 'Righteous', cursive;
    padding: 1em 2em 1em 3.5em !important;
    border-radius: 10px;
    box-shadow: 3px 3px 0px #F39C12;
}
.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
    color: #fff !important;
    background-color: #F39C12;
    padding: 5px;
    border-radius: 50%;
    top: 1.2em !important;
    left: 1em !important;
    box-shadow: 2px 2px 0px #E67E22;
}
.woocommerce-error {
    background-color: #FFCCBC !important;
    border-top-color: #BF360C !important;
    color: #BF360C !important;
}
.woocommerce-error::before {
    background-color: #BF360C;
    box-shadow: 2px 2px 0px #FF8A65;
}

/* --- WooCommerce Cart Page --- */
.woocommerce-cart #main-post-area {
    background-color: #FFFCF5;
    border: none;
}
.woocommerce-cart-form {
    background-color: #E8F5E9;
    border: 2px dashed #A5D6A7;
    padding: 20px;
    border-radius: 10px;
}
.woocommerce-cart-form table.shop_table {
    border: none;
    border-radius: 0;
    margin-bottom: 2em;
}
.woocommerce-cart-form th {
    font-family: 'Righteous', cursive;
    color: #33691E;
    font-size: 1.2em;
    border-bottom: 2px dotted #A5D6A7;
}
.woocommerce-cart-form td {
    border-bottom: 1px solid #C5E1A5;
}
.woocommerce-cart-form .product-thumbnail img {
    width: 80px;
    border: 2px solid #C5E1A5;
    border-radius: 5px;
}
.woocommerce-cart-form .product-remove a {
    color: #BF360C !important;
    font-size: 1.5em;
    font-weight: bold;
}
.woocommerce-cart .cart-collaterals .cart_totals {
    background-color: #F9E79F;
    border: 2px dashed #F5D76E;
    padding: 20px;
    border-radius: 10px;
}
.woocommerce-cart .cart-collaterals h2 {
    font-family: 'Righteous', cursive;
    color: #E67E22;
}

/* --- Custom Lightbox Styles --- */
#pommchu-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(45, 35, 25, 0.85);
    z-index: 9998;
    cursor: pointer;
}
#pommchu-lightbox-container {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    z-index: 9999;
}
#pommchu-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    border: 8px solid #FFFCF5;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}
#pommchu-lightbox-close {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 40px;
    height: 40px;
    background-color: #FFFCF5;
    color: #BF360C;
    border: 2px solid #F5D76E;
    border-radius: 50%;
    font-size: 24px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    font-family: 'Righteous', cursive;
    box-shadow: 2px 2px 0 #F39C12;
}


/*
==============================================
--- Responsive Styles ---
==============================================
*/

/* --- Tablet & Smaller Desktop (up to 950px) --- */
@media (max-width: 950px) {
    body {
        padding: 10px;
    }
    #container {
        padding: 10px;
        min-height: 0;
    }
    .site-title a, .custom-logo-link img {
        font-size: 40px;
        max-width: 80%;
    }
    .main-area-flex {
        flex-direction: column;
    }
    #left-sidebar, #right-sidebar {
        width: 100%;
    }
    
    /* --- Mobile Navigation Fixes --- */
    .main-navigation {
        text-align: center; /* Center the nav container */
    }
    #primary-menu {
        display: block; /* Make the ul a block to stack items */
        width: 100%;
    }
    #primary-menu li {
        display: block;
        margin: 5px 0; /* Reduced margin */
        position: static; /* Reset position for mobile */
    }
    /* FIX: Make nav buttons smaller on mobile */
    #primary-menu a {
        padding: 8px 15px;
        font-size: 20px;
    }


    /* --- Mobile Sub-Menu Styles --- */
    #primary-menu ul.sub-menu {
        display: block; /* Always show sub-menus on mobile */
        position: static; /* Not absolute on mobile */
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 10px 0 0 20px; /* Indent sub-menu items */
        min-width: auto;
    }
     #primary-menu ul.sub-menu li {
        margin: 5px 0;
    }
    #primary-menu ul.sub-menu a {
        padding: 5px 10px;
        font-size: 18px;
        background-color: #F9E79F;
    }
    /* Hide dropdown indicator on mobile */
    #primary-menu .menu-item-has-children > a::after {
        display: none;
    }

    /* --- Mobile Content Area Fixes --- */
    #main-post-area {
        padding: 15px; /* Reduce padding on mobile */
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for tablets */
        gap: 15px; /* Reduce gap */
    }
}

/* --- Mobile Phone (up to 768px) --- */
@media (max-width: 768px) {
    .site-title a, .custom-logo-link img {
        font-size: 32px; /* Further reduce logo size */
    }
    
    /* Stack product page columns */
    .single-product div.product {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* FIX: Product Grid on Mobile */
    .product-grid {
        grid-template-columns: 1fr; /* 1 column for mobile phones */
    }

    /* FIX: Adjust product item for single column */
    .product-item {
        aspect-ratio: unset; /* Let height be determined by content */
        min-height: 250px;
    }

    /* FIX: Stop the rotation effect on mobile to prevent layout issues */
    .product-grid .product-item:nth-child(4n+1),
    .product-grid .product-item:nth-child(4n+2),
    .product-grid .product-item:nth-child(4n+3),
    .product-grid .product-item:nth-child(4n+4),
    .product-item:hover {
        transform: none;
    }
    
    /* FIX: Reposition price tag to be INSIDE the card */
    .product-price-tag {
        top: 10px;
        right: 10px;
        width: 90px;
        height: 90px;
        font-size: 1em;
    }
    .product-price-tag .price,
    .product-price-tag .woocommerce-Price-amount.amount {
        font-size: 0.8em;
    }

    /* FIX: Responsive WooCommerce Cart Table */
    .woocommerce-cart-form table.shop_table {
        display: block;
        width: 100%;
    }
    .woocommerce-cart-form table.shop_table thead {
        display: none; /* Hide table headers */
    }
    .woocommerce-cart-form table.shop_table tbody,
    .woocommerce-cart-form table.shop_table tr,
    .woocommerce-cart-form table.shop_table td {
        display: block;
        width: 100%;
        text-align: right; /* Align text to the right */
        border: none;
        padding: 5px 0;
    }
    .woocommerce-cart-form table.shop_table td.product-thumbnail {
        text-align: center; /* Center the thumbnail */
    }
    .woocommerce-cart-form table.shop_table td::before {
        content: attr(data-title); /* Use data-title for labels */
        float: left; /* Align labels to the left */
        font-weight: bold;
        margin-right: 10px;
    }
    .woocommerce-cart-form table.shop_table .product-remove a {
        float: right;
    }
    .woocommerce-cart-form table.shop_table .actions {
        text-align: center;
    }
     .woocommerce-cart-form table.shop_table .actions .coupon {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .woocommerce-cart-form table.shop_table .actions .coupon .input-text {
        width: 100%;
        text-align: center;
    }
}
