/*
   Shields Store — Custom CSS
   Design: Luxury / Prestige / Clean Utility
   Colors: Navy #002B5B | Gold #C5A059 | Orange CTA #FF4E00
*/

:root {
    --primary-color:   #002B5B;
    --secondary-color: #C5A059;
    --accent-color:    #FF4E00;
    --bg-light:        #F8F9FA;
    --text-dark:       #1A1A1A;
    --text-muted:      #6C757D;
    --font-main:       'Cairo', sans-serif;
    --radius-card:     16px;
    --shadow-card:     0 4px 20px rgba(0,43,91,.08);
    --transition:      .25s ease;
}

/* ── Base ─────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
body {
    font-family: var(--font-main);
    color: var(--text-dark);
    background: #fff;
    overflow-x: hidden;
}
h1,h2,h3,h4,h5,h6 { font-weight: 700; }
a { transition: color var(--transition); }
img { max-width: 100%; }
.object-fit-contain { object-fit: contain; }
.object-fit-cover   { object-fit: cover; }
.cursor-pointer     { cursor: pointer; }

/* ── Bootstrap overrides ─────────────────────────────────────── */
.text-primary  { color: var(--primary-color)   !important; }
.text-secondary{ color: var(--secondary-color) !important; }
.bg-primary    { background: var(--primary-color)   !important; }
.bg-secondary  { background: var(--secondary-color) !important; }

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}
.btn-primary:hover,
.btn-primary:focus {
    background: #001f42;
    border-color: #001f42;
}
.btn-secondary {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
    font-weight: 600;
}
.btn-secondary:hover { background: #b38f4d; border-color: #b38f4d; color:#fff; }

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-outline-primary:hover {
    background: var(--primary-color);
    color: #fff;
}

/* ── Top Bar ──────────────────────────────────────────────────── */
.top-bar { position: relative; z-index: 1050; font-size: .85rem; }
.top-bar .dropdown-menu { z-index: 1060 !important; }

/* ── Navbar ───────────────────────────────────────────────────── */
.navbar { z-index: 1040; }
.navbar-brand { font-size: 1.5rem !important; font-weight: 900; letter-spacing: -0.5px; }
.nav-link { font-weight: 600; padding: .5rem .9rem !important; color: var(--text-dark) !important; }
.nav-link:hover, .nav-link.active { color: var(--primary-color) !important; }
#cart-count { font-size: .65rem; min-width: 18px; height: 18px; line-height: 18px; padding: 0 4px; }

/* ── Hero Slider ──────────────────────────────────────────────── */
.hero-img {
    height: 80vh;
    object-fit: cover;
    filter: brightness(.55);
}
@media (max-width: 768px) { .hero-img { height: 55vh; } }
.carousel-caption {
    inset: 0; padding: 0;
    display: flex; align-items: center; justify-content: center;
}
.carousel-caption .display-4 { font-size: clamp(1.6rem, 4vw, 3rem); }

/* ── Section Divider ──────────────────────────────────────────── */
.section-divider {
    width: 56px; height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
    margin-top: 8px;
}

/* ── Category Card ────────────────────────────────────────────── */
.category-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-card);
    transition: transform var(--transition), box-shadow var(--transition);
}
.category-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-card); }
.category-img {
    width: 100%; height: 160px; object-fit: cover;
    transition: transform .4s ease;
}
.category-card:hover .category-img { transform: scale(1.06); }
.category-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,43,91,.8) 0%, transparent 60%);
}

/* ── Product Card ─────────────────────────────────────────────── */
.product-card {
    border-radius: var(--radius-card) !important;
    transition: transform var(--transition), box-shadow var(--transition);
    overflow: hidden;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-card); }
.product-img-wrapper { overflow: hidden; aspect-ratio: 1/1; background: var(--bg-light); }
.product-img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .product-img { transform: scale(1.05); }
.badge-new {
    position: absolute; top: 10px;
    inset-inline-start: 10px;
    background: var(--secondary-color);
    color: #fff; font-size: .72rem; font-weight: 700;
    padding: 3px 10px; border-radius: 20px;
    z-index: 2;
}

/* ── Product Detail Gallery ───────────────────────────────────── */
.main-img-wrapper { cursor: zoom-in; }
.thumb-img { cursor: pointer; transition: border-color var(--transition); }
.thumb-img:hover { border-color: var(--primary-color) !important; }

