/* ── Beacon Harbor – Main Stylesheet ─────────────────────────────────── */

:root {
  --navy:       #1a2f4e;
  --navy-light: #243d62;
  --gold:       #c9a84c;
  --gold-light: #e8c87a;
  --cream:      #faf8f4;
  --text:       #2c3e50;
  --text-light: #6c757d;
  --border:     #dee2e6;
  --white:      #ffffff;
  --success:    #27ae60;
  --danger:     #e74c3c;
  --info:       #3498db;
  --font-sans:  'Segoe UI', system-ui, -apple-system, sans-serif;
  --shadow-sm:  0 2px 4px rgba(26,47,78,.08);
  --shadow-md:  0 4px 12px rgba(26,47,78,.15);
  --radius:     6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-sans); color: var(--text); background: var(--cream); line-height: 1.7; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--navy); }

/* ── Typography ─────────────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; color: var(--navy); margin-bottom: .5em; }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
p  { margin-bottom: 1rem; }

/* ── Layout ──────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* ── Header ──────────────────────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  color: var(--white);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding-top: .75rem; padding-bottom: .75rem; }
.site-logo { display: flex; align-items: center; gap: .6rem; color: var(--white); font-size: 1.25rem; font-weight: 700; }
.site-logo span { color: var(--gold); }
.site-logo .anchor-icon { font-size: 1.5rem; }

.site-nav { display: flex; align-items: center; gap: 1.75rem; list-style: none; }
.site-nav a { color: rgba(255,255,255,.85); font-size: .9rem; font-weight: 500; padding: .25rem 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.site-nav a:hover, .site-nav a.active { color: var(--gold); border-color: var(--gold); }

/* Cart icon in nav */
.nav-cart { position: relative; }
.cart-icon { font-size: 1.3rem; color: rgba(255,255,255,.85); }
.cart-count-badge {
  position: absolute; top: -8px; right: -10px;
  background: var(--gold); color: var(--navy);
  font-size: .6rem; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 50%; display: none;
  align-items: center; justify-content: center;
}

/* Header cart dropdown */
.header-cart-dropdown {
  position: relative;
}
.header-cart-panel {
  display: none;
  position: absolute; right: 0; top: calc(100% + .75rem);
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  width: 300px; z-index: 200;
}
.header-cart-dropdown:hover .header-cart-panel { display: block; }
#header-cart-items { list-style: none; max-height: 280px; overflow-y: auto; padding: .5rem 0; }
.cart-empty { padding: 1.5rem; text-align: center; color: var(--text-light); font-size: .9rem; }
.cart-item { display: flex; align-items: center; gap: .5rem; padding: .5rem 1rem; }
.cart-item img { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.cart-item-info { flex: 1; font-size: .82rem; }
.cart-item-info a { color: var(--text); }
.cart-item-info span { color: var(--text-light); display: block; }
.cart-remove { background: none; border: none; cursor: pointer; color: var(--danger); font-size: 1.1rem; padding: 0 .25rem; }
#header-cart-total { padding: .75rem 1rem; border-top: 1px solid var(--border); font-size: .9rem; }
.cart-subtotal-row { display: flex; justify-content: space-between; margin-bottom: .5rem; font-weight: 600; }
.btn-checkout-small { display: block; text-align: center; background: var(--gold); color: var(--navy); padding: .5rem; border-radius: var(--radius); font-weight: 700; font-size: .85rem; }
.btn-checkout-small:hover { background: var(--gold-light); color: var(--navy); }

/* ── Page sections ───────────────────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white); padding: 4rem 0 3rem;
  text-align: center;
}
.page-hero h1 { color: var(--white); font-size: 2.6rem; }
.page-hero p { color: rgba(255,255,255,.8); font-size: 1.15rem; max-width: 640px; margin: .75rem auto 0; }

/* ── Two-column layout (content + sidebar) ───────────────────────────── */
.content-with-sidebar { display: grid; grid-template-columns: 1fr 280px; gap: 2.5rem; padding: 3rem 0; }
@media(max-width:768px) { .content-with-sidebar { grid-template-columns: 1fr; } }

/* ── Posts ───────────────────────────────────────────────────────────── */
.post-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 2rem;
  transition: box-shadow .2s;
}
.post-card:hover { box-shadow: var(--shadow-md); }
.post-card-body { padding: 1.5rem; }
.post-meta { font-size: .8rem; color: var(--text-light); margin-bottom: .5rem; }
.post-card h2 { font-size: 1.3rem; margin-bottom: .4rem; }
.post-card h2 a { color: var(--navy); }
.post-card h2 a:hover { color: var(--gold); }
.post-excerpt { color: var(--text-light); font-size: .92rem; margin-bottom: 1rem; }
.read-more { font-size: .85rem; font-weight: 600; color: var(--gold); }
.post-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .75rem; }
.tag-badge { background: var(--cream); border: 1px solid var(--border); border-radius: 20px; padding: .15rem .65rem; font-size: .75rem; color: var(--text-light); }

