/* =========================================================
   Minimal Light Theme – Apple / Google inspired
   Safe for BASIC_TEMPLATE.php
   ========================================================= */

:root{
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --border: rgba(15, 23, 42, 0.10);
  --text: rgba(15, 23, 42, 0.92);
  --muted: rgba(15, 23, 42, 0.64);
  --link: #0b5fff;
  --link-hover: #0747bf;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
  --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --radius-sm: 12px;
  --container: 1120px;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  background: var(--bg);
}

body{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
}

/* =========================================================
   Layout
   ========================================================= */

#container{
  max-width: var(--container);
  margin: 28px auto 60px auto;
  padding: 0 18px;
}

#container_inner{
  float: none;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* =========================================================
   Header
   ========================================================= */

#header{
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #fbfbfc);
}

#header h1,
#header h1 a{
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  color: var(--text) !important;
  text-decoration: none;
}

#header h2{
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

/* =========================================================
   Main Layout
   ========================================================= */

#main{
  padding: 18px 22px 22px 22px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

/* =========================================================
   Content
   ========================================================= */

#content{
  flex: 1 1 720px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

#content h1{
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  font-weight: 650;
}

#content p,
#content h3{
  padding: 0 16px;
}

#content ul{
  padding-left: 34px;
}

#content li{
  list-style-type: square;
  color: rgba(15, 23, 42, 0.78);
}

/* =========================================================
   Image safety (FIX #1)
   ========================================================= */

/* Never allow images to break layouts */
#content img{
  max-width: 100%;
  height: auto;
}

/* Browse Products thumbnails only */
#product-list .list-item img{
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
}

/* =========================================================
   Sidebar
   ========================================================= */

#right{
  width: 320px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

#right p{
  font-size: 13px;
  margin-bottom: 10px;
}

/* Left-align subscribe button */
#right form p{
  text-align: left !important;
}

/* =========================================================
   Links
   ========================================================= */

a,
a:visited{
  color: var(--link) !important;
  text-decoration: none;
}

a:hover{
  color: var(--link-hover) !important;
  text-decoration: underline;
}

/* =========================================================
   Forms
   ========================================================= */

input[type="text"],
input[type="email"],
select,
textarea{
  width: 100% !important;
  padding: 10px 12px;
  margin-top: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #ffffff;
}

input:focus,
select:focus{
  border-color: rgba(11, 95, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(11, 95, 255, 0.14);
  outline: none;
}

input[type="submit"],
button{
  background: #0b5fff;
  color: #fff;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-weight: 650;
  cursor: pointer;
}

/* Compact quantity dropdown */
select[name="quantity"]{
  width: 20% !important;
  min-width: 80px;
}

/* =========================================================
   Browse Products
   ========================================================= */

#product-list{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  padding: 0 16px;
}

/* Remove boxes ONLY on Browse Products */
#product-list .list-item{
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
}

/* =========================================================
   View Source overlay (FIX #2)
   ========================================================= */

#source-code{
  display: none;        /* critical */
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.92);
}

#source-code:target{
  display: block;
}

/* =========================================================
   Footer
   ========================================================= */

#footer{
  padding-top: 14px;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.55);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 960px){
  #main{
    flex-direction: column;
  }

  #right{
    width: 100%;
  }

  select[name="quantity"]{
    width: 40% !important;
  }
}
