/*
Theme Name: EraSmart Pro
Theme URI: https://www.erasmart.com/
Author: Manus
Author URI: https://manus.im/
Description: A modern e-commerce style WordPress theme fully compatible with Elementor. Designed for printer manufacturers and B2B product showcase websites. Featuring an HTVRONT-inspired bright design with orange accent color, pill buttons, rounded cards, announcement bar, mega header and multi-column footer. Build all your pages visually with Elementor.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: erasmart-pro
Tags: e-commerce, one-column, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, block-styles, wide-blocks
*/

/* ==========================================================================
   1. CSS Variables
   ========================================================================== */
:root {
  --ep-primary: #F97316;
  --ep-primary-dark: #EA580C;
  --ep-secondary: #0F2A43;
  --ep-hero-bg: #EAF4FD;
  --ep-section-bg: #F6F7F9;
  --ep-text: #111827;
  --ep-text-light: #6B7280;
  --ep-border: #E5E7EB;
  --ep-white: #ffffff;
  --ep-radius: 16px;
  --ep-radius-pill: 999px;
  --ep-shadow: 0 2px 12px rgba(17, 24, 39, .07);
  --ep-shadow-hover: 0 10px 28px rgba(17, 24, 39, .13);
  --ep-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --ep-container: 1200px;
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--ep-font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ep-text);
  background: var(--ep-white);
  word-wrap: break-word;
}

img { max-width: 100%; height: auto; vertical-align: middle; }

a { color: var(--ep-primary); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--ep-primary-dark); }

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 .6em;
  color: var(--ep-text);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1.2em; }

input, textarea, select, button { font-family: inherit; font-size: 1rem; }

input[type="text"], input[type="email"], input[type="url"], input[type="search"],
input[type="password"], input[type="tel"], input[type="number"], textarea, select {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--ep-border);
  border-radius: 10px;
  background: var(--ep-white);
  color: var(--ep-text);
  transition: border-color .2s ease, box-shadow .2s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--ep-primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .15);
}

/* Buttons */
button, .button, input[type="submit"],
.wp-block-button__link {
  display: inline-block;
  padding: 12px 28px;
  background: var(--ep-primary);
  color: #fff;
  border: none;
  border-radius: var(--ep-radius-pill);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
}