/* ── Single post ─────────────────────────────────────────────────────── */
.post-content { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 2.5rem; }
.post-content h1 { margin-bottom: .35rem; }
.post-content .post-meta { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.post-content h2 { margin-top: 2rem; }
.post-content ul, .post-content ol { padding-left: 1.75rem; margin-bottom: 1rem; }
.post-content code { background: #f4f4f4; padding: .1em .3em; border-radius: 3px; font-size: .88em; }
.post-content pre { background: #1e1e2e; color: #cdd6f4; padding: 1.25rem; border-radius: var(--radius); overflow-x: auto; margin-bottom: 1.5rem; }
.post-content pre code { background: none; padding: 0; font-size: .85rem; }
.post-content blockquote { border-left: 4px solid var(--gold); padding-left: 1rem; color: var(--text-light); font-style: italic; margin: 1.5rem 0; }

/* Ad between content */
.ad-inpost { margin: 2rem 0; padding: 1rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: center; }
.ad-label { font-size: .7rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .5rem; }

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar-section { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.25rem; margin-bottom: 1.5rem; }
.sidebar-section h4 { color: var(--navy); font-size: .95rem; margin-bottom: .75rem; padding-bottom: .4rem; border-bottom: 2px solid var(--gold); }
.sidebar-affiliate { text-align: center; }
.sidebar-affiliate img { margin: 0 auto; border-radius: 4px; }
.sidebar-affiliate p { font-size: .75rem; color: var(--text-light); margin-top: .4rem; }

/* ── Products / Shop ─────────────────────────────────────────────────── */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.75rem; }
.product-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s;
}
.product-card:hover { box-shadow: var(--shadow-md); }
.product-card-img { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%); height: 180px; display: flex; align-items: center; justify-content: center; }
.product-card-img .product-icon { font-size: 4rem; }
.product-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.product-card h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.product-card h3 a { color: var(--navy); }
.product-card h3 a:hover { color: var(--gold); }
.product-card p { font-size: .88rem; color: var(--text-light); flex: 1; }
.product-price { font-size: 1.35rem; font-weight: 700; color: var(--navy); margin: .75rem 0; }
.product-price .currency { font-size: .85rem; color: var(--text-light); }
.btn { display: inline-block; padding: .6rem 1.4rem; border-radius: var(--radius); font-weight: 700; cursor: pointer; border: none; font-size: .9rem; transition: background .2s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: var(--gold-light); color: var(--navy); }
.btn-outline { background: transparent; border: 2px solid var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-block { display: block; text-align: center; width: 100%; }
.btn-sm { padding: .4rem .9rem; font-size: .82rem; }

/* ── Cart page ───────────────────────────────────────────────────────── */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.cart-table th { padding: .75rem; text-align: left; border-bottom: 2px solid var(--navy); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-light); }
.cart-table td { padding: .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-table td img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }
.qty-input { width: 60px; text-align: center; padding: .3rem; border: 1px solid var(--border); border-radius: var(--radius); }
.cart-summary { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.5rem; max-width: 380px; margin-left: auto; }
.cart-summary h3 { margin-bottom: 1rem; }
.summary-row { display: flex; justify-content: space-between; padding: .4rem 0; }
.summary-total { font-weight: 700; font-size: 1.1rem; border-top: 2px solid var(--navy); padding-top: .75rem; margin-top: .5rem; }
.empty-cart-message { text-align: center; padding: 3rem; }
.empty-cart-message p { color: var(--text-light); margin-bottom: 1rem; }

