/*
Theme Name: Spark Electrical Solutions
Theme URI: https://sparkelectrical.com
Author: Spark Electrical Solutions
Description: A Google My Business style profile theme for Spark Electrical Solutions - Electrician in Coimbatore, Tamil Nadu.
Version: 2.0.0
License: GNU General Public License v2 or later
Text Domain: spark-electrical
Tags: electrician, business, one-page, responsive, mobile-friendly
*/

/* ================================================================
   SPARK ELECTRICAL SOLUTIONS - OPTIMIZED THEME v2.0
   Mobile-First · Fast Loading · Accessible
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #1a73e8;
  --blue-light: #e8f0fe;
  --green: #188038;
  --green-light: #e6f4ea;
  --red: #d93025;
  --yellow: #f9ab00;
  --gray1: #202124;
  --gray2: #3c4043;
  --gray3: #5f6368;
  --gray4: #80868b;
  --gray5: #bdc1c6;
  --gray6: #dadce0;
  --gray7: #f1f3f4;
  --gray8: #f8f9fa;
  --white: #ffffff;
  --shadow1: 0 1px 2px rgba(60,64,67,.3), 0 2px 6px rgba(60,64,67,.15);
  --shadow2: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px rgba(60,64,67,.15);
  --radius: 8px;
  --header-h: 56px;
}

html { scroll-behavior: smooth; overflow-y: scroll; }

body {
  font-family: 'Roboto', Arial, sans-serif;
  background: var(--gray7);
  color: var(--gray1);
  font-size: 14px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;
  padding-bottom: 70px;
}

@media (min-width: 769px) { body { padding-bottom: 0; } }

/* Skip link */
.skip-link { position: absolute; top: -40px; left: 0; background: var(--blue); color: white; padding: 8px 16px; z-index: 1000; border-radius: 0 0 4px 0; font-size: 14px; text-decoration: none; transition: top 0.2s; }
.skip-link:focus { top: 0; }

body.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }

/* === HEADER === */
.site-header { background: var(--white); padding: 8px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--gray6); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow1); min-height: var(--header-h); }