button:hover, .button:hover, input[type="submit"]:hover,
.wp-block-button__link:hover {
  background: var(--ep-primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(249, 115, 22, .35);
}

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

.skip-link {
  left: -9999rem; top: 2.5rem; z-index: 999999999; text-decoration: underline;
}
.skip-link:focus {
  display: block; left: 6px; top: 7px; padding: 10px 20px;
  background: var(--ep-secondary); color: #fff;
  font-size: 14px; line-height: normal; z-index: 100000;
  border-radius: 8px;
}

/* Container */
.ep-container {
  max-width: var(--ep-container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   3. Announcement Bar
   ========================================================================== */
.ep-announcement {
  background: var(--ep-secondary);
  color: #fff;
  font-size: 14px;
  text-align: center;
  padding: 8px 20px;
}

.ep-announcement a {
  color: #FDBA74;
  font-weight: 600;
  margin-left: 8px;
}
.ep-announcement a:hover { color: #fff; }

/* ==========================================================================
   4. Header
   ========================================================================== */
.ep-header {
  background: var(--ep-white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 0 var(--ep-border);
}

.ep-header-main {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
}

.ep-branding { flex-shrink: 0; }
.ep-branding img { max-height: 44px; width: auto; }

.ep-site-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -.02em;
}
.ep-site-title a { color: var(--ep-text); }
.ep-site-title a:hover { color: var(--ep-primary); }
.ep-site-desc { display: none; }

/* Header search */
.ep-header-search {
  flex: 1;
  max-width: 520px;
  margin: 0 auto;
}

.ep-header-search form { position: relative; display: flex; }

.ep-header-search input[type="search"] {
  border-radius: var(--ep-radius-pill);
  border: 2px solid var(--ep-primary);
  padding: 9px 52px 9px 20px;
}

.ep-header-search button {
  position: absolute;
  right: 3px; top: 3px; bottom: 3px;
  padding: 0 18px;
  border-radius: var(--ep-radius-pill);
  line-height: 1;
}

/* Header contact */
.ep-header-contact {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
  font-size: 14px;
}

.ep-header-contact a { color: var(--ep-text); font-weight: 600; }
.ep-header-contact a:hover { color: var(--ep-primary); }
.ep-header-contact .ep-quote-btn {
  background: var(--ep-primary);
  color: #fff;
  padding: 9px 20px;
  border-radius: var(--ep-radius-pill);
}
.ep-header-contact .ep-quote-btn:hover { background: var(--ep-primary-dark); }

/* Primary navigation */
.ep-nav-wrap { border-top: 1px solid var(--ep-border); }

.ep-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.ep-nav li { position: relative; }

.ep-nav a {
  display: block;
  padding: 12px 18px;
  color: var(--ep-text);
  font-weight: 600;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.ep-nav a:hover { color: var(--ep-primary); }

.ep-nav li.current-menu-item > a,
.ep-nav li.current_page_item > a { color: var(--ep-primary); }

/* Dropdowns */
.ep-nav ul ul {
  position: absolute;
  top: 100%; left: 0;
  min-width: 230px;
  background: var(--ep-white);
  border-radius: 12px;
  box-shadow: var(--ep-shadow-hover);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all .2s ease;
  z-index: 1001;
  flex-direction: column;
}

.ep-nav li:hover > ul,
.ep-nav li:focus-within > ul {
  opacity: 1; visibility: visible; transform: translateY(0);
}

.ep-nav ul ul a {
  padding: 9px 20px;
  text-transform: none;
  font-weight: 500;
  font-size: 14px;
}

.ep-nav ul ul ul { top: 0; left: 100%; }

/* Mobile menu toggle */
.ep-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
}
.ep-menu-toggle:hover { background: var(--ep-section-bg); transform: none; box-shadow: none; }

.ep-menu-toggle .bar {
  display: block;
  width: 24px; height: 2.5px;
  background: var(--ep-text);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}

.ep-menu-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.ep-menu-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.ep-menu-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ==========================================================================
   5. Content Area (blog / archive / single)
   ========================================================================== */
.ep-content { padding: 48px 0; }

.ep-page-header { margin-bottom: 32px; }
.ep-page-title { font-size: 2rem; margin: 0; }
.ep-archive-desc { color: var(--ep-text-light); margin-top: 8px; }

.ep-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.ep-card {
  background: var(--ep-white);
  border-radius: var(--ep-radius);
  overflow: hidden;
  box-shadow: var(--ep-shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex;
  flex-direction: column;
}

.ep-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--ep-shadow-hover);
}

.ep-card-thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ep-section-bg); }
.ep-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.ep-card:hover .ep-card-thumb img { transform: scale(1.05); }

.ep-card-body { padding: 22px 24px 26px; flex: 1; display: flex; flex-direction: column; }

.ep-card-meta { font-size: 13px; color: var(--ep-text-light); margin-bottom: 8px; }
.ep-card-meta a { color: var(--ep-primary); font-weight: 600; }

.ep-card-title { font-size: 1.1rem; margin: 0 0 10px; }
.ep-card-title a { color: var(--ep-text); }
.ep-card-title a:hover { color: var(--ep-primary); }

.ep-card-excerpt { color: var(--ep-text-light); font-size: 14.5px; flex: 1; }

.ep-read-more {
  font-weight: 700;
  font-size: 14px;
  color: var(--ep-primary);
  margin-top: 14px;
  display: inline-block;
}

/* Single post */
.ep-single {
  max-width: 820px;
  margin: 0 auto;
}

.ep-single-header { margin-bottom: 28px; text-align: center; }
.ep-single-title { font-size: 2.2rem; }
.ep-single-meta { color: var(--ep-text-light); font-size: 14px; }
.ep-single-meta a { color: var(--ep-primary); }

.ep-single-thumb { margin: 0 0 32px; border-radius: var(--ep-radius); overflow: hidden; }

.ep-entry-content { font-size: 17px; }
.ep-entry-content h2 { margin-top: 1.6em; }
.ep-entry-content h3 { margin-top: 1.4em; }
.ep-entry-content img { border-radius: 12px; }
.ep-entry-content blockquote {
  border-left: 4px solid var(--ep-primary);
  background: var(--ep-section-bg);
  margin: 1.5em 0;
  padding: 16px 24px;
  border-radius: 0 12px 12px 0;
  font-style: italic;
}
.ep-entry-content pre {
  background: var(--ep-secondary);
  color: #E5E7EB;
  padding: 20px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 14px;
}
.ep-entry-content code { background: var(--ep-section-bg); padding: 2px 7px; border-radius: 5px; font-size: .9em; }
.ep-entry-content pre code { background: transparent; padding: 0; }

.ep-entry-content .alignwide { margin-left: -80px; margin-right: -80px; max-width: calc(100% + 160px); }
.ep-entry-content .alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; }

