
/*
Theme Name: Hatora Grocery
Theme URI: https://hatora.in/
Author: Hatora
Description: Lightweight WooCommerce grocery theme for Hatora.in.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: hatora
*/

:root{--green:#16803c;--dark:#12351f;--yellow:#f5b900;--light:#f7faf6;--text:#17351f;--muted:#68736b;--border:#e5ece5}
*{box-sizing:border-box}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;color:var(--text);background:#fff}
a{text-decoration:none;color:inherit}
img{max-width:100%;height:auto}
.h-container{width:94%;max-width:1400px;margin:auto}

/* TOP BAR */
.h-top{background:var(--dark);color:#fff;font-size:12px}
.h-top .h-container{display:flex;justify-content:space-between;padding:8px 0}
.h-top a{color:#fff}

/* HEADER */
.h-header{background:#fff;border-bottom:1px solid var(--border);position:sticky;top:0;z-index:999}
.h-header-row{min-height:76px;display:flex;align-items:center;gap:18px}
.h-logo{flex:0 0 auto}
.h-logo img{max-height:55px;width:auto}
.h-logo-text{font-size:28px;font-weight:900;color:var(--green)}
.h-location{display:flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:9px;padding:9px 12px;min-width:205px;font-size:12px;background:#fff;color:var(--text);cursor:pointer;text-align:left}
.h-location:hover{border-color:var(--green);background:#fbfdfb}
.h-location strong{display:block;font-size:13px;max-width:145px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.h-location small{display:block;color:#68736b;font-size:10px}
.h-location-arrow{margin-left:auto;color:var(--green);font-size:18px;line-height:1}
.h-search{flex:1;display:flex;border:2px solid var(--green);border-radius:9px;overflow:hidden;min-height:44px}
.h-search input{flex:1;border:0;outline:0;padding:0 14px;font-size:14px}
.h-search button{border:0;background:var(--green);color:#fff;padding:0 18px;font-weight:800;cursor:pointer}
.h-actions{display:flex;align-items:center;gap:8px}
.h-action{text-align:center;font-size:12px;font-weight:700;white-space:nowrap;position:relative;padding:8px 10px;border-radius:8px}
.h-action-icon{font-size:21px;display:block;line-height:1.05}
.h-cart{background:var(--yellow);padding:10px 14px;border-radius:8px}
.h-wishlist{border:1px solid var(--border);background:#fff;color:#25382b}
.h-wishlist:hover{border-color:#e03b50;color:#e03b50}
.h-heart{font-size:24px;color:#e03b50}
.h-wishlist-count{position:absolute;right:3px;top:2px;min-width:16px;height:16px;padding:0 4px;border-radius:10px;background:#e03b50;color:#fff;font-size:9px;line-height:16px;text-align:center}

/* NAV */
.h-nav{border-bottom:1px solid var(--border);background:#fff}
.h-nav-row{display:flex;align-items:center;gap:24px;min-height:44px}
.h-nav a{font-size:13px;font-weight:700;color:#304237}
.h-nav a:hover{color:var(--green)}

/* HERO */
.h-hero{background:linear-gradient(135deg,#f5fbe9,#eef8e9);padding:48px 0}
.h-hero-grid{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:30px}
.h-badge{display:inline-block;background:#fff;color:var(--green);padding:8px 14px;border-radius:30px;font-size:12px;font-weight:800;border:1px solid #ddead8}
.h-hero h1{font-size:50px;line-height:1.08;margin:16px 0;color:var(--text)}
.h-hero h1 span{color:#df9e00}
.h-hero p{font-size:17px;line-height:1.6;color:#526356;max-width:620px}
.h-btn{display:inline-block;padding:13px 24px;border-radius:8px;font-weight:800;margin:5px 5px 5px 0}
.h-btn-primary{background:var(--yellow);color:#17240d}
.h-btn-green{background:var(--green);color:#fff}

/* SECTION */
.h-section{padding:48px 0}
.h-title{text-align:center;margin-bottom:28px}
.h-title h2{margin:0 0 7px;font-size:30px}
.h-title p{margin:0;color:var(--muted);font-size:14px}

/* CATEGORY */
.h-cat-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:14px}
.h-cat{border:1px solid var(--border);border-radius:12px;padding:16px;text-align:center;background:#fff;transition:.2s}
.h-cat:hover{transform:translateY(-3px);border-color:var(--green);box-shadow:0 8px 20px #0000000d}
.h-cat img{height:90px;object-fit:contain}
.h-cat-name{font-size:14px;font-weight:800;margin-top:9px}

/* PRODUCT */
.h-products{background:var(--light)}
.h-product-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}
.h-product{background:#fff;border:1px solid var(--border);border-radius:14px;padding:15px;display:flex;flex-direction:column;justify-content:space-between}
.h-product-image{height:190px;display:flex;align-items:center;justify-content:center}
.h-product-image img{max-height:175px;object-fit:contain}
.h-product h3{font-size:15px;line-height:1.35;min-height:40px}
.h-price{font-size:17px;font-weight:900;color:var(--green);margin:8px 0}
.h-product .button{width:100%;background:var(--green)!important;color:#fff!important;border:0!important;border-radius:7px!important;padding:10px!important;font-weight:800!important}

/* DELIVERY */
.h-delivery{padding:40px 0}
.h-delivery-box{background:linear-gradient(135deg,var(--green),#0e562a);color:#fff;border-radius:18px;padding:38px;text-align:center}
.h-delivery-box h2{margin:0 0 8px;font-size:30px}
.h-delivery-box p{margin:0 0 18px}

/* FOOTER */
.h-footer-top{background:#f7faf6;border-top:1px solid var(--border);padding:45px 0}
.h-footer-grid{display:grid;grid-template-columns:1.6fr 1fr 1fr 1fr 1.2fr;gap:32px}
.h-footer h3{font-size:16px;margin:0 0 16px}
.h-footer p,.h-footer li,.h-footer a{font-size:13px;color:#59665d;line-height:1.7}
.h-footer ul{list-style:none;margin:0;padding:0}
.h-footer li{margin-bottom:7px}
.h-footer a:hover{color:var(--green)}
.h-footer-brand img{max-height:52px;width:auto;margin-bottom:10px}
.h-social{display:flex;gap:8px;margin-top:14px}
.h-social a{width:34px;height:34px;border-radius:50%;background:var(--green);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800}
.h-trust{background:var(--dark);padding:24px 0}
.h-trust-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:20px}
.h-trust-item{display:flex;gap:12px;align-items:center;color:#fff}
.h-trust-icon{width:42px;height:42px;border-radius:50%;background:#ffffff18;display:flex;align-items:center;justify-content:center;font-size:19px}
.h-trust-item strong{font-size:13px;display:block}
.h-trust-item span{font-size:11px;color:#c8d5cc}
.h-footer-bottom{background:#0b2716;padding:17px 0;color:#b8c6bc;font-size:12px}
.h-bottom-row{display:flex;justify-content:space-between;gap:15px}
.h-pay{display:flex;gap:6px}
.h-pay span{background:#fff;color:#333;padding:4px 8px;border-radius:4px;font-size:10px;font-weight:800}


/* LOCATION MODAL */
.h-location-modal{display:none;position:fixed;inset:0;z-index:10000;align-items:center;justify-content:center;padding:20px}
.h-location-modal.is-open{display:flex}
.h-location-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.48)}
.h-location-dialog{position:relative;width:min(500px,100%);background:#fff;border-radius:16px;padding:28px;box-shadow:0 20px 60px rgba(0,0,0,.2);z-index:1}
.h-location-close{position:absolute;right:14px;top:10px;border:0;background:transparent;font-size:28px;line-height:1;color:#68736b;cursor:pointer}
.h-location-dialog-icon{width:48px;height:48px;border-radius:50%;background:#eef8e9;display:flex;align-items:center;justify-content:center;font-size:23px;margin-bottom:12px}
.h-location-dialog h2{margin:0 0 6px;font-size:24px;color:var(--text)}
.h-location-subtitle{margin:0 0 20px;color:var(--muted);font-size:13px;line-height:1.5}
.h-current-location{width:100%;display:flex;align-items:center;gap:12px;border:1px solid #cfe5d2;background:#f5fbf6;border-radius:10px;padding:13px;text-align:left;color:var(--green);cursor:pointer}
.h-current-location span{font-size:24px}
.h-current-location strong{display:block;font-size:14px}
.h-current-location small{display:block;font-size:11px;color:var(--muted);margin-top:2px}
.h-location-divider{display:flex;align-items:center;gap:10px;margin:18px 0;color:#8a948d;font-size:11px;font-weight:800}
.h-location-divider:before,.h-location-divider:after{content:"";height:1px;background:var(--border);flex:1}
.h-location-dialog label{display:block;font-size:12px;font-weight:800;color:var(--text);margin:12px 0 7px}
.h-location-dialog label span{font-weight:500;color:#8a948d}
.h-address-input{display:flex;align-items:center;border:1px solid #ccd7ce;border-radius:8px;overflow:hidden}
.h-address-input span{padding-left:12px}
.h-address-input input{width:100%;border:0;outline:0;padding:12px;font-size:14px}
.h-pincode{width:100%;border:1px solid #ccd7ce;border-radius:8px;padding:12px;font-size:14px;outline:0}
.h-address-input:focus-within,.h-pincode:focus{border-color:var(--green);box-shadow:0 0 0 3px #16803c12}
.h-location-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}
.h-location-cancel,.h-location-save{border:0;border-radius:8px;padding:11px 17px;font-weight:800;cursor:pointer}
.h-location-cancel{background:#eef1ee;color:#425048}
.h-location-save{background:var(--green);color:#fff}
.h-location-status{min-height:18px;margin:10px 0 0;color:var(--green);font-size:12px}
.h-location-status.is-error{color:#b42318}


/* SOCIAL BRAND ICONS */
.h-social a{width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;padding:0!important}
.h-social a svg{width:17px;height:17px;display:block;fill:currentColor}
.h-social a.h-social-instagram svg{fill:none;stroke:currentColor;stroke-width:1.8}
.h-social a.h-social-instagram .h-ig-dot{fill:currentColor;stroke:none}
.h-social-facebook{background:#1877F2!important;color:#fff!important}
.h-social-instagram{background:#E4405F!important;color:#fff!important}
.h-social-youtube{background:#FF0000!important;color:#fff!important}
.h-social-x{background:#000!important;color:#fff!important}


.h-pincode-result{min-height:18px;margin-top:8px;font-size:12px;font-weight:700}
.h-pincode-result.is-success{color:#16803c}
.h-pincode-result.is-error{color:#b42318}
.h-address-input input[readonly]{background:#f7faf6;color:#526356;cursor:default}

/* MOBILE */
.h-mobile-bar{display:none}
@media(max-width:1000px){
.h-header-row{flex-wrap:wrap;padding:10px 0}
.h-location{display:none}.h-search{order:5;flex-basis:100%}
.h-cat-grid{grid-template-columns:repeat(4,1fr)}
.h-product-grid{grid-template-columns:repeat(3,1fr)}
.h-footer-grid{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:700px){
.h-top{display:none}.h-nav{display:none}.h-header{position:relative}
.h-header-row{gap:10px;min-height:65px}
.h-logo-text{font-size:24px}.h-actions{margin-left:auto}.h-action:not(.h-cart):not(.h-wishlist){display:none}
.h-hero{padding:32px 0}.h-hero-grid{grid-template-columns:1fr;text-align:center}
.h-hero h1{font-size:35px}.h-hero p{font-size:15px;margin-left:auto;margin-right:auto}
.h-cat-grid{grid-template-columns:repeat(3,1fr);gap:9px}.h-cat{padding:10px 5px}.h-cat img{height:65px}.h-cat-name{font-size:12px}
.h-product-grid{grid-template-columns:repeat(2,1fr);gap:10px}.h-product{padding:10px}.h-product-image{height:145px}
.h-footer-grid{grid-template-columns:1fr 1fr}.h-footer-brand{grid-column:1/-1}
.h-trust-grid{grid-template-columns:1fr 1fr}
.h-bottom-row{flex-direction:column;text-align:center;align-items:center}
.h-mobile-bar{display:flex;position:fixed;bottom:0;left:0;right:0;background:#fff;border-top:1px solid var(--border);z-index:9999;justify-content:space-around;padding:8px 0}
.h-mobile-bar a{font-size:10px;font-weight:800;text-align:center;flex:1}.h-mobile-bar span{display:block;font-size:19px;line-height:20px}
body{padding-bottom:58px}
}
@media(max-width:430px){
.h-cat-grid{grid-template-columns:repeat(3,1fr)}
.h-footer-grid,.h-trust-grid{grid-template-columns:1fr}
}


/* CART COUNT + PRODUCT DELIVERY CHECK */
.h-cart{position:relative;min-width:56px}
.h-cart-count{position:absolute;right:2px;top:1px;min-width:17px;height:17px;padding:0 4px;border-radius:12px;background:#e03b50;color:#fff;font-size:9px;line-height:17px;text-align:center;font-weight:800}
.hatora-delivery-result{margin-top:10px;padding:9px 10px;border-radius:6px;font-size:13px;font-weight:700;line-height:1.4}
.hatora-delivery-result.is-success{background:#eef8f0;color:#16803c;border:1px solid #bfe1c7}
.hatora-delivery-result.is-error{background:#fff4f4;color:#b42318;border:1px solid #f0c5c5}


/* CHECKOUT ADDRESS SYNC */
body.woocommerce-checkout #billing_address_1.hatora-synced-address{
    background:#f5fbf6;
    border-color:#16803c;
}
