/*
Theme Name: Malomart Premium WooCommerce Theme
Theme URI: https://malomart.com
Author: Adwenpa AI Software Systems
Description: A high-performance, conversion-optimized WooCommerce theme explicitly tailored for Ghanaian retail markets. Built-in Mobile Money formatting, GhanaPost GPS billing architecture, and lightning-fast retail grids.
Version: 2.0.0
License: GNU General Public License v2 or later
Text Domain: malomart
*/

/* =========================================================================
   Core Styling Baselines
   ========================================================================= */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #1a1a1a;
    background-color: #f8fafc;
    margin: 0;
    padding: 0;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================================================
   Promo Ticker Band (header.php)
   ========================================================================= */
.malomart-ticker-track {
    animation: malomart-ticker-scroll 30s linear infinite;
    width: max-content;
}
.malomart-ticker:hover .malomart-ticker-track {
    animation-play-state: paused;
}
@keyframes malomart-ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* =========================================================================
   Voice Search Active State (header.php)
   ========================================================================= */
.malomart-voice-active {
    animation: malomart-pulse 1s ease-in-out infinite;
}
@keyframes malomart-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.55; transform: scale(1.15); }
}

/* =========================================================================
   Masonry Product Grid (archive-product.php)
   ========================================================================= */
ul.products.malomart-masonry {
    columns: 1;
    column-gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
ul.products.malomart-masonry::before,
ul.products.malomart-masonry::after {
    content: none;
}
ul.products.malomart-masonry li.malomart-card {
    display: inline-block;
    width: 100%;
    float: none;
    margin: 0 0 1.5rem 0;
}
@media (min-width: 640px) {
    ul.products.malomart-masonry { columns: 2; }
}
@media (min-width: 1024px) {
    ul.products.malomart-masonry { columns: 3; }
}

/* =========================================================================
   WooCommerce Component Normalization (Tailwind-aligned)
   ========================================================================= */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce .add_to_cart_button,
.woocommerce button.single_add_to_cart_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: #111827;
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 700;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce .add_to_cart_button:hover,
.woocommerce button.single_add_to_cart_button:hover {
    background: #dc2626;
    color: #ffffff;
}
.woocommerce .add_to_cart_button.loading {
    opacity: 0.6;
}
.woocommerce .added_to_cart {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #16a34a;
}

/* Price + sale badge typography inside the loop. */
.woocommerce ul.products li.product .price {
    color: #111827;
}
.woocommerce ul.products li.product .price del {
    color: #9ca3af;
    font-weight: 400;
    margin-right: 0.25rem;
}
.woocommerce ul.products li.product .price ins {
    text-decoration: none;
}

/* Result count + ordering bar. */
.woocommerce-result-count {
    margin: 0;
    font-size: 0.8125rem;
    color: #6b7280;
}
.woocommerce-ordering select {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    background: #fff;
}

/* Pagination. */
.woocommerce nav.woocommerce-pagination ul {
    display: flex;
    gap: 0.5rem;
    border: none;
    margin-top: 1.5rem;
}
.woocommerce nav.woocommerce-pagination ul li {
    border: none;
}
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}
.woocommerce nav.woocommerce-pagination ul li span.current,
.woocommerce nav.woocommerce-pagination ul li a:hover {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

/* Breadcrumbs. */
.woocommerce .woocommerce-breadcrumb {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 1.25rem;
}
.woocommerce .woocommerce-breadcrumb a {
    color: #6b7280;
}
.woocommerce .woocommerce-breadcrumb a:hover {
    color: #dc2626;
}

/* Product search widget form. */
.woocommerce-product-search {
    display: flex;
    gap: 0.5rem;
}
.woocommerce-product-search input.search-field {
    flex: 1;
    min-width: 0;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}
.woocommerce-product-search button[type="submit"] {
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
}
.woocommerce-product-search button[type="submit"]:hover {
    background: #dc2626;
}

/* Notices. */
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-error {
    border-radius: 0.75rem;
    border-top-color: #facc15;
    font-size: 0.8125rem;
}

/* =========================================================================
   Checkout — Billing Panel & MoMo Graphical Radio Cards
   ========================================================================= */
.malomart-checkout .form-row label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4b5563;
}
.malomart-checkout .form-row input.input-text,
.malomart-checkout .form-row select,
.malomart-checkout .form-row textarea {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    width: 100%;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.malomart-checkout .form-row input.input-text:focus,
.malomart-checkout .form-row select:focus,
.malomart-checkout .form-row textarea:focus {
    outline: none;
    border-color: #facc15;
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.25);
}

.malomart-momo-card.malomart-momo-selected {
    border-color: #facc15;
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.35);
}
.malomart-momo-card.malomart-momo-selected::after {
    content: "✓";
    position: absolute;
    top: 0.375rem;
    right: 0.625rem;
    font-size: 0.75rem;
    font-weight: 800;
    color: #16a34a;
}