/* ── Price Block ──────────────────────────────────────────────── */
.price-block .display-6 { font-size: 2rem; }

/* ── Cart Table ───────────────────────────────────────────────── */
.table th { font-weight: 600; white-space: nowrap; }

/* ── Checkout Steps ───────────────────────────────────────────── */
.checkout-step-badge {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}

/* ── Footer ───────────────────────────────────────────────────── */
footer { font-size: .9rem; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a {
    color: rgba(255,255,255,.65);
    text-decoration: none;
    transition: color var(--transition);
}
.footer-links a:hover { color: var(--secondary-color); }

/* ── WhatsApp Float ───────────────────────────────────────────── */
.whatsapp-float {
    position: fixed;
    bottom: 28px;
    inset-inline-end: 24px;
    width: 56px; height: 56px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 16px rgba(37,211,102,.4);
    z-index: 9999;
    text-decoration: none;
    transition: transform var(--transition), box-shadow var(--transition);
}
.whatsapp-float:hover {
    transform: scale(1.12);
    color: #fff;
    box-shadow: 0 6px 24px rgba(37,211,102,.5);
}

/* ── Toast ────────────────────────────────────────────────────── */
#toast-container .toast { min-width: 260px; }

/* ── Success Icon ─────────────────────────────────────────────── */
.fa-circle-check { color: #198754; }

/* ── Badges ───────────────────────────────────────────────────── */
.bg-success-subtle { background: rgba(25,135,84,.12) !important; }
.bg-danger-subtle  { background: rgba(220,53,69,.12) !important; }

/* ── Pagination ───────────────────────────────────────────────── */
.page-link { color: var(--primary-color); }
.page-item.active .page-link { background: var(--primary-color); border-color: var(--primary-color); }

/* ── Sticky fix for RTL ───────────────────────────────────────── */
[dir="rtl"] .badge-new { right: 10px; left: auto; }
[dir="ltr"] .badge-new { left: 10px; right: auto; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 576px) {
    .top-bar .top-bar-left { display: none; }
    .section-heading { font-size: 1.3rem; }
    .display-6 { font-size: 1.4rem; }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE & PRODUCT PAGE IMPROVEMENTS
   ══════════════════════════════════════════════════ */

/* ── Product main image ─────────────────────────────── */
.product-main-img-wrap {
    position: relative;
    overflow: hidden;
}
.product-main-img-wrap img {
    transition: transform .4s ease;
}
.product-main-img-wrap:hover img {
    transform: scale(1.04);
}

/* ── Sticky mobile add-to-cart bar ──────────────────── */
.product-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 16px;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(8px);
    box-shadow: 0 -2px 20px rgba(0,0,0,.12);
    z-index: 1030;
    border-top: 1px solid rgba(0,43,91,.08);
}
/* Keep space for the sticky bar on mobile */
@media (max-width: 991px) {
    .product-action-btns { margin-bottom: 0 !important; }
    body { padding-bottom: 72px; }
}
@media (min-width: 992px) {
    .product-sticky-bar { display: none !important; }
    body { padding-bottom: 0; }
}

/* ── Variant buttons responsive ─────────────────────── */
#variant-btns, #color-options, #size-options {
    gap: 8px !important;
}
.color-choice, .size-choice {
    min-width: 40px;
    min-height: 40px;
}

/* ── Product gallery thumbnails ─────────────────────── */
.thumb-btn {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    transition: border-color .2s, transform .2s;
}
.thumb-btn:hover, .thumb-btn:focus {
    border-color: var(--primary-color) !important;
    transform: scale(1.05);
}
@media (max-width: 991px) {
    .thumb-btn { width: 58px; height: 58px; }
}

/* ── Product price ──────────────────────────────────── */
@media (max-width: 576px) {
    [style*="font-size:2.6rem"] { font-size: 2rem !important; }
    [style*="font-size:2.35rem"] { font-size: 1.6rem !important; }
}

/* ── Cards responsive ───────────────────────────────── */
@media (max-width: 576px) {
    .product-card .card-body { padding: 0.6rem !important; }
    .product-card h6 { font-size: .8rem !important; }
    .product-card .fs-5 { font-size: .95rem !important; }
    .hero-img { height: 50vh !important; }
    .carousel-caption .display-4 { font-size: 1.4rem !important; }
}

/* ── Navbar on small screens ────────────────────────── */
@media (max-width: 576px) {
    .top-bar .top-bar-left { display: none; }
    .navbar-brand { font-size: 1.2rem !important; }
}

/* ── Cart table responsive ──────────────────────────── */
@media (max-width: 768px) {
    .table-responsive table thead { display: none; }
    .table-responsive table tr { display: block; border: 1px solid #dee2e6; border-radius: 12px; margin-bottom: 1rem; padding: .5rem; }
    .table-responsive table td { display: flex; justify-content: space-between; align-items: center; padding: .4rem .5rem; border: none !important; }
}

/* ── Checkout form mobile ───────────────────────────── */
@media (max-width: 768px) {
    #step-1 .card, #step-2 .card { padding: 1rem !important; }
}

/* ── WhatsApp float position on mobile ─────────────── */
@media (max-width: 991px) {
    .whatsapp-float { bottom: 86px; }
}

/* ── Home page features bar ─────────────────────────── */
@media (max-width: 576px) {
    .bg-primary.py-4 .row .col-6 { text-align: center; }
}

/* ── PWA install banner (if shown) ─────────────────── */
#pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-color);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1040;
    box-shadow: 0 -3px 15px rgba(0,0,0,.15);
}
#pwa-install-banner.hidden { display: none; }

/* ── CMS Pages ──────────────────────────────────────────────── */
.cms-page-content {
    line-height: 1.85;
    font-size: 1rem;
    color: #374151;
}
.cms-page-content h1,.cms-page-content h2,.cms-page-content h3 {
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: .75rem;
}
.cms-page-content p { margin-bottom: 1rem; }
.cms-page-content ul,.cms-page-content ol {
    padding-inline-start: 1.5rem;
    margin-bottom: 1rem;
}
.cms-page-content li { margin-bottom: .4rem; }
.cms-page-content a { color: var(--primary-color); }
.cms-page-content a:hover { text-decoration: underline; }

/* ── CMS Pages ───────────────────────────────────────── */
.cms-page-content {
    line-height: 1.85;
    font-size: 1rem;
    color: #374151;
}
.cms-page-content h1,.cms-page-content h2,.cms-page-content h3 {
    font-weight:700;color:var(--primary-color);margin-top:2rem;margin-bottom:.75rem;
}
.cms-page-content p { margin-bottom:1rem; }
.cms-page-content ul,.cms-page-content ol { padding-inline-start:1.5rem;margin-bottom:1rem; }
.cms-page-content li { margin-bottom:.4rem; }
.cms-page-content a { color:var(--primary-color); }
.cms-page-content a:hover { text-decoration:underline; }


/* ── Final mobile hardening ───────────────────────────────────────── */
@media (max-width: 991.98px) {
  .top-bar { display:none; }
  .navbar-brand { font-size: 1.9rem !important; display:flex; align-items:center; gap:.35rem; max-width:70vw; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .navbar .container { padding-inline: 14px; }
  .nav-link { padding: .75rem 0 !important; }
  footer .row > div { text-align:center; }
  footer .social-links, footer .payment-methods { justify-content:center; }
  .hero-img { height: 42vh; }
  .category-img { height: 120px; }
  .card.product-card .card-body { padding:.9rem; }
  .btn, .form-control, .form-select { min-height: 44px; }
  .whatsapp-float { width:52px; height:52px; bottom:18px; inset-inline-end:16px; }
}

@media (max-width: 767.98px) {
  .container { padding-inline: 14px; }
  h1, .h1 { font-size: 1.75rem; }
  h2, .h2 { font-size: 1.35rem; }
  .display-6 { font-size: 1.2rem; }
  .product-main-img-wrap, .product-main-img-wrap img { border-radius: 16px !important; }
  .thumb-btn { width: 64px; }
  #color-options, #size-options, #variant-btns { gap: 6px !important; }
  .color-choice, .size-choice { min-width: 44px; min-height: 44px; }
  .product-card .btn { font-size: .92rem; }
  .breadcrumb { font-size: .85rem; }
}

@media (max-width: 575.98px) {
  body { font-size: 15px; }
  .navbar-brand img { height: 32px !important; }
  .navbar-brand span { font-size: 1rem; }
  .section-divider { width: 44px; }
  .product-img-wrapper { aspect-ratio: 1 / 1.08; }
  .table { font-size: .9rem; }
  .cms-page-content { font-size: .98rem; line-height: 1.85; }
}
