/*
Theme Name: Verdant Marketplace
Theme URI: https://example.com/verdant-marketplace
Author: Custom Build
Author URI: https://example.com
Description: Fully custom, mobile-first WooCommerce and Dokan compatible marketplace theme built with PHP and CSS only.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: verdant-marketplace
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/*
==========================================================================
COLOR SYSTEM (EDIT HERE)
==========================================================================
*/
:root {
    --bg-main: #e5efe4;
    --bg-surface: #f4f9f2;
    --bg-strong: #d8e8d4;
    --text-main: #1f2d24;
    --text-soft: #506459;
    --accent-wine: #7a2f3a;
    --accent-wine-soft: #f7ecef;
    --button-green: #1f5a38;
    --button-green-hover: #18492d;
    --border-soft: #c7d8c6;
    --shadow-soft: 0 10px 30px rgba(27, 50, 37, 0.07);
    --radius-md: 0.85rem;
    --radius-lg: 1.2rem;
    --header-height: 84px;
    --container: 1200px;
}

/*
==========================================================================
BASE
==========================================================================
*/
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: "Trebuchet MS", "Segoe UI", "Noto Sans", sans-serif;
    line-height: 1.65;
    padding-top: var(--header-height);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    color: var(--text-main);
    line-height: 1.25;
    font-family: Georgia, "Times New Roman", serif;
}

p {
    margin-top: 0;
}

a {
    color: var(--accent-wine);
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: min(100% - 2rem, var(--container));
    margin-inline: auto;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    clip: auto !important;
    -webkit-clip-path: none;
    clip-path: none;
    background-color: #fff;
    color: #000;
    display: block;
    font-size: 1rem;
    font-weight: 600;
    height: auto;
    left: 1rem;
    line-height: normal;
    padding: 1rem;
    text-decoration: none;
    top: 1rem;
    width: auto;
    z-index: 100000;
}

/*
==========================================================================
HEADER
==========================================================================
*/
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(244, 249, 242, 0.98);
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(6px);
}

.header-inner {
    min-height: var(--header-height);
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    align-items: center;
    padding-block: 0.8rem;
}

.site-branding .custom-logo-link img {
    max-height: 52px;
    width: auto;
}

.site-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-wine);
}

.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.main-nav a {
    display: inline-block;
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    color: var(--text-main);
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.92rem;
    font-weight: 600;
}

.main-nav a:hover,
.main-nav .current-menu-item > a {
    background: var(--accent-wine-soft);
    border-color: #d7aeb7;
    color: var(--accent-wine);
    text-decoration: none;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.header-actions a {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    font-size: 0.88rem;
    font-weight: 700;
}

.header-actions a:hover {
    text-decoration: none;
    border-color: #b9ccb8;
}

/*
==========================================================================
GLOBAL SECTIONS
==========================================================================
*/
.site-main {
    padding-block: 1.25rem 2.5rem;
}

.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 1.2rem;
}

.page-title,
.entry-title {
    margin-bottom: 0.85rem;
    font-size: 1.5rem;
}

.entry-meta {
    margin-bottom: 1rem;
    color: var(--text-soft);
    font-size: 0.92rem;
}

/*
==========================================================================
BUTTONS (EDIT HERE)
==========================================================================
*/
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.button,
.wp-element-button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce #payment #place_order {
    background: var(--button-green) !important;
    color: #fff !important;
    border: 1px solid var(--button-green) !important;
    border-radius: 0.7rem !important;
    font-size: 0.94rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    padding: 0.7rem 1rem !important;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
.button:hover,
.wp-element-button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce #payment #place_order:hover {
    background: var(--button-green-hover) !important;
    border-color: var(--button-green-hover) !important;
    text-decoration: none !important;
}

/*
==========================================================================
FORMS
==========================================================================
*/
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
textarea,
select,
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
    width: 100%;
    background: #ffffff;
    border: 1px solid #baccb9;
    border-radius: 0.7rem;
    color: var(--text-main);
    padding: 0.68rem 0.75rem;
    font-size: 0.95rem;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid rgba(122, 47, 58, 0.2);
    border-color: var(--accent-wine);
}

