/*
 * CSK CMS components. Loaded after styles.css; only adds styles for elements the
 * CMS introduces (products, enquiry forms, etc.) and never restyles the original
 * design. Uses the colour variables and breakpoints (980px / 640px) from styles.css.
 */

/* ---------- Helpers ---------- */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.hp-field{position:absolute!important;left:-9999px;width:1px;height:1px;overflow:hidden}

/* Admin-editable images that the original CSS hard-codes */
.hero[style*="--hero-img"]{background-image:linear-gradient(90deg,#f5f8fc 0%,#f8fbff 44%,transparent 66%),var(--hero-img)}
@media(min-width:981px){.brands[style*="--brand-count"]{grid-template-columns:repeat(var(--brand-count),1fr)}}
.page-hero-image{background:linear-gradient(120deg,rgba(234,242,252,.96),rgba(255,255,255,.86)),var(--page-hero-img) center/cover no-repeat}

/* Footer: keep contact links inline like the original plain text */
.footer a.footer-inline{display:inline;margin:0}
.footer-social{display:flex;flex-wrap:wrap;gap:8px 16px;margin-top:6px}
.footer-social a{display:inline-block;margin:0;font-weight:700;color:#fff}

/* ---------- Rich text from the editor ---------- */
.rich-content>:first-child{margin-top:0}
.rich-content img{border-radius:14px;height:auto;margin:18px 0}
.rich-content a{color:var(--blue2);text-decoration:underline}
.rich-content ul,.rich-content ol{padding-left:22px}
.rich-content blockquote{margin:20px 0;padding:14px 20px;border-left:3px solid var(--orange);background:var(--bg);border-radius:0 12px 12px 0}
.rich-content h2{font-size:clamp(24px,3vw,34px);margin-top:28px}
.rich-content h3{margin-top:24px}
.rich-content iframe{max-width:100%;border:0;border-radius:14px}
.rich-content .ql-align-center{text-align:center}.rich-content .ql-align-right{text-align:right}
.rich-page{max-width:860px}

/* ---------- Products listing ---------- */
.product-toolbar{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:16px 24px;margin-bottom:8px}
.product-toolbar .product-filter{margin-bottom:0}
.product-filter .filter-btn{display:inline-block;line-height:1.3}
.product-search{display:flex;gap:10px;flex-wrap:wrap}
.product-search input,.product-search select{padding:11px 14px;border:1px solid #dce4ee;border-radius:10px;font:inherit;background:#fff;min-width:0;outline:none}
.product-search input:focus,.product-search select:focus{border-color:var(--blue)}
.product-search input{width:220px}
.product-search .btn{padding:11px 18px}
.subcategory-filter{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0 0}
.subcategory-filter a{padding:7px 14px;border-radius:30px;font-size:14px;font-weight:700;color:var(--blue);background:var(--bg);border:1px solid var(--line)}
.subcategory-filter a.active,.subcategory-filter a:hover{background:#fff3eb;border-color:rgba(243,107,33,.45);color:var(--orange)}
.result-count{color:var(--muted);font-size:14px;margin:22px 0}
.result-count a{color:var(--blue2);font-weight:700}

.product-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:22px}
.product-card{display:flex;flex-direction:column}
.product-card-media{display:block;overflow:hidden;background:var(--bg)}
.product-card-media .card-img{transition:transform .4s}
.product-card:hover .product-card-media .card-img{transform:scale(1.04)}
.product-noimg{display:grid;place-items:center;color:var(--muted);font-size:14px;background:var(--bg)}
.product-card .card-body{display:flex;flex-direction:column;flex:1}
.product-card h3{font-size:19px;margin-bottom:8px}
.product-card h3 a:hover{color:var(--orange)}
.product-card .card-body>p{font-size:14.5px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.product-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-bottom:12px}
.product-meta .tag,.product-card .product-meta .tag{display:inline-block;background:#fff3eb;color:var(--orange);font-size:11px;font-weight:800;border-radius:20px;padding:5px 10px;margin:0}
.product-brand{font-size:12px;font-weight:800;letter-spacing:.6px;text-transform:uppercase;color:var(--blue)}
a.product-brand:hover{color:var(--orange)}
.product-card-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-top:auto;padding-top:16px}
.product-price{color:var(--blue);font-weight:800}
.product-link{color:var(--orange);font-weight:800;font-size:14px}
.section-actions{text-align:center;margin-top:36px}
.empty-state{text-align:center;padding:50px 24px;border:1px dashed var(--line);border-radius:var(--radius);background:var(--bg)}
.empty-state p{color:var(--muted);max-width:520px;margin:0 auto 22px}
.pagination{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:40px}
.pagination a{min-width:44px;height:44px;padding:0 14px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:10px;font-weight:700;color:var(--blue);background:#fff}
.pagination a.active,.pagination a:hover{background:var(--blue);border-color:var(--blue);color:#fff}

/* ---------- Product detail ---------- */
.product-detail-head{padding:26px 0 0}
.product-detail-head .breadcrumb a:hover{color:var(--orange)}
.product-detail-section{padding-top:34px}
.product-detail{display:grid;grid-template-columns:1.05fr 1fr;gap:52px;align-items:start}
.product-gallery-main{border-radius:22px;overflow:hidden;background:var(--bg);aspect-ratio:4/3;box-shadow:0 10px 30px rgba(20,58,105,.06)}
.product-gallery-main img,.product-gallery-main .product-noimg{width:100%;height:100%;object-fit:cover}
.product-thumbs{display:flex;gap:10px;margin-top:14px;overflow-x:auto;padding-bottom:4px}
.product-thumbs button{flex:none;width:78px;height:62px;padding:0;border:2px solid transparent;border-radius:11px;overflow:hidden;cursor:pointer;background:var(--bg)}
.product-thumbs button.active{border-color:var(--orange)}
.product-thumbs img{width:100%;height:100%;object-fit:cover}
.product-info h1{font-size:clamp(32px,4vw,48px);letter-spacing:-1px;margin-bottom:10px}
.product-sku{color:var(--muted);font-size:14px;margin:0 0 8px}
.product-price-lg{font-size:24px;margin:0 0 12px}
.product-info .lead{font-size:17px}
.product-info .hero-buttons{margin:24px 0 0}
.btn-whatsapp{background:#25D366;color:#fff}
.btn-whatsapp:hover{background:#1ebe5b;transform:translateY(-2px)}
.product-description{margin-top:60px;padding-top:44px;border-top:1px solid var(--line)}
.product-description.has-specs{display:grid;grid-template-columns:1.4fr 1fr;gap:48px;align-items:start}
.product-description h2{font-size:clamp(26px,3vw,36px)}
.spec-table{width:100%;border-collapse:collapse;background:#fff;border:1px solid var(--line);border-radius:14px;overflow:hidden}
.spec-table th,.spec-table td{text-align:left;padding:12px 16px;border-bottom:1px solid var(--line);vertical-align:top}
.spec-table tr:last-child th,.spec-table tr:last-child td{border-bottom:0}
.spec-table th{width:42%;background:var(--bg);color:var(--blue);font-size:14px}
.product-enquiry{align-items:start}

/* ---------- Enquiry forms ---------- */
.form h3{margin-bottom:12px}
.form-intro{color:var(--muted);margin:0 0 18px}
.form-alert{padding:13px 16px;border-radius:10px;font-weight:600;margin-bottom:18px;font-size:15px}
.form-alert.success{background:#e8f7ee;color:#166c3b;border:1px solid #bfe6cf}
.form-alert.error{background:#fdeeee;color:#a42828;border:1px solid #f3c9c9}
.page-hero .form-alert,.product-detail-head .form-alert{display:inline-block;margin:0 0 14px}
.field small{font-weight:600;color:var(--muted)}
.form button[type=submit]{cursor:pointer;font:inherit;font-weight:700}

/* ---------- Brands page extras ---------- */
.brand-logo-img img{max-height:64px;max-width:80%;width:auto;object-fit:contain}
.brand-actions{display:flex;flex-direction:column;gap:12px}
.brand-links{display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px 14px;font-size:14px;font-weight:800}
.brand-products-link{color:var(--orange)}
.brand-site-link{color:var(--blue)}
.brand-products-link:hover,.brand-site-link:hover{text-decoration:underline}

/* ---------- Responsive ---------- */
@media(max-width:1100px){.product-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:980px){
  .hero[style*="--hero-img"]{background-image:linear-gradient(rgba(245,248,252,.9),rgba(245,248,252,.94)),var(--hero-img)}
  .product-grid{grid-template-columns:repeat(2,1fr)}
  .product-toolbar{flex-direction:column;flex-wrap:nowrap;align-items:stretch}
  .product-toolbar>*{min-width:0;max-width:100%}
  .product-search input{flex:1;width:auto}
  .product-detail{grid-template-columns:1fr;gap:34px}
  .product-description.has-specs{grid-template-columns:1fr;gap:34px}
}
@media(max-width:640px){
  .product-filter{flex-wrap:nowrap;overflow-x:auto;margin-left:-14px;margin-right:-14px;padding:0 14px 6px;scrollbar-width:none}
  .product-filter::-webkit-scrollbar{display:none}
  .product-filter .filter-btn{flex:none;white-space:nowrap}
  .product-search select,.product-search input{flex:1 1 100%}
  .product-search .btn{flex:1}
  .product-grid{grid-template-columns:1fr 1fr;gap:12px}
  .product-card .card-img{height:150px}
  .product-card .card-body{padding:14px}
  .product-card h3{font-size:16px}
  .product-card .card-body>p{display:none}
  .product-card-foot{padding-top:10px}
  .product-link{font-size:13px}
  .product-detail-section{padding-top:22px}
  .product-description{margin-top:40px;padding-top:32px}
  .product-info .hero-buttons .btn{flex:1}
  .form{padding:24px 20px}
  .pagination a{min-width:40px;height:40px}
}
@media(max-width:380px){.product-grid{grid-template-columns:1fr}.product-card .card-img{height:200px}.product-card .card-body>p{display:-webkit-box}}