/* ── Single product ──────────────────────────────────────────────────── */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; padding: 3rem 0; }
@media(max-width:768px) { .product-detail { grid-template-columns: 1fr; } }
.product-detail-img { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%); border-radius: var(--radius); min-height: 300px; display: flex; align-items: center; justify-content: center; font-size: 6rem; }
.product-detail-info h1 { font-size: 1.9rem; }
.product-detail-price { font-size: 2rem; font-weight: 700; color: var(--navy); margin: 1rem 0; }
.guarantee-badge { font-size: .82rem; color: var(--text-light); margin-top: .5rem; }
.product-detail-description { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* ── Homepage hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(150deg, var(--navy) 0%, #0f2035 60%, #0a1a2e 100%);
  color: var(--white); padding: 5rem 0 4rem; text-align: center; position: relative; overflow: hidden;
}
.hero::before { content: '⚓'; position: absolute; right: 5%; top: 50%; transform: translateY(-50%); font-size: 12rem; opacity: .04; }
.hero h1 { font-size: 3rem; color: var(--white); margin-bottom: .6rem; }
.hero h1 em { color: var(--gold); font-style: normal; }
.hero p { font-size: 1.15rem; color: rgba(255,255,255,.75); max-width: 580px; margin: 0 auto 2rem; }
.hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-hero-primary { background: var(--gold); color: var(--navy); padding: .85rem 2.2rem; font-size: 1rem; }
.btn-hero-primary:hover { background: var(--gold-light); color: var(--navy); }
.btn-hero-secondary { background: transparent; border: 2px solid rgba(255,255,255,.5); color: var(--white); padding: .85rem 2.2rem; font-size: 1rem; border-radius: var(--radius); }
.btn-hero-secondary:hover { border-color: var(--gold); color: var(--gold); }

.section { padding: 3.5rem 0; }
.section-title { text-align: center; margin-bottom: 2.5rem; }
.section-title h2 { font-size: 2rem; }
.section-title p { color: var(--text-light); }

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer { background: var(--navy); color: rgba(255,255,255,.7); padding: 3rem 0 1.5rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-col h4 { color: var(--gold); margin-bottom: .75rem; font-size: .95rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .4rem; }
.footer-col ul a { color: rgba(255,255,255,.65); font-size: .87rem; }
.footer-col ul a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.25rem; text-align: center; font-size: .82rem; }

/* ── Toast notification ──────────────────────────────────────────────── */
.cart-toast {
  position: fixed; top: 80px; right: 20px;
  padding: .75rem 1.25rem; border-radius: var(--radius);
  font-size: .9rem; font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 9999; opacity: 0;
  transition: opacity .3s ease;
  max-width: 300px;
}
.cart-toast--success { background: var(--success); color: var(--white); }
.cart-toast--error   { background: var(--danger);  color: var(--white); }
.cart-toast--info    { background: var(--info);    color: var(--white); }

/* ── Success / cancel pages ──────────────────────────────────────────── */
.checkout-result { text-align: center; padding: 5rem 1.5rem; }
.checkout-result .result-icon { font-size: 5rem; margin-bottom: 1.5rem; }
.checkout-result h1 { font-size: 2.2rem; margin-bottom: .75rem; }
.checkout-result p { color: var(--text-light); max-width: 500px; margin: 0 auto 2rem; }

/* ── Responsive nav ──────────────────────────────────────────────────── */
@media(max-width:640px) {
  .site-nav { gap: 1rem; }
  .site-nav a { font-size: .82rem; }
  .hero h1 { font-size: 2.1rem; }
  .hero p { font-size: 1rem; }
}
