/*
Theme Name: RocaPortal Market
Theme URI: https://example.com/
Author: OpenAI
Description: Marketplace local tipo Shopify para comercios con perfiles, catálogo frontend, ofertas, blog y contacto por WhatsApp.
Version: 1.0.2
Requires at least: 6.3
Requires PHP: 8.0
Text Domain: rocaportal-market
*/

:root{
  --rp-bg:#f6f7f9;
  --rp-surface:#ffffff;
  --rp-text:#17191d;
  --rp-muted:#6e7480;
  --rp-border:#e6e8ec;
  --rp-accent:#111827;
  --rp-accent-contrast:#ffffff;
  --rp-success:#16803c;
  --rp-danger:#c62828;
  --rp-radius:18px;
  --rp-shadow:0 12px 35px rgba(0,0,0,.07);
  --rp-container:1240px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--rp-bg);color:var(--rp-text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;line-height:1.5}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto;display:block}
button,input,textarea,select{font:inherit}
.rp-container{width:min(calc(100% - 32px),var(--rp-container));margin-inline:auto}
.rp-main{min-height:65vh;padding:28px 0 56px}
.rp-card{background:var(--rp-surface);border:1px solid var(--rp-border);border-radius:var(--rp-radius);box-shadow:var(--rp-shadow)}
.rp-muted{color:var(--rp-muted)}
.rp-stack{display:grid;gap:18px}
.rp-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px}
.rp-grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.rp-section{margin:32px 0 44px}
.rp-section-title{display:flex;align-items:end;justify-content:space-between;gap:16px;margin-bottom:18px}
.rp-section-title h2{font-size:clamp(1.35rem,2vw,1.9rem);margin:0;letter-spacing:-.03em}
.rp-link{font-weight:750;color:var(--rp-accent)}
.rp-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 18px;border:0;border-radius:12px;background:var(--rp-accent);color:var(--rp-accent-contrast);font-weight:800;cursor:pointer;transition:.18s ease}
.rp-btn:hover{transform:translateY(-1px);filter:brightness(.97)}
.rp-btn-secondary{background:#fff;color:var(--rp-text);border:1px solid var(--rp-border)}
.rp-btn-success{background:var(--rp-success);color:#fff}
.rp-btn-danger{background:var(--rp-danger);color:#fff}
.rp-btn-block{width:100%}
.rp-badge{display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;font-size:.76rem;font-weight:850;background:#111827;color:#fff}
.rp-badge-offer{background:#d91f35}
.rp-price{font-weight:900;font-size:1.15rem;letter-spacing:-.02em}
.rp-old-price{color:var(--rp-muted);text-decoration:line-through;margin-left:8px;font-size:.9rem}
.rp-empty{padding:30px;text-align:center;border:1px dashed var(--rp-border);border-radius:16px;color:var(--rp-muted);background:#fff}

/* Header */
.rp-header{position:sticky;top:0;z-index:1000;background:rgba(255,255,255,.92);backdrop-filter:blur(14px);border-bottom:1px solid var(--rp-border)}
.rp-header-inner{min-height:72px;display:flex;align-items:center;gap:24px}
.rp-brand{display:flex;align-items:center;gap:11px;font-size:1.2rem;font-weight:900;white-space:nowrap}
.rp-brand .custom-logo{max-height:42px;width:auto}
.rp-nav{display:flex;gap:20px;align-items:center;margin-left:auto;font-weight:700}
.rp-nav a{color:#343842}
.rp-nav a:hover{color:#000}
.rp-header-actions{display:flex;align-items:center;gap:10px}
.rp-mobile-toggle{display:none;border:0;background:transparent;font-size:1.7rem;padding:8px;cursor:pointer}
.rp-mobile-menu{display:none;padding:0 0 16px}
.rp-mobile-menu.is-open{display:grid;gap:8px}
.rp-mobile-menu a{padding:11px 6px;font-weight:750}

/* Hero */
.rp-hero{padding:54px 0 32px}
.rp-hero-box{overflow:hidden;position:relative;padding:50px;border-radius:28px;background:linear-gradient(145deg,#111827 0%,#222b3b 100%);color:#fff;box-shadow:0 24px 60px rgba(17,24,39,.22)}
.rp-hero-box:after{content:"";position:absolute;width:420px;height:420px;border-radius:50%;right:-120px;top:-180px;background:rgba(255,255,255,.08)}
.rp-hero h1{font-size:clamp(2rem,5vw,4.3rem);line-height:.98;letter-spacing:-.055em;max-width:850px;margin:0 0 18px}
.rp-hero p{max-width:720px;font-size:1.07rem;color:#d9dde5;margin:0 0 26px}
.rp-search{position:relative;z-index:2;display:flex;gap:10px;max-width:760px;background:#fff;padding:8px;border-radius:15px}
.rp-search input{flex:1;min-width:0;border:0;outline:0;padding:0 12px;color:#111827;background:transparent}
.rp-search button{white-space:nowrap}

/* Product cards */
.rp-product-card{overflow:hidden;display:flex;flex-direction:column;background:#fff;border:1px solid var(--rp-border);border-radius:18px;min-width:0;transition:.2s ease}
.rp-product-card:hover{transform:translateY(-3px);box-shadow:var(--rp-shadow)}
.rp-product-image{aspect-ratio:1/1;background:#eceef1;overflow:hidden;position:relative}
.rp-product-image img{width:100%;height:100%;object-fit:cover}
.rp-product-image .rp-badge{position:absolute;top:12px;left:12px}
.rp-product-body{padding:14px;display:grid;gap:7px}
.rp-product-store{font-size:.78rem;color:var(--rp-muted);font-weight:700}
.rp-product-title{font-size:1rem;line-height:1.25;font-weight:850;margin:0}
.rp-product-meta{display:flex;align-items:center;justify-content:space-between;gap:10px}

/* Stores */
.rp-store-card{overflow:hidden;background:#fff;border:1px solid var(--rp-border);border-radius:20px}
.rp-store-card-cover{height:120px;background:#e8ebef;overflow:hidden}
.rp-store-card-cover img{width:100%;height:100%;object-fit:cover}
.rp-store-card-body{padding:0 16px 18px}
.rp-store-avatar{width:74px;height:74px;border-radius:50%;object-fit:cover;background:#fff;border:5px solid #fff;box-shadow:0 5px 20px rgba(0,0,0,.12)}
.rp-store-card .rp-store-avatar{margin-top:-37px}
.rp-store-card h3{margin:10px 0 3px;font-size:1.12rem}
.rp-store-address{font-size:.88rem;color:var(--rp-muted)}

/* Store profile */
.rp-store-hero{position:relative;margin-bottom:70px}
.rp-store-cover{height:clamp(220px,31vw,390px);border-radius:0 0 28px 28px;overflow:hidden;background:linear-gradient(145deg,#d8dce2,#eef0f3)}
.rp-store-cover img{width:100%;height:100%;object-fit:cover}
.rp-store-profile{position:absolute;left:50%;transform:translateX(-50%);bottom:-54px;width:min(calc(100% - 32px),var(--rp-container));display:flex;align-items:end;gap:18px;padding:22px;background:rgba(255,255,255,.96);border:1px solid var(--rp-border);border-radius:22px;box-shadow:var(--rp-shadow)}
.rp-store-profile .rp-store-avatar{width:116px;height:116px;flex:0 0 116px;border:6px solid #fff}
.rp-store-profile-info{flex:1;min-width:0}
.rp-store-profile h1{margin:0 0 3px;font-size:clamp(1.55rem,3vw,2.3rem);line-height:1.05}
.rp-store-profile p{margin:7px 0 0;color:var(--rp-muted)}
.rp-store-actions{display:flex;gap:8px;flex-wrap:wrap}
.rp-store-toolbar{display:flex;align-items:center;gap:12px;justify-content:space-between;margin:26px 0}
.rp-store-filter{display:flex;gap:8px;overflow:auto;padding-bottom:4px}
.rp-chip{white-space:nowrap;padding:9px 13px;border:1px solid var(--rp-border);border-radius:999px;background:#fff;font-size:.86rem;font-weight:750;cursor:pointer}
.rp-inline-search{min-width:260px;border:1px solid var(--rp-border);background:#fff;border-radius:12px;padding:10px 13px;outline:none}

/* Product single */
.rp-product-single{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(340px,.88fr);gap:38px;align-items:start}
.rp-product-main-image{border-radius:24px;overflow:hidden;background:#eceef1;aspect-ratio:1/1}
.rp-product-main-image img{width:100%;height:100%;object-fit:cover}
.rp-product-detail{position:sticky;top:100px;padding:26px}
.rp-product-detail h1{font-size:clamp(1.75rem,3vw,2.8rem);line-height:1.03;letter-spacing:-.04em;margin:8px 0 14px}
.rp-product-detail .rp-price{font-size:1.75rem}
.rp-description{margin-top:22px;color:#3e434c}
.rp-contact-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:22px}
.rp-business-mini{display:flex;align-items:center;gap:12px;margin-top:22px;padding-top:20px;border-top:1px solid var(--rp-border)}
.rp-business-mini img{width:54px;height:54px;border-radius:50%;object-fit:cover}

/* Forms */
.rp-auth-wrap{width:min(100% - 32px,620px);margin:36px auto}
.rp-form-card{padding:26px}
.rp-form-card h1,.rp-form-card h2{margin-top:0}
.rp-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.rp-field{display:grid;gap:7px}
.rp-field-full{grid-column:1/-1}
.rp-field label{font-weight:750;font-size:.88rem}
.rp-field input,.rp-field textarea,.rp-field select{width:100%;border:1px solid #d9dde3;border-radius:12px;background:#fff;padding:12px 13px;outline:none}
.rp-field input:focus,.rp-field textarea:focus,.rp-field select:focus{border-color:#89919f;box-shadow:0 0 0 3px rgba(17,24,39,.06)}
.rp-field textarea{min-height:120px;resize:vertical}
.rp-notice{padding:12px 14px;border-radius:12px;margin-bottom:16px;background:#edf7ef;color:#155d28;border:1px solid #cfead5}
.rp-notice-error{background:#fff0f0;color:#8d1c1c;border-color:#f1cccc}
.rp-file-preview{display:flex;align-items:center;gap:12px;margin-top:8px}
.rp-file-preview img{width:78px;height:78px;object-fit:cover;border-radius:12px;border:1px solid var(--rp-border)}

/* Dashboard */
.rp-dashboard{display:grid;grid-template-columns:230px minmax(0,1fr);gap:22px;align-items:start}
.rp-dashboard-sidebar{position:sticky;top:96px;padding:12px}
.rp-dashboard-sidebar a{display:flex;padding:11px 12px;border-radius:10px;font-weight:750;color:#4e5560}
.rp-dashboard-sidebar a.is-active,.rp-dashboard-sidebar a:hover{background:#f0f2f5;color:#111827}
.rp-dashboard-main{min-width:0}
.rp-dashboard-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.rp-dashboard-head h1{margin:0;font-size:1.75rem}
.rp-dashboard-card{padding:22px}
.rp-admin-business-select{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:18px;padding:14px;background:#fff7e6;border:1px solid #f3d7a1;border-radius:14px}
.rp-admin-business-select select{min-width:220px;padding:9px 10px;border-radius:10px;border:1px solid #dccba9;background:#fff}
.rp-table-wrap{overflow:auto;border:1px solid var(--rp-border);border-radius:14px}
.rp-table{width:100%;border-collapse:collapse;min-width:720px;background:#fff}
.rp-table th,.rp-table td{text-align:left;padding:13px 14px;border-bottom:1px solid var(--rp-border);vertical-align:middle}
.rp-table th{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:var(--rp-muted);background:#fafbfc}
.rp-product-thumb-sm{width:52px;height:52px;border-radius:10px;object-fit:cover;background:#eee}
.rp-actions-inline{display:flex;gap:7px;flex-wrap:wrap}
.rp-actions-inline a,.rp-actions-inline button{border:1px solid var(--rp-border);background:#fff;border-radius:9px;padding:7px 9px;font-size:.82rem;font-weight:700;cursor:pointer}

/* Blog */
.rp-post-card{background:#fff;border:1px solid var(--rp-border);border-radius:18px;overflow:hidden}
.rp-post-card img{width:100%;aspect-ratio:16/9;object-fit:cover;background:#eee}
.rp-post-card-body{padding:16px}
.rp-post-card h3{margin:3px 0 8px;line-height:1.2}
.rp-post-meta{font-size:.8rem;color:var(--rp-muted)}
.rp-article{width:min(calc(100% - 32px),860px);margin:0 auto}
.rp-article-head{margin-bottom:24px}
.rp-article-head h1{font-size:clamp(2rem,5vw,4rem);line-height:1.02;letter-spacing:-.05em;margin:0 0 12px}
.rp-article-content{font-size:1.07rem}
.rp-article-content img{border-radius:18px}

/* Footer */
.rp-footer{background:#111827;color:#d9dde5;margin-top:56px;padding:44px 0}
.rp-footer-grid{display:grid;grid-template-columns:2fr 1fr 1fr;gap:28px}
.rp-footer h4{color:#fff;margin:0 0 10px}
.rp-footer a{color:#d9dde5}
.rp-footer-links{display:grid;gap:8px}
.rp-footer-bottom{border-top:1px solid rgba(255,255,255,.12);margin-top:28px;padding-top:18px;color:#9da5b4;font-size:.86rem}

/* Cart drawer */
.rp-cart-fab{position:fixed;right:20px;bottom:20px;z-index:1100;border:0;border-radius:999px;background:#111827;color:#fff;min-width:58px;height:58px;padding:0 16px;box-shadow:0 14px 38px rgba(0,0,0,.22);font-weight:850;cursor:pointer}
.rp-cart-count{display:inline-flex;min-width:21px;height:21px;align-items:center;justify-content:center;border-radius:999px;background:#fff;color:#111827;font-size:.72rem;margin-left:5px}
.rp-cart-overlay{position:fixed;inset:0;background:rgba(0,0,0,.42);z-index:1199;display:none}
.rp-cart-overlay.is-open{display:block}
.rp-cart-drawer{position:fixed;top:0;right:-440px;width:min(92vw,420px);height:100dvh;background:#fff;z-index:1200;box-shadow:-20px 0 50px rgba(0,0,0,.18);transition:right .22s ease;display:flex;flex-direction:column}
.rp-cart-drawer.is-open{right:0}
.rp-cart-head{display:flex;align-items:center;justify-content:space-between;padding:20px;border-bottom:1px solid var(--rp-border)}
.rp-cart-items{padding:16px;overflow:auto;flex:1;display:grid;align-content:start;gap:12px}
.rp-cart-item{display:grid;grid-template-columns:54px 1fr auto;gap:10px;align-items:center;padding:10px;border:1px solid var(--rp-border);border-radius:12px}
.rp-cart-item img{width:54px;height:54px;object-fit:cover;border-radius:9px}
.rp-cart-foot{padding:18px;border-top:1px solid var(--rp-border);display:grid;gap:12px}
.rp-cart-total{display:flex;justify-content:space-between;font-weight:900}

@media (max-width:1000px){
  .rp-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .rp-product-single{grid-template-columns:1fr 390px;gap:24px}
  .rp-dashboard{grid-template-columns:190px minmax(0,1fr)}
}
@media (max-width:820px){
  .rp-nav,.rp-header-actions .rp-btn-secondary{display:none}
  .rp-mobile-toggle{display:block;margin-left:auto}
  .rp-grid,.rp-grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .rp-hero-box{padding:34px 24px}
  .rp-product-single{grid-template-columns:1fr}
  .rp-product-detail{position:static}
  .rp-store-profile{align-items:center;bottom:-82px;flex-wrap:wrap}
  .rp-store-profile .rp-store-avatar{width:94px;height:94px;flex-basis:94px}
  .rp-store-actions{width:100%}
  .rp-store-hero{margin-bottom:100px}
  .rp-dashboard{grid-template-columns:1fr}
  .rp-dashboard-sidebar{position:static;display:flex;overflow:auto;padding:8px;gap:4px}
  .rp-dashboard-sidebar a{white-space:nowrap}
  .rp-footer-grid{grid-template-columns:1fr 1fr}
}
@media (max-width:560px){
  .rp-container{width:min(calc(100% - 22px),var(--rp-container))}
  .rp-header-inner{min-height:64px;gap:10px}
  .rp-brand{font-size:1rem}
  .rp-brand .custom-logo{max-height:36px}
  .rp-header-actions .rp-btn{padding:0 12px;min-height:40px;font-size:.84rem}
  .rp-hero{padding-top:24px}
  .rp-hero-box{border-radius:20px;padding:28px 18px}
  .rp-search{display:grid}
  .rp-search button{width:100%}
  .rp-grid,.rp-grid-3{grid-template-columns:1fr 1fr;gap:11px}
  .rp-product-body{padding:11px}
  .rp-product-title{font-size:.92rem}
  .rp-price{font-size:1rem}
  .rp-store-profile{padding:15px;gap:12px;bottom:-100px}
  .rp-store-hero{margin-bottom:120px}
  .rp-store-profile h1{font-size:1.45rem}
  .rp-store-profile-info{min-width:180px}
  .rp-store-actions .rp-btn{flex:1;padding-inline:10px;font-size:.84rem}
  .rp-store-toolbar{align-items:stretch;flex-direction:column}
  .rp-inline-search{min-width:0;width:100%}
  .rp-contact-row{grid-template-columns:1fr}
  .rp-form-grid{grid-template-columns:1fr}
  .rp-field-full{grid-column:auto}
  .rp-form-card,.rp-dashboard-card{padding:17px}
  .rp-dashboard-head{align-items:flex-start;flex-direction:column}
  .rp-footer-grid{grid-template-columns:1fr}
  .rp-cart-fab{right:12px;bottom:12px;height:52px;min-width:52px}
}
@media (max-width:380px){
  .rp-grid,.rp-grid-3{grid-template-columns:1fr}
}

/* Utility additions */
.rp-store-extra{display:flex;gap:24px;justify-content:space-between;padding:15px 18px;margin:12px 0 22px;color:#555c67;font-size:.9rem}
.rp-pagination{display:flex;gap:7px;justify-content:center;flex-wrap:wrap;margin:30px 0}
.rp-pagination .page-numbers{display:inline-flex;align-items:center;justify-content:center;min-width:40px;height:40px;padding:0 10px;background:#fff;border:1px solid var(--rp-border);border-radius:10px;font-weight:750}
.rp-pagination .current{background:var(--rp-accent);color:#fff;border-color:var(--rp-accent)}
.rp-directory-search{max-width:620px;background:#fff;border:1px solid var(--rp-border)}
.rp-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.rp-stat{padding:18px;display:grid;gap:6px}
.rp-stat span{font-size:.82rem;color:var(--rp-muted);font-weight:700}
.rp-stat strong{font-size:1.45rem;letter-spacing:-.03em}
.rp-check-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:12px;border:1px solid var(--rp-border);border-radius:12px}
.rp-check-grid label{font-weight:600}
.rp-check-grid input{width:auto}
.rp-gallery-admin{display:flex;gap:8px;flex-wrap:wrap}
.rp-gallery-admin img{width:80px;height:80px;border-radius:11px;object-fit:cover;border:1px solid var(--rp-border)}
.rp-product-gallery{display:flex;gap:9px;overflow:auto;margin-top:12px;padding-bottom:5px}
.rp-gallery-thumb{border:2px solid transparent;background:#fff;border-radius:12px;padding:3px;cursor:pointer;flex:0 0 auto}
.rp-gallery-thumb.is-active{border-color:var(--rp-accent)}
.rp-gallery-thumb img{width:72px;height:72px;object-fit:cover;border-radius:8px}
.rp-cart-qty{display:grid;grid-template-columns:repeat(3,30px);gap:4px}
.rp-cart-qty button{width:30px;height:30px;border:1px solid var(--rp-border);border-radius:8px;background:#fff;cursor:pointer}
.rp-add-cart{margin-top:5px;min-height:38px;font-size:.84rem}

@media(max-width:820px){.rp-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.rp-check-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.rp-store-extra{flex-direction:column;gap:8px}.rp-stat-grid{grid-template-columns:1fr 1fr}.rp-check-grid{grid-template-columns:1fr}.rp-gallery-thumb img{width:62px;height:62px}}

/* Login frontend */
#loginform{display:grid;gap:14px}
#loginform p{margin:0;display:grid;gap:6px}
#loginform label{font-weight:750;font-size:.88rem}
#loginform input[type="text"],#loginform input[type="password"]{width:100%;border:1px solid #d9dde3;border-radius:12px;background:#fff;padding:12px 13px;outline:none}
#loginform .login-remember label{display:flex;align-items:center;gap:8px;font-weight:600}
#loginform .button-primary{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 18px;border:0;border-radius:12px;background:var(--rp-accent);color:#fff;font-weight:800;cursor:pointer}