/* Post navigation */
.ep-post-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 40px 0;
  padding-top: 28px;
  border-top: 1px solid var(--ep-border);
}
.ep-post-nav a { font-weight: 600; color: var(--ep-text); max-width: 46%; }
.ep-post-nav a:hover { color: var(--ep-primary); }
.ep-post-nav .nav-label { display: block; font-size: 13px; color: var(--ep-text-light); font-weight: 400; }

/* Pagination */
.ep-pagination { margin-top: 44px; text-align: center; }
.ep-pagination .nav-links { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ep-pagination .page-numbers {
  display: inline-block;
  min-width: 42px;
  padding: 9px 14px;
  background: var(--ep-white);
  border: 1px solid var(--ep-border);
  border-radius: 10px;
  color: var(--ep-text);
  font-weight: 600;
}
.ep-pagination .page-numbers.current,
.ep-pagination .page-numbers:hover { background: var(--ep-primary); border-color: var(--ep-primary); color: #fff; }

/* Comments */
.ep-comments { margin-top: 48px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { margin-bottom: 20px; }
.comment-body {
  background: var(--ep-section-bg);
  border-radius: var(--ep-radius);
  padding: 20px 24px;
}
.comment-list .children { list-style: none; padding-left: 40px; margin-top: 16px; }
.comment-author img { border-radius: 50%; margin-right: 10px; }
.comment-metadata { font-size: 13px; color: var(--ep-text-light); }
.reply a { font-size: 13px; font-weight: 700; }

/* 404 & search none */
.ep-none { text-align: center; padding: 60px 0; }
.ep-none .ep-404-code { font-size: 6rem; font-weight: 800; color: var(--ep-primary); line-height: 1; margin-bottom: 12px; }

/* ==========================================================================
   6. Footer
   ========================================================================== */
.ep-footer { background: var(--ep-secondary); color: #CBD5E1; margin-top: 0; }

.ep-footer a { color: #CBD5E1; }
.ep-footer a:hover { color: #fff; }

.ep-footer-widgets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px;
  padding: 56px 0 40px;
}

.ep-footer .widget-title, .ep-footer h4 {
  color: #fff;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 18px;
}

.ep-footer ul { list-style: none; margin: 0; padding: 0; }
.ep-footer li { margin-bottom: 10px; font-size: 14.5px; }

.ep-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
}

.ep-footer-menu ul { display: flex; gap: 20px; }
.ep-footer-menu li { margin: 0; }

/* Back to top */
.ep-back-top {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--ep-primary);
  color: #fff;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all .25s ease;
  z-index: 999;
  padding: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
}
.ep-back-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.ep-back-top:hover { background: var(--ep-primary-dark); transform: translateY(-3px); }

/* ==========================================================================
   7. Elementor compatibility
   ========================================================================== */
/* Full width canvas for Elementor pages: remove default paddings */
.elementor-page .ep-content { padding: 0; }
.elementor-page .ep-container-content { max-width: none; padding: 0; }

/* Helper classes usable inside Elementor */
.ep-btn-pill { border-radius: var(--ep-radius-pill) !important; }
.ep-bg-hero { background-color: var(--ep-hero-bg) !important; }
.ep-bg-soft { background-color: var(--ep-section-bg) !important; }
.ep-text-orange { color: var(--ep-primary) !important; }

/* ==========================================================================
   8. Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .ep-posts-grid { grid-template-columns: repeat(2, 1fr); }
  .ep-footer-widgets { grid-template-columns: repeat(2, 1fr); }
  .ep-header-search { display: none; }
  .ep-entry-content .alignwide { margin-left: 0; margin-right: 0; max-width: 100%; }
}

@media (max-width: 782px) {
  .ep-menu-toggle { display: block; margin-left: auto; }
  .ep-header-contact { display: none; }
  .ep-header-main { gap: 12px; }

  .ep-nav-wrap { border-top: none; }
  .ep-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--ep-white);
    box-shadow: 0 16px 24px rgba(0,0,0,.09);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
  .ep-nav.open { display: block; }
  .ep-nav ul { flex-direction: column; gap: 0; padding: 8px 0; }
  .ep-nav a { padding: 13px 24px; border-bottom: 1px solid var(--ep-section-bg); }
  .ep-nav ul ul {
    position: static;
    opacity: 1; visibility: visible; transform: none;
    box-shadow: none;
    padding: 0 0 0 16px;
    display: block;
  }

  .ep-posts-grid { grid-template-columns: 1fr; }
  .ep-footer-widgets { grid-template-columns: 1fr; gap: 28px; padding: 40px 0 28px; }
  .ep-footer-bottom { flex-direction: column; text-align: center; }
  h1 { font-size: 1.8rem; }
  .ep-single-title { font-size: 1.7rem; }
}