label {
    display: inline-block;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

/*
==========================================================================
HOME PAGE
==========================================================================
*/
.hero {
    background: linear-gradient(160deg, #f5faf4 0%, #dfebdb 100%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 1.35rem;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
}

.hero p {
    color: var(--text-soft);
    margin-bottom: 1rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.hero-actions .secondary-link {
    display: inline-flex;
    align-items: center;
    border-radius: 0.7rem;
    border: 1px solid #c8b0b5;
    padding: 0.65rem 0.9rem;
    background: #fff;
    color: var(--accent-wine);
    font-weight: 700;
}

.home-section {
    margin-top: 1rem;
}

.home-section h2 {
    margin-bottom: 0.7rem;
    font-size: 1.35rem;
}

.term-grid {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: 1fr;
}

.term-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 0.9rem;
}

.term-card h3 {
    margin-bottom: 0.25rem;
    font-size: 1.05rem;
}

.term-card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

/*
==========================================================================
WOOCOMMERCE
==========================================================================
*/
.vm-commerce-header {
    background: linear-gradient(135deg, #f7fbf6, #e1ecdd);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 1rem 1.2rem;
    margin-bottom: 1.1rem;
}

.vm-commerce-header h1 {
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
}

.vm-commerce-header .term-description,
.vm-commerce-header p {
    color: var(--text-soft);
    margin: 0;
}

.woocommerce ul.products {
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.woocommerce ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
}

.woocommerce ul.products li.product a img {
    border-radius: 0.65rem;
    margin-bottom: 0.6rem !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 1rem !important;
    color: var(--text-main);
}

.woocommerce ul.products li.product .price {
    color: var(--accent-wine) !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
}

.woocommerce div.product {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
}

.woocommerce div.product .product_title {
    font-size: 1.5rem;
}

.woocommerce .woocommerce-breadcrumb {
    font-size: 0.85rem;
    margin: 0 0 0.9rem !important;
    color: var(--text-soft);
}

.woocommerce .cart-collaterals .cart_totals,
.woocommerce-checkout .woocommerce-checkout-review-order,
.woocommerce-checkout .col2-set,
.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content,
.woocommerce .woocommerce-cart-form {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
    margin-bottom: 1rem;
}

.woocommerce table.shop_table {
    border-radius: 0.7rem;
    border-color: var(--border-soft);
}

.woocommerce-info,
.woocommerce-message,
.woocommerce-error {
    border-top-color: var(--accent-wine);
    background: #fff;
}

/*
==========================================================================
DOKAN
==========================================================================
*/
.verdant-vendor-type-field {
    margin-top: 0.7rem;
}

.dokan-dashboard-wrap,
.dokan-dashboard-content {
    background: transparent;
}

.dokan-dashboard-wrap .dokan-dash-sidebar,
.dokan-dashboard-wrap .dokan-dashboard-content article.dashboard-content-area {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.dokan-dashboard-wrap .dokan-dash-sidebar ul.dokan-dashboard-menu li a {
    color: var(--text-main);
    border-bottom: 1px solid #eef3ed;
}

.dokan-dashboard-wrap .dokan-dash-sidebar ul.dokan-dashboard-menu li.active a,
.dokan-dashboard-wrap .dokan-dash-sidebar ul.dokan-dashboard-menu li:hover a {
    background: var(--accent-wine-soft);
    color: var(--accent-wine);
}

.dokan-form-group input,
.dokan-form-group select,
.dokan-form-group textarea {
    border: 1px solid #baccb9 !important;
    border-radius: 0.65rem !important;
}

/*
==========================================================================
POST LISTING + FOOTER
==========================================================================
*/
.post-grid {
    display: grid;
    gap: 0.9rem;
}

.post-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 1rem;
}

.site-footer {
    background: #e0ebdd;
    border-top: 1px solid var(--border-soft);
    padding: 1.4rem 0;
}

.footer-inner {
    display: grid;
    gap: 0.8rem;
}

.footer-menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.footer-menu a {
    color: var(--text-main);
    font-weight: 600;
}

.footer-copy {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

/*
==========================================================================
RESPONSIVE
==========================================================================
*/
@media (min-width: 680px) {
    .term-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 880px) {
    .header-inner {
        grid-template-columns: auto 1fr auto;
        gap: 1rem;
    }

    .main-nav {
        justify-self: center;
    }

    .hero {
        padding: 2.2rem;
        margin-bottom: 1.2rem;
    }

    .hero h1 {
        font-size: 2.3rem;
    }

    .term-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .woocommerce ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1080px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
/*
==========================================================================
HEADER EXTENSION (WALMART-STYLE MOBILE) - FIXED
==========================================================================
*/

.site-header {
    background: rgba(244, 249, 242, 0.99);
}

/* MAIN HEADER BAR */
.vm-topbar {
    min-height: var(--header-height);

    /* FIX: grid → flex for perfect alignment */
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;
    padding-block: 0.55rem;
}

/* LEFT SIDE (MENU + LOGO) */
.vm-left-pack {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

/* MENU BUTTON */
.vm-menu-toggle {
    width: 38px;
    height: 38px;
    border-radius: 0.55rem;
    border: 1px solid var(--border-soft);
    background: #ffffff;
    color: var(--text-main);
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* LOGO */
.site-branding-small {
    display: flex;
    align-items: center;
}

.site-branding-small .custom-logo-link img {
    height: 34px;
    width: auto;
}

.site-branding-small .site-title {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

/* SEARCH (CENTER) */
.vm-header-search {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.vm-header-search input[type="search"] {
    width: 100%;
    max-width: 500px;
    min-width: 0;

    border-radius: 999px;
    border: 1px solid #b6cbb5;
    background: #ffffff;

    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

/* RIGHT SIDE (CART) */
.vm-right-pack {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

/* CART ICON */
.vm-cart-link {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 0.55rem;
    border: 1px solid var(--border-soft);
    background: #ffffff;
    color: var(--text-main);

    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.vm-cart-icon {
    font-size: 1rem;
    line-height: 1;
}

/* CART COUNT BADGE */
.vm-cart-count {
    position: absolute;
    top: -7px;
    right: -7px;

    min-width: 20px;
    height: 20px;

    border-radius: 999px;
    background: var(--accent-wine);
    color: #fff;

    font-size: 0.72rem;
    font-weight: 700;

    display: flex;
    align-items: center;
    justify-content: center;

    padding-inline: 0.25rem;
}

/* DESKTOP HIDDEN BY DEFAULT */
.vm-desktop-nav,
.vm-desktop-actions {
    display: none;
}

/* ===== MOBILE SMALL FIX ===== */
@media (max-width: 480px) {
    .site-branding-small .site-title {
        max-width: 70px;
    }

    .vm-header-search input[type="search"] {
        max-width: 100%;
        padding: 0.55rem 0.8rem;
    }
}

/*
==========================================================================
DRAWER MENU
==========================================================================
*/
.vm-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 997;
    background: rgba(22, 35, 28, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.vm-mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 320px);
    background: #ffffff;
    z-index: 998;
    border-right: 1px solid var(--border-soft);
    box-shadow: 14px 0 40px rgba(25, 45, 33, 0.2);
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    display: flex;
    flex-direction: column;
}

.vm-mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e8f0e6;
    padding: 0.9rem 1rem;
    color: var(--text-main);
}

.vm-drawer-close {
    width: 34px;
    height: 34px;
    border-radius: 0.45rem;
    border: 1px solid #c4d6c3;
    background: #fff;
    color: var(--text-main);
    font-size: 1.25rem;
    line-height: 1;
}

.vm-mobile-drawer-nav {
    padding: 0.9rem 1rem 1.2rem;
    overflow-y: auto;
}

.vm-mobile-drawer-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.vm-mobile-drawer-nav a {
    display: block;
    border: 1px solid #d8e5d5;
    border-radius: 0.6rem;
    padding: 0.6rem 0.72rem;
    color: var(--text-main);
    font-weight: 600;
    background: #f7fbf6;
    text-decoration: none;
}

body.vm-menu-open {
    overflow: hidden;
}

body.vm-menu-open .vm-mobile-drawer {
    transform: translateX(0);
}

body.vm-menu-open .vm-drawer-overlay {
    opacity: 1;
    pointer-events: auto;
}

/*
==========================================================================
REGISTRATION + CHECKOUT EXTENSIONS
==========================================================================
*/
.verdant-register-toggle {
    margin-bottom: 0.7rem;
    padding: 0.75rem;
    border: 1px solid #cad9c7;
    border-radius: 0.7rem;
    background: #ffffff;
}

.verdant-toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.verdant-toggle-row label {
    margin: 0;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.verdant-otp-placeholder {
    margin-top: 0.55rem;
    border: 1px dashed #c7d7c5;
    border-radius: 0.7rem;
    background: #f8fcf7;
    padding: 0.68rem 0.75rem;
}

.verdant-otp-placeholder p {
    margin: 0 0 0.45rem;
    color: var(--text-soft);
    font-size: 0.86rem;
}

.verdant-otp-placeholder input {
    background: #ffffff;
}

/*
==========================================================================
BUY NOW BUTTON COLOR
==========================================================================
*/
.woocommerce a.button.verdant-buy-now-loop,
.woocommerce button.button.verdant-buy-now-single {
    background: var(--accent-wine) !important;
    border-color: var(--accent-wine) !important;
    color: #fff !important;
    margin-left: 0.35rem;
}

.woocommerce a.button.verdant-buy-now-loop:hover,
.woocommerce button.button.verdant-buy-now-single:hover {
    background: #61262f !important;
    border-color: #61262f !important;
}

/*
==========================================================================
RESPONSIVE EXTENSION
==========================================================================
*/
@media (min-width: 1024px) {
    .vm-mobile-drawer,
    .vm-drawer-overlay,
    .vm-menu-toggle {
        display: none;
    }

    .vm-topbar {
        grid-template-columns: auto minmax(260px, 520px) auto;
        justify-content: space-between;
    }

    .site-branding-small .custom-logo-link img {
        max-height: 40px;
    }

    .site-branding-small .site-title {
        max-width: 200px;
        font-size: 1.15rem;
    }

    .vm-header-search input[type="search"] {
        padding: 0.62rem 1rem;
    }

    .vm-desktop-nav {
        display: block;
        margin-top: 0.25rem;
        margin-bottom: 0.35rem;
    }

    .vm-desktop-actions {
        display: flex;
        margin-bottom: 0.65rem;
    }
}