.site-branding { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.site-branding .brand-logo { width: 36px; height: 36px; background: linear-gradient(135deg, #1a1a1a, #333); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.site-branding .brand-logo svg { width: 22px; height: 22px; }
.site-title { font-family: 'Google Sans', 'Roboto', Arial, sans-serif; font-size: 15px; font-weight: 700; color: var(--gray1); line-height: 1.1; }
.site-title span { color: var(--blue); }

.header-search { flex: 1; max-width: 500px; display: flex; align-items: center; background: var(--gray7); border: 1px solid var(--gray6); border-radius: 24px; padding: 7px 16px; gap: 8px; }
.header-search input { flex: 1; border: none; background: transparent; font-size: 16px; color: var(--gray1); outline: none; font-family: 'Roboto', Arial, sans-serif; }
.header-search svg { color: var(--gray3); flex-shrink: 0; }

.header-call-btn { margin-left: auto; background: var(--blue); color: white; border: none; border-radius: 6px; padding: 8px 16px; font-family: 'Google Sans', 'Roboto', Arial, sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; display: flex; align-items: center; gap: 6px; white-space: nowrap; transition: background 0.15s; flex-shrink: 0; min-height: 40px; min-width: 44px; }
.header-call-btn:hover { background: #1557b0; color: white; }
.header-call-btn svg { width: 15px; height: 15px; }

@media (max-width: 768px) { .header-search { display: none; } }
@media (max-width: 380px) { .header-call-btn span { display: none; } }

/* === PAGE LAYOUT - Mobile first === */
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 0; display: flex; flex-direction: column; gap: 0; }

@media (min-width: 769px) { .page-wrap { padding: 16px; display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; } }
@media (min-width: 961px) { .page-wrap { grid-template-columns: 400px 1fr; } }

/* === PROFILE CARD === */
.profile-card { background: var(--white); overflow: hidden; border-bottom: 8px solid var(--gray7); }
@media (min-width: 769px) { .profile-card { border-radius: var(--radius); box-shadow: var(--shadow1); border-bottom: none; position: sticky; top: calc(var(--header-h) + 16px); } }

.cover-banner { width: 100%; height: 130px; overflow: hidden; position: relative; background: var(--gray7); }
@media (min-width: 769px) { .cover-banner { height: 140px; } }
.cover-banner img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }

.biz-logo-wrap { display: flex; align-items: flex-end; gap: 12px; padding: 0 20px; margin-top: -24px; position: relative; z-index: 2; }
.biz-logo { width: 64px; height: 64px; background: linear-gradient(135deg, #1a1a1a, #333); border: 3px solid var(--white); border-radius: 12px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow1); flex-shrink: 0; overflow: hidden; }
.biz-logo img { width: 100%; height: 100%; object-fit: cover; }
.biz-logo svg { width: 34px; height: 34px; }

.biz-info { padding: 12px 20px 16px; }
.biz-name { font-family: 'Google Sans', 'Roboto', Arial, sans-serif; font-size: 20px; font-weight: 700; color: var(--gray1); line-height: 1.2; margin-bottom: 2px; }
@media (min-width: 769px) { .biz-name { font-size: 22px; } }
@media (max-width: 380px) { .biz-name { font-size: 16px; } }

.biz-category { font-size: 13px; color: var(--gray3); margin-bottom: 8px; }
.rating-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.rating-score { font-weight: 700; font-size: 15px; color: var(--gray1); }
.stars-inline { display: flex; gap: 1px; }
.star { color: var(--yellow); font-size: 14px; }
.rating-count { font-size: 13px; color: var(--blue); cursor: pointer; text-decoration: none; }
.rating-count:hover { text-decoration: underline; }
.status-row { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.open-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; display: inline-block; flex-shrink: 0; }
.open-badge { font-size: 13px; font-weight: 500; color: var(--green); }
.close-time { font-size: 13px; color: var(--gray2); }
.emergency-tag { background: #fce8e6; color: var(--red); font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 12px; }

/* Action buttons */
.action-buttons { display: flex; gap: 8px; padding: 0 20px 16px; flex-wrap: wrap; }
.action-btn { flex: 1; min-width: 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px 8px; background: var(--blue-light); border: none; border-radius: var(--radius); color: var(--blue); font-family: 'Google Sans', 'Roboto', Arial, sans-serif; font-size: 12px; font-weight: 500; cursor: pointer; transition: background 0.15s; text-decoration: none; min-height: 52px; }
.action-btn:hover { background: #d2e3fc; color: var(--blue); }
.action-btn svg { width: 20px; height: 20px; }
.action-btn.primary-btn { background: var(--blue); color: white; }
.action-btn.primary-btn:hover { background: #1557b0; color: white; }

.divider { height: 1px; background: var(--gray6); margin: 0 20px; }

/* Info list */
.info-list { padding: 12px 0; }
.info-item { display: flex; align-items: flex-start; gap: 14px; padding: 10px 20px; transition: background 0.15s; min-height: 44px; }
.info-item:hover { background: var(--gray7); }
.info-icon { flex-shrink: 0; color: var(--gray3); margin-top: 2px; }
.info-icon svg { width: 18px; height: 18px; }
.info-content { flex: 1; min-width: 0; }
.info-main { font-size: 14px; color: var(--gray1); line-height: 1.5; word-break: break-word; }
.info-main a { color: var(--blue); text-decoration: none; }
.info-main a:hover { text-decoration: underline; }
.info-sub { font-size: 12px; color: var(--gray3); margin-top: 1px; }

/* Hours */
.hours-toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; color: var(--gray1); width: 100%; background: none; border: none; text-align: left; padding: 0; font-family: 'Roboto', Arial, sans-serif; line-height: 1.5; }
.hours-toggle .chevron { margin-left: auto; color: var(--gray3); transition: transform 0.2s; flex-shrink: 0; }
.hours-toggle.open .chevron { transform: rotate(180deg); }
.hours-table { display: none; margin-top: 8px; font-size: 13px; }
.hours-table.show { display: block; }
.hours-row { display: flex; justify-content: space-between; padding: 3px 0; color: var(--gray2); gap: 8px; }
.hours-row.today { font-weight: 500; color: var(--gray1); }
.hours-row .day { width: 90px; flex-shrink: 0; }

/* Popular times */
.pop-times { padding: 12px 20px 16px; }
.pop-times-label { font-size: 12px; color: var(--gray3); margin-bottom: 10px; font-weight: 500; letter-spacing: 0.3px; }
.bars-row { display: flex; align-items: flex-end; gap: 3px; height: 40px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bar { width: 100%; border-radius: 3px 3px 0 0; background: var(--blue-light); }
.bar.current { background: var(--blue); }
.bar-hour { font-size: 9px; color: var(--gray4); }

/* Map */
.map-section { padding: 12px 20px 16px; }
.map-embed { width: 100%; height: 140px; background: linear-gradient(135deg, #e8f0fe, #d2e3fc); border-radius: var(--radius); position: relative; overflow: hidden; cursor: pointer; }
.map-embed iframe { width: 100%; height: 100%; border: none; border-radius: var(--radius); }
.map-grid-overlay { position: absolute; inset: 0; background-image: linear-gradient(rgba(26,115,232,0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(26,115,232,0.1) 1px, transparent 1px); background-size: 28px 28px; pointer-events: none; }
.directions-btn-overlay { position: absolute; bottom: 10px; right: 10px; background: white; border: none; border-radius: 4px; padding: 8px 12px; font-size: 13px; font-weight: 500; color: var(--blue); cursor: pointer; box-shadow: var(--shadow1); font-family: 'Google Sans', 'Roboto', Arial, sans-serif; display: flex; align-items: center; gap: 5px; text-decoration: none; min-height: 40px; }

/* === RIGHT COLUMN === */
.right-col { display: flex; flex-direction: column; gap: 0; }
@media (min-width: 769px) { .right-col { gap: 16px; } }

.section-card { background: var(--white); overflow: hidden; border-bottom: 8px solid var(--gray7); }
@media (min-width: 769px) { .section-card { border-radius: var(--radius); box-shadow: var(--shadow1); border-bottom: none; } }

.section-header { padding: 16px 20px 12px; display: flex; align-items: center; justify-content: space-between; }
.section-title { font-family: 'Google Sans', 'Roboto', Arial, sans-serif; font-size: 16px; font-weight: 500; color: var(--gray1); }
.see-all-btn { font-size: 13px; color: var(--blue); background: none; border: none; cursor: pointer; font-family: 'Roboto', Arial, sans-serif; font-weight: 500; padding: 6px 8px; border-radius: 4px; transition: background 0.15s; text-decoration: none; min-height: 36px; display: flex; align-items: center; }
.see-all-btn:hover { background: var(--blue-light); color: var(--blue); }

/* Photo grid */
.photo-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 110px 110px; gap: 2px; }
@media (min-width: 500px) { .photo-grid { grid-template-rows: 120px 120px; } }
.photo-cell { overflow: hidden; position: relative; cursor: pointer; background: var(--gray7); }
.photo-cell:first-child { grid-row: 1 / 3; }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.photo-cell:hover img { transform: scale(1.05); }
.photo-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.15); opacity: 0; transition: opacity 0.2s; }
.photo-cell:hover .photo-overlay { opacity: 1; }
.photo-more-btn { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.65); color: white; border: none; border-radius: 4px; padding: 6px 10px; font-size: 12px; font-weight: 500; cursor: pointer; font-family: 'Roboto', Arial, sans-serif; }

/* Services chips */
.services-chips { padding: 0 20px 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--gray7); border: 1px solid var(--gray6); border-radius: 20px; font-size: 13px; color: var(--gray1); cursor: pointer; transition: all 0.15s; min-height: 36px; text-decoration: none; }
.chip:hover { background: var(--blue-light); border-color: var(--blue); color: var(--blue); }
.chip svg { width: 14px; height: 14px; color: var(--blue); flex-shrink: 0; }

/* Reviews */
.reviews-summary { padding: 0 20px 12px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.big-score { font-size: 48px; font-family: 'Google Sans', 'Roboto', Arial, sans-serif; font-weight: 300; color: var(--gray1); line-height: 1; }
@media (min-width: 400px) { .big-score { font-size: 52px; } }
.score-right { flex: 1; min-width: 100px; }
.stars-big { display: flex; gap: 2px; margin-bottom: 4px; }
.stars-big .star { font-size: 18px; }
.total-reviews { font-size: 13px; color: var(--gray3); }
.rating-bars { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 100px; }
.rbar-row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--blue); cursor: pointer; }
.rbar-bg { flex: 1; height: 8px; background: var(--gray6); border-radius: 4px; overflow: hidden; }
.rbar-fill { height: 100%; background: var(--yellow); border-radius: 4px; }
.rbar-label { width: 8px; text-align: right; font-weight: 500; }

.reviews-filter-row { padding: 8px 20px 12px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.reviews-filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex-shrink: 0; padding: 7px 14px; border: 1px solid var(--gray6); border-radius: 20px; font-size: 13px; background: var(--white); color: var(--gray1); cursor: pointer; transition: all 0.15s; min-height: 36px; display: flex; align-items: center; white-space: nowrap; }
.filter-chip.active { background: var(--blue-light); border-color: var(--blue); color: var(--blue); }
.filter-chip:hover { background: var(--gray7); }

.write-review-box { padding: 14px 20px; border-top: 1px solid var(--gray6); display: flex; align-items: center; gap: 12px; }
.wr-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue); display: flex; align-items: center; justify-content: center; color: white; font-size: 14px; font-weight: 500; flex-shrink: 0; }
.wr-label { font-size: 13px; color: var(--gray3); margin-bottom: 6px; }
.wr-stars { display: flex; gap: 4px; }
.wr-star { font-size: 28px; color: var(--gray5); cursor: pointer; transition: color 0.1s; line-height: 1; }
.wr-star:hover, .wr-star.lit { color: var(--yellow); }

.review-item { padding: 14px 20px; border-top: 1px solid var(--gray6); transition: background 0.15s; }
.review-item:hover { background: var(--gray8); }
.review-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.reviewer-pic { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Google Sans', 'Roboto', Arial, sans-serif; font-size: 14px; font-weight: 700; color: white; flex-shrink: 0; }
.reviewer-info { flex: 1; min-width: 0; }
.reviewer-name { font-size: 14px; font-weight: 500; color: var(--gray1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reviewer-meta { font-size: 12px; color: var(--gray3); }
.review-stars { display: flex; gap: 1px; margin-bottom: 5px; }
.review-stars .star { font-size: 12px; }
.review-text { font-size: 14px; color: var(--gray2); line-height: 1.6; }
.review-text .more-link { color: var(--blue); cursor: pointer; }
.owner-response { margin-top: 10px; background: var(--gray7); border-radius: 8px; padding: 10px 12px; }
.owner-response-label { font-size: 12px; font-weight: 500; color: var(--gray1); margin-bottom: 4px; }
.owner-response-text { font-size: 13px; color: var(--gray2); line-height: 1.5; }
.review-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.review-action-btn { display: flex; align-items: center; gap: 4px; background: none; border: none; font-size: 12px; color: var(--gray3); cursor: pointer; padding: 6px 8px; border-radius: 4px; font-family: 'Roboto', Arial, sans-serif; transition: background 0.15s; min-height: 36px; }
.review-action-btn:hover { background: var(--gray6); color: var(--gray1); }
.review-action-btn svg { width: 14px; height: 14px; }

/* Contact form */
.contact-form-wrap { padding: 16px 20px 20px; }
.spark-contact-form .form-row { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 500px) { .spark-contact-form .form-row { grid-template-columns: 1fr 1fr; gap: 12px; } }
.spark-contact-form .form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.spark-contact-form label { font-size: 12px; font-weight: 500; color: var(--gray3); letter-spacing: 0.04em; }
.spark-contact-form input,
.spark-contact-form select,
.spark-contact-form textarea {
  border: 1px solid var(--gray6); border-radius: 6px; padding: 11px 12px;
  font-family: 'Roboto', Arial, sans-serif; font-size: 16px; color: var(--gray1);
  outline: none; background: var(--gray8); transition: border-color 0.2s, background 0.2s;
  width: 100%; -webkit-appearance: none; appearance: none;
}
.spark-contact-form select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235f6368' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.spark-contact-form input:focus,
.spark-contact-form select:focus,
.spark-contact-form textarea:focus { border-color: var(--blue); background: white; box-shadow: 0 0 0 2px rgba(26,115,232,0.15); }
.spark-contact-form textarea { resize: vertical; min-height: 90px; }
.spark-contact-form .submit-btn { width: 100%; background: var(--blue); color: white; border: none; border-radius: 6px; padding: 13px; font-family: 'Google Sans', 'Roboto', Arial, sans-serif; font-size: 15px; font-weight: 500; cursor: pointer; transition: background 0.2s; margin-top: 4px; min-height: 48px; }
.spark-contact-form .submit-btn:hover { background: #1557b0; }
.spark-contact-form .submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }

/* Toast */
.spark-toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(30px); background: var(--gray1); color: white; padding: 12px 20px; border-radius: var(--radius); font-size: 14px; z-index: 9999; transition: transform 0.3s ease, opacity 0.3s ease; box-shadow: var(--shadow2); white-space: nowrap; max-width: calc(100vw - 32px); text-align: center; opacity: 0; pointer-events: none; }
.spark-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
@media (min-width: 769px) { .spark-toast { bottom: 24px; } }

/* Footer */
.site-footer { background: var(--white); border-top: 1px solid var(--gray6); padding: 20px 16px; }
@media (min-width: 769px) { .site-footer { padding: 24px 16px; margin-top: 24px; } }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
@media (max-width: 600px) { .footer-inner { flex-direction: column; align-items: flex-start; } }
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-brand-logo { width: 28px; height: 28px; background: linear-gradient(135deg,#1a1a1a,#333); border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.footer-brand-logo svg { width: 16px; height: 16px; }
.footer-brand-name { font-family: 'Google Sans', 'Roboto', Arial, sans-serif; font-size: 14px; font-weight: 600; color: var(--gray1); }
.footer-brand-name span { color: var(--blue); }
.footer-copy { font-size: 12px; color: var(--gray3); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: 12px; color: var(--blue); text-decoration: none; padding: 4px 0; }
.footer-links a:hover { text-decoration: underline; }

/* Mobile sticky bar */
.mobile-sticky-bar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 200; background: var(--white); border-top: 1px solid var(--gray6); padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); gap: 10px; box-shadow: 0 -2px 8px rgba(0,0,0,0.1); }
@media (min-width: 769px) { .mobile-sticky-bar { display: none; } }
.mob-btn { flex: 1; padding: 12px; border-radius: 6px; border: none; font-family: 'Google Sans', 'Roboto', Arial, sans-serif; font-size: 14px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; min-height: 46px; }
.mob-btn.call { background: var(--blue); color: white; }
.mob-btn.call:hover { background: #1557b0; color: white; }
.mob-btn.whatsapp { background: #25D366; color: white; }
.mob-btn.whatsapp:hover { background: #128C7E; color: white; }
.mob-btn.dir { background: var(--gray7); color: var(--blue); border: 1px solid var(--gray6); }

/* WP defaults */
.widget { margin-bottom: 20px; }
.widget-title { font-family: 'Google Sans', 'Roboto', Arial, sans-serif; font-size: 15px; font-weight: 600; color: var(--gray1); margin-bottom: 10px; }
.alignleft { float: left; margin-right: 1.5em; }
.alignright { float: right; margin-left: 1.5em; }
.aligncenter { display: block; margin: 0 auto; }

/* Scrollbar (desktop only) */
@media (min-width: 769px) {
  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--gray5); border-radius: 3px; }
}

/* Print */
@media print {
  .site-header, .mobile-sticky-bar, .action-buttons, .pop-times { display: none !important; }
  .page-wrap { display: block; }
  .profile-card, .section-card { box-shadow: none; border: 1px solid #ccc; margin-bottom: 16px; }
}