/* Payment gateway panel. */
.malomart-checkout .wc_payment_methods {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.malomart-checkout .wc_payment_method {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    background: #f9fafb;
}
.malomart-checkout .payment_box {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: #4b5563;
    background: #fff;
    border-radius: 0.5rem;
    padding: 0.75rem;
}
.malomart-checkout #place_order {
    width: 100%;
    margin-top: 1.25rem;
    background: #dc2626;
    color: #fff;
    font-weight: 800;
    font-size: 0.9375rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}
.malomart-checkout #place_order:hover {
    background: #b91c1c;
}

/* =========================================================================
   Homepage Featured Products Strip (front-page.php)
   ========================================================================= */
.malomart-featured-strip ul.products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.malomart-featured-strip ul.products li.product {
    float: none;
    width: auto;
    margin: 0;
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 0.75rem;
    padding: 0.75rem;
}
.malomart-featured-strip ul.products li.product img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}
@media (min-width: 1024px) {
    .malomart-featured-strip ul.products { grid-template-columns: repeat(4, 1fr); }
}

/* =========================================================================
   Layout-specific sizing (replaces unsupported v2 arbitrary utilities)
   ========================================================================= */
#malomart-content {
    min-height: 60vh;
}
.malomart-cart-count {
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
}

/* =========================================================================
   Header Mini-Cart Dropdown (header.php)
   ========================================================================= */
.malomart-mini-cart {
    display: none;
    max-width: calc(100vw - 2rem);
}
.malomart-cart-wrap:hover .malomart-mini-cart,
.malomart-cart-wrap:focus-within .malomart-mini-cart,
.malomart-mini-cart.malomart-open {
    display: block;
}
.malomart-mini-cart ul.woocommerce-mini-cart {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 18rem;
    overflow-y: auto;
}
.malomart-mini-cart li.woocommerce-mini-cart-item {
    position: relative;
    padding: 0.625rem 1.5rem 0.625rem 0;
    border-bottom: 1px solid #f3f4f6;
}
.malomart-mini-cart li.woocommerce-mini-cart-item:last-child {
    border-bottom: none;
}
.malomart-mini-cart li.woocommerce-mini-cart-item > a:not(.remove) {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.25;
}
.malomart-mini-cart li.woocommerce-mini-cart-item > a:not(.remove):hover {
    color: #dc2626;
}
.malomart-mini-cart li.woocommerce-mini-cart-item img {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    object-fit: cover;
    flex-shrink: 0;
    margin: 0;
}
.malomart-mini-cart li.woocommerce-mini-cart-item .quantity,
.malomart-mini-cart li.woocommerce-mini-cart-item dl.variation {
    display: block;
    margin: 0.25rem 0 0 3.75rem;
    font-size: 0.75rem;
    color: #6b7280;
}
.malomart-mini-cart li.woocommerce-mini-cart-item dl.variation dt,
.malomart-mini-cart li.woocommerce-mini-cart-item dl.variation dd {
    display: inline;
    margin: 0;
}
.malomart-mini-cart a.remove {
    position: absolute;
    top: 0.375rem;
    right: 0;
    width: 1.25rem;
    height: 1.25rem;
    line-height: 1.2rem;
    text-align: center;
    border-radius: 9999px;
    color: #dc2626;
    font-weight: 800;
    font-size: 0.875rem;
}
.malomart-mini-cart a.remove:hover {
    background: #dc2626;
    color: #fff;
}
.malomart-mini-cart .woocommerce-mini-cart__total {
    display: flex;
    justify-content: space-between;
    margin: 0.75rem 0 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.875rem;
    font-weight: 700;
    color: #111827;
}
.malomart-mini-cart .woocommerce-mini-cart__buttons {
    display: flex;
    gap: 0.5rem;
    margin: 0.75rem 0 0;
}
.malomart-mini-cart .woocommerce-mini-cart__buttons .button {
    flex: 1;
    margin: 0;
    width: auto;
}
.malomart-mini-cart .woocommerce-mini-cart__buttons .button.checkout {
    background: #dc2626;
}
.malomart-mini-cart .woocommerce-mini-cart__buttons .button.checkout:hover {
    background: #b91c1c;
}
.malomart-mini-cart .woocommerce-mini-cart__empty-message {
    margin: 0;
    padding: 0.75rem 0;
    text-align: center;
    color: #6b7280;
    font-size: 0.8125rem;
}
.malomart-logo .custom-logo {
    max-height: 44px;
    width: auto;
}
.malomart-map-frame {
    min-height: 300px;
}

/* =========================================================================
   Utilities
   ========================================================================= */
.break-inside-avoid {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
.malomart-menu .sub-menu {
    display: none;
    position: absolute;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    padding: 0.5rem 0;
    min-width: 12rem;
    z-index: 60;
}
.malomart-menu li {
    position: relative;
}
.malomart-menu li:hover > .sub-menu,
.malomart-menu li:focus-within > .sub-menu {
    display: block;
}
.malomart-menu .sub-menu a {
    display: block;
    padding: 0.5rem 1rem;
    white-space: nowrap;
}
@media (max-width: 767px) {
    .malomart-menu .sub-menu {
        position: static;
        box-shadow: none;
        padding-left: 1rem;
        display: block;
    }
}
