:root {
  --brand-color: #e60012;      /* Nintendo red */
  --brand-color-dark: #b8000e;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.4;
  color: #1b1b1b;
  background: #f4f4f4;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: min(1040px, calc(100% - 32px)); margin: 0 auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ===== Header ===== */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e7e7e7;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-badge {
  width: 36px; height: 28px;
  display: inline-grid; place-items: center;
  background: var(--brand-color); color: #fff;
  border-radius: 18px;
  font-weight: 900;
}
.brand-text { letter-spacing: 0.2px; }

.primary-nav ul {
  list-style: none;
  display: flex;
  gap: 14px;
  margin: 0;
  padding: 0;
}
.primary-nav a {
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.primary-nav a:hover { background: #f1f1f1; }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f3f3f3;
  border: 1px solid #e7e7e7;
  border-radius: 999px;
  padding: 6px 10px;
}
.search input {
  border: none;
  background: transparent;
  outline: none;
  width: 160px;
}
.search button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}
.icon-btn {
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  border: 1px solid #e7e7e7;
  background: #fff;
}
.icon-btn:hover { background: #f4f4f4; }

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e7e7e7;
  background: #fff;
  font-weight: 600;
}
.user-dot {
  width: 18px; height: 18px;
  border-radius: 999px;
  background: #1a4fff;
  display: inline-block;
}


.btn-primary {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--brand-color);
  color: #fff;
  font-weight: 800;
  text-align: center;
}
.btn-primary:hover { filter: brightness(0.95); }

.rating-box {
  margin-top: 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  max-width: 260px;
}
.rating-badge {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 2px solid #111;
  font-weight: 900;
}
.rating-text { font-size: 12px; color: #444; }

/* wave divider + subtle pattern below hero */
.hero-wave {
  height: 34px;
  margin-top: 18px;
  background:
    radial-gradient(circle at 20px -12px, #f4f4f4 18px, transparent 19px) 0 0 / 40px 48px repeat-x,
    radial-gradient(circle at 40px -12px, #f4f4f4 18px, transparent 19px) 20px 0 / 40px 48px repeat-x;
}

/* ===== Categories ===== */
.categories {
  background: #f4f4f4;
  padding: 18px 0 10px;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.cat-tile {
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 14px;
  padding: 18px 14px;
  display: grid;
  justify-items: center;
  gap: 10px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}
.cat-tile:hover { transform: translateY(-1px); }
.cat-icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 14px;
  color: var(--brand-color);
  font-size: 28px;
}
.cat-tile h3 { margin: 0; font-size: 14px; }

/* ===== Featured products (tableless list) ===== */
.featured {
  background: #f4f4f4;
  padding: 18px 0 30px;
}
.section-head h2 { margin: 0; font-size: 20px; }
.section-head p { margin: 8px 0 0; color: #555; font-size: 14px; }

.product-list{
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr); 
  gap: 18px;
}
.product-card{
  width: 100%;          
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}
.product-link h3 { margin: 8px 0 0; font-size: 16px; }
.product-link img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  background: #eee;
}
.price { margin: 0; font-weight: 800; }

.product-card button {
  margin-top: auto;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e7e7e7;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}
.product-card button:hover { background: #f2f2f2; }



/* ===== Footer ===== */
.site-footer {
  background: #fff;
  border-top: 1px solid #e7e7e7;
  padding: 14px 0;
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 12px;
}
.site-footer a { text-decoration: underline; color: #444; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 620px) {
  .primary-nav { display: none; }
  .search input { width: 110px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .product-card { width: calc(50% - 7px); }
}

@media (max-width: 420px) {
  .product-card { width: 100%; }
}






.hero{
  background: transparent;
  padding: 18px 0 18px;
}

.hero-inner{
  background: var(--brand-color);
  border-radius: 18px;
  overflow: hidden;
  padding: 22px 18px 0;
}

.hero-grid{
  display: grid;
  grid-template-columns: 1fr 1.55fr;
  gap: 18px;
  align-items: center;
}

/* left block */
.hero-left{
  color: #fff;
  padding: 10px 8px;
}

.hero-mark{
  opacity: 0.9;
  margin-bottom: 10px;
}

.hero-left h1{
  margin: 0;
  font-size: 46px;
  line-height: 1.05;
  letter-spacing: -0.5px;
}

.hero-subtitle{
  margin: 14px 0 0;
  color: rgba(255,255,255,0.92);
  font-size: 15px;
  max-width: 32ch;
}

/* right card carousel */
.hero-card.hero-carousel{
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 14px 30px rgba(0,0,0,0.18);
  max-width: 660px;
}

.hc-radio{ position: absolute; left: -9999px; }

.hc-viewport{ position: relative; }

.hc-slide{
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}

#hc-1:checked ~ .hc-viewport .hc-s1,
#hc-2:checked ~ .hc-viewport .hc-s2,
#hc-3:checked ~ .hc-viewport .hc-s3{
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

/* image area */
.hc-media{
  display: block;
  background: #e9e9e9;
}

.hc-media img{
  width: 100%;
  height: 320px;              
  object-fit: cover;
  object-position: center 40%;
  display: block;
}


/* bottom info bar */
.hc-body{
  background: #fff;
  padding: 12px 16px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.hc-text h2{
  font-size: 24px;      
  line-height: 1.3;
  font-weight: 800;    
}

.hc-text p{
  font-size: 15px;     
  margin-top: 8px;
}



/* arrows */
.hc-arrow{
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.92);
  color: #111;
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

.hc-arrow.left{ left: 12px; }
.hc-arrow.right{ right: 12px; }

/* dots */
.hc-dots{
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 0 0;
}

.hc-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.45);
  cursor: pointer;
}

#hc-1:checked ~ .hc-dots label[for="hc-1"],
#hc-2:checked ~ .hc-dots label[for="hc-2"],
#hc-3:checked ~ .hc-dots label[for="hc-3"]{
  background: rgba(255,255,255,0.95);
}

/* wave */
.hero-wave{
  height: 34px;
  margin-top: 16px;
}

/* responsive */
@media (max-width: 980px){
  .hero-inner{ padding: 18px 14px 0; }
  .hero-grid{ grid-template-columns: 1fr; }
  .hero-left h1{ font-size: 38px; }
}
/* ===== Book cover frame (white base like your example) ===== */
.cover-frame{
  background: #fff;
  padding: 12px 12px 22px;   
}


.cover-frame img{
  width: 100%;
  height: 320px;             
  object-fit: cover;
  object-position: center 60%;
  border-radius: 10px;      
  display: block;
}

.cart-total{
  margin: 12px 0 0;
  font-size: 14px;
  color: #111;
}

.remove-btn{
  border: 1px solid #e7e7e7;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 700;
}
.remove-btn:hover{ background: #f2f2f2; }


/* ===== Breadcrumb ===== */
.breadcrumb {
  font-size: 14px;
  margin: 16px 0 20px;
}

.breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.breadcrumb li {
  color: #666;
}

.breadcrumb li::after {
  content: "›";
  margin: 0 6px;
  color: #aaa;
}

.breadcrumb li:last-child::after {
  content: "";
}

.breadcrumb a {
  color: #666;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .current {
  color: #111;
  font-weight: 600;
}



/* =========================
   Product page polish
   ========================= */
.product-page-wrap{
  padding: 22px 0 40px;
}

/* breadcrumb */


.breadcrumb--card{
  grid-column: 1 / -1;         
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 4px 2px 10px;
  margin: 0 0 10px;
}

.breadcrumb--card ol{
  font-size: 12px;
  color: #666;
}

.breadcrumb--card a{
  color: #666;
  font-weight: 600;
}

.breadcrumb--card .current{
  color: #111;
  font-weight: 700;
}




/* ===== Product layout (Nintendo-like): breadcrumb top + 2 columns ===== */
.product-layout{
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 18px;
  padding: 14px 18px 18px;
  display: grid;
  grid-template-columns: 360px 1fr; 
  gap: 18px;
  align-items: center;
  box-shadow: 0 14px 30px rgba(0,0,0,0.10);
}

/* breadcrumb in card */
.breadcrumb--card{
  grid-column: 1 / -1;   
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 2px 2px 8px;
  margin: 0;
}

.breadcrumb--card ol{
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  font-size: 12px;
  color: #666;
}

.breadcrumb--card li::after{
  content: "›";
  margin-left: 8px;
  color: #bbb;
}
.breadcrumb--card li:last-child::after{ content: ""; }

.breadcrumb--card a{
  color: #666;
  font-weight: 600;
}
.breadcrumb--card .current{
  color: #111;
  font-weight: 800;
}

/* left image card */
.product-image-wrap{
  background: #f2f2f2;      
  border-radius: 14px;
  padding: 6px;             
  display: flex;
  align-items: center;
  justify-content: center;
}


.product-image-wrap img{
  width: 100%;
  max-width: 260px;         
  aspect-ratio: 1 / 1;
  object-fit: contain;     
  background: #fff;        
  border-radius: 10px;
}


/* right info */
.product-info h1{
  font-size: 32px;
  line-height: 1.1;
  margin: 0 0 10px;
}

#prodAuthor{
  margin: 0 0 12px;
  color: #666;
  font-weight: 600;
}

#prodPrice{
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 900;
}

#prodDesc{
  margin: 0 0 18px;
  color: #333;
  max-width: 70ch;
}

/* responsive */
@media (max-width: 900px){
  .product-layout{
    grid-template-columns: 1fr;
  }
}

.product-info .btn-primary{
  padding: 16px 32px;
  font-size: 17px;
  border-radius: 16px;
}


/* ===== Breadcrumb (Index) ===== */
.breadcrumb {
  font-size: 13px;
  color: #666;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  align-items: center;
}

.breadcrumb li::after {
  content: "›";
  margin-left: 6px;
  color: #bbb;
}

.breadcrumb li:last-child::after {
  content: "";
}

.breadcrumb a {
  color: #666;
}

.breadcrumb a:hover {
  text-decoration: underline;
}


.breadcrumb--card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 999px;     
  padding: 6px 14px;
  display: inline-block;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}


.page > .container .breadcrumb--card {
  margin: 14px 0 12px;
}


/* ===== Product gallery layout  ===== */
.product-gallery{
  display: grid;
  gap: 12px;
}

.product-gallery .pg-viewport{
  position: relative;
  background: #f1f1f1;
  border-radius: 12px;
  overflow: hidden;

  
  height: 360px;                 
  display: grid;
  place-items: center;
}

.product-gallery #pgMain{
  width: 100%;
  height: 100%;
  object-fit: contain;           
  display: block;
}


.product-gallery .pg-arrow{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #e7e7e7;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
  z-index: 2;
}
.product-gallery .pg-arrow.left{ left: 10px; }
.product-gallery .pg-arrow.right{ right: 10px; }




@media (max-width: 620px){
  .product-gallery .pg-viewport{ height: 280px; }
}


/* ===== Product details cards ===== */
.details-card{
  margin-top: 18px;
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 14px;
  padding: 18px 18px 6px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.08);
}

.details-title{
  margin: 0 0 10px;
  font-size: 18px;
}

.details-table{
  display: grid;
}

.details-row{
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  padding: 12px 0;
  border-top: 1px solid #ededed;
}

.details-row:first-child{
  border-top: none;
}

.details-key{
  font-weight: 700;
  color: #333;
}

.details-val{
  color: #444;
}


@media (max-width: 620px){
  .details-row{
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Related cards image: keep aspect ratio */
.related-card img {
  width: 100%;
  height: 160px;       
  object-fit: cover;   
  border-radius: 14px; 
  display: block;
}

.related-title{
  margin: 0 0 12px;
  font-size: 18px;
}

.related-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.related-item{
  border: 1px solid #ededed;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: #fff;
}

.related-thumb{
  background: #f2f2f2;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  place-items: center;
  min-height: 160px;
}

.related-thumb img{
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  display: block;
}

.related-name{
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.related-price{
  margin: 0;
  font-weight: 900;
}

.related-item:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0,0,0,0.10);
}

@media (max-width: 980px){
  .related-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px){
  .related-grid{ grid-template-columns: 1fr; }
}

.related-card{
  margin-top: 18px;
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.08);
}

.related-title{
  margin: 0 0 12px;
  font-size: 18px;
}

.related-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.related-item{
  border: 1px solid #ededed;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: #fff;
}

.related-thumb{
  background: #f2f2f2;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  place-items: center;
  min-height: 160px;
}

.related-thumb img{
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  display: block;
}

.related-name{
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.related-price{
  margin: 0;
  font-weight: 900;
}

.related-item:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0,0,0,0.10);
}

@media (max-width: 980px){
  .related-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px){
  .related-grid{ grid-template-columns: 1fr; }
}

.related { margin-top: 18px; }
.related-title { margin: 0 0 12px; font-size: 18px; }

.related-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.related-card{
  background:#fff;
  border:1px solid #e7e7e7;
  border-radius:14px;
  padding:12px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}
.related-card img{
  width:100%;
  height:140px;
  object-fit:cover;
  border-radius:10px;
  background:#eee;
}
.related-card h3{ margin:10px 0 6px; font-size:14px; }
.related-price{ margin:0; font-weight:800; }
@media (max-width: 900px){
  .related-grid{ grid-template-columns: 1fr; }
}


/* ===== Product image scaling ===== */

.product-image-wrap img,
#pgMain {
  width: 100%;
  height: 100%;
  object-fit: contain; 
}



/* =========================
   Admin Panel (Phase2)
========================= */

.admin-page{
  padding: 18px 0 30px;
}

.admin-title{
  margin: 0 0 12px;
}

.admin-card{
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.admin-card-title{
  margin: 0 0 12px;
  font-size: 18px;
}

.admin-form{
  display: grid;
  gap: 10px;
  max-width: 720px;
}

.admin-field{
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  align-items: center;
}

.admin-field--textarea{
  align-items: start;
}

.admin-inline-form{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-actions{
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-msg{
  margin: 0;
  color: #555;
}

.admin-list{
  display: grid;
  gap: 10px;
  margin-top: 12px;
}


.admin-row{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  border:1px solid #eee;
  border-radius:12px;
  padding:10px 12px;
}

.admin-row small,
.admin-row .meta{
  color:#555;
  font-size:13px;
}

/* Hide utility */
.is-hidden { display: none !important; }


.related-card__img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border-radius: 14px;
}



/* =========================
   Product page: Gallery
========================= */

.product-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 900px) {
  .product-layout {
    grid-template-columns: 1fr;
  }
}

.product-gallery .pg-viewport {
  position: relative;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #eee;
  padding: 18px;
}


.product-gallery #pgMain {
  width: 100%;
  aspect-ratio: 3 / 4;     
  object-fit: contain;     
  display: block;
  border-radius: 14px;
  background: #f6f6f6;
}

/* arrows */
.pg-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #e7e7e7;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.pg-arrow.left { left: 14px; }
.pg-arrow.right { right: 14px; }

.pg-arrow:hover {
  background: #fff;
}

/* =========================
   Product page: Info text
========================= */

.product-info #prodName {
  margin: 0 0 8px;
}

.product-info #prodPrice {
  font-weight: 800;
  margin: 0 0 10px;
}

.product-info #prodDesc {
  color: #555;
  line-height: 1.5;
}

/* Hide utility */
.is-hidden { display: none !important; }

#relatedGrid .related-card__img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 3 / 4 !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 10px !important;
  background: #f6f6f6 !important;
  transform: scale(0.96);
}

.details-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 18px;
  padding: 18px;
}

.details-title {
  margin: 0 0 12px;
}

.details-table .detail-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid #f0f0f0;
}

.details-table .detail-row:first-child {
  border-top: none;
}

.detail-key {
  font-weight: 800;
}

.detail-val {
  color: #333;
}


/* =========================
   Admin Panel Enhancements
========================= */

/* subsection block */
.admin-subsection {
  margin-top: 18px;
  padding-top: 6px;
}

/* subtitle  */
.admin-subtitle {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
}

 
.admin-help {
  font-size: 12px;
  color: #777;
  margin-top: 6px;
}

/* divider */
.admin-divider {
  margin: 18px 0;
  border: none;
  border-top: 1px solid #eee;
}

/* image list container */
.admin-image-list {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

/* image grid (rendered by admin.js) */
.admin-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

/* image card */
.admin-image-card {
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 10px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.admin-image-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  background: #f6f6f6;
}

/* cover badge */
.admin-cover-badge {
  font-size: 12px;
  font-weight: 800;
  color: #2e7d32;
}

/* outline button */
.btn-outline {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #e7e7e7;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.btn-outline:hover {
  background: #f4f4f4;
}

/* admin row buttons alignment */
.admin-row-actions {
  display: flex;
  gap: 8px;
}

/* responsive fix for admin forms */
@media (max-width: 700px) {
  .admin-field {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ===== Admin utilities  ===== */
.admin-help{
  margin: 6px 0 0;
  font-size: 12px;
  color: #777;
  grid-column: 2 / -1;
}

.admin-msg--ok{ color: #2e7d32; }
.admin-msg--error{ color: #b00020; }

/* Inputs / buttons used inside lists */
.admin-input{
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e7e7e7;
  border-radius: 10px;
}

.admin-btn{
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e7e7e7;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}
.admin-btn:hover{ background:#f2f2f2; }
.admin-btn--danger{
  border-color:#f1c1c6;
  color:#b00020;
}
.admin-btn--danger:hover{ background:#fff5f6; }
.admin-btn--ok{
  border-color:#cfe9d4;
  color:#2e7d32;
}
.admin-btn[disabled]{ opacity:.65; cursor:not-allowed; }

/* Product row layout */
.admin-row__btns{
  display:flex;
  gap:8px;
  align-items:center;
}
.admin-prod{
  display:flex;
  gap:10px;
  align-items:center;
  min-width:0;
}
.admin-prod__meta{ min-width:0; }
.admin-prod__title{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:520px; }

.admin-thumb{
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #eee;
  background:#fafafa;
  flex: 0 0 auto;
}

/* Subcards inside edit panel */
.admin-subcard{
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}
.admin-subtitle{
  margin: 0 0 10px;
  font-size: 16px;
}

/* Images grid in edit panel */
.admin-image-grid{
  margin-top: 12px;
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap:12px;
}
.admin-image-card{
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 10px;
  background:#fff;
}
.admin-image-thumb{
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  display:block;
  background:#f6f6f6;
}
.admin-image-actions{
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}



/* ===== Details editor (Admin) ===== */
.details-editor{
  width: 100%;
}

.details-editor__head{
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:10px;
}

.details-grid{
  display:grid;
  gap:10px;
}

.details-row-ui{
  display:grid;
  grid-template-columns: 1fr 1fr auto;
  gap:10px;
  align-items:center;
}

.details-input{
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e7e7e7;
  border-radius: 10px;
  background:#fff;
}

@media (max-width: 720px){
  .details-row-ui{
    grid-template-columns: 1fr;
  }
}


#pgMain {
    width: 100%;
    height: 400px;        
    object-fit: cover;    
    border-radius: 10px;  
    display: block;
}

/* ===== Product main image ===== */
#pgMain{
  width: 100%;
  height: 400px;      
  object-fit: cover;  
  display: block;
}

/* ===== You may also like (recommended cards) ===== */

.you-may-also-like img,
#recommendations img,
.recommendations img{
  width: 100%;
  height: 220px;      
  object-fit: cover;
  display: block;
}



.cart-toggle{
  position: absolute;
  left: -9999px;
}


.shopping-list{
  position: fixed;
  top: 80px;                
  right: 0;

  width: 360px;
  max-height: 85vh;

  display: flex;
  flex-direction: column;
  overflow: hidden;

  background: #fff;
  border-radius: 16px 0 0 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);

  transform: translateX(100%);     
  transition: transform 220ms ease;

  z-index: 9999;
}


#cartToggle:checked ~ .shopping-list{
  transform: translateX(0);
}


.cart-handle{
  position: fixed;
  top: 160px;           
  right: 0;

  width: 64px;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #fff;
  border-radius: 12px 0 0 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  cursor: pointer;

  z-index: 10000;         
}


#cartToggle:checked ~ .cart-handle{
  right: 360px;             
}

.shopping-items{
  overflow-y: auto;
  min-height: 0;
  margin: 0 16px;
  padding-right: 8px;
  max-height: calc(85vh - 160px);
}


/* ===== Cart theme ===== */


.shopping-list{
  border: 1px solid rgba(0,0,0,.06);
}


.shopping-list h2{
  margin: 16px 16px 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .2px;
}


.shopping-items{
  list-style: none;
  padding: 0;
}


.shopping-item{
  margin: 10px 16px;
  padding: 12px 12px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  background: #fff;
}

.cart-name,
.item-name{
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.25;
}


.cart-row{
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.cart-controls{
  display: flex;
  align-items: center;
  gap: 10px;
}


.cart-qty,
.item-qty{
  width: 84px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.18);
  outline: none;
}

.cart-qty:focus,
.item-qty:focus{
  border-color: #e60023; 
  box-shadow: 0 0 0 3px rgba(230,0,35,.15);
}

.cart-remove,
.item-remove{
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(230,0,35,.55);
  background: #fff;
  color: #e60023;
  font-weight: 700;
  cursor: pointer;
}

.cart-remove:hover,
.item-remove:hover{
  background: #e60023;
  color: #fff;
}


.cart-line,
.item-price{
  font-weight: 800;
}


.cart-total{
  margin: 10px 16px 0;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,.08);
  font-size: 16px;
}

#cartTotal{
  color: #e60023;
  font-weight: 900;
}

.checkout-btn{
  margin: 12px 16px 0;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: #e60023;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.checkout-btn:hover{
  filter: brightness(.95);
}


.cart-note{
  margin: 10px 16px 16px;
  color: rgba(0,0,0,.55);
  font-size: 12px;
}

.user-menu {
  position: relative;
  display: inline-block;
}

.user-trigger {
  border: none;
  background: none;
  font: inherit;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 250px;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  z-index: 1000;
}

.hidden {
  display: none;
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border-bottom: 1px solid #e5e5e5;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1e63e9;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.user-name {
  font-size: 18px;
  font-weight: 600;
  color: #111;
  word-break: break-word;
}

.user-dropdown-item {
  width: 100%;
  padding: 14px 20px;
  border: none;
  background: #fff;
  text-align: center;
  font-size: 16px;
  cursor: pointer;
}

.user-dropdown-item:hover {
  background: #f5f5f5;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-nav-links a {
  color: #222;
  text-decoration: none;
  font-weight: 600;
}

.auth-nav-links a:hover {
  text-decoration: underline;
}

.auth-page {
  min-height: calc(100vh - 90px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 32px 28px;
}

.auth-card__head {
  margin-bottom: 22px;
}

.auth-card__head h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.2;
}

.auth-card__head p {
  margin: 0;
  color: #666;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-label {
  font-size: 14px;
  font-weight: 700;
  color: #222;
  margin-top: 4px;
}

.auth-input {
  width: 100%;
  border: 1px solid #d9d9d9;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: #1e63e9;
  box-shadow: 0 0 0 3px rgba(30, 99, 233, 0.12);
}

.auth-btn {
  margin-top: 8px;
  border: none;
  border-radius: 14px;
  padding: 13px 16px;
  background: #1e63e9;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
}

.auth-btn:hover {
  opacity: 0.95;
}

.auth-btn:active {
  transform: translateY(1px);
}

.auth-msg {
  min-height: 24px;
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.auth-msg--error {
  color: #c62828;
}

.auth-msg--ok {
  color: #1b7f3b;
}

.auth-footer-links {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #666;
}

.auth-footer-links a {
  color: #1e63e9;
  text-decoration: none;
  font-weight: 600;
}

.auth-footer-links a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .auth-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-nav-links {
    flex-wrap: wrap;
  }

  .auth-card {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .auth-card__head h1 {
    font-size: 24px;
  }
}

.cat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  padding: 18px 14px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.cat-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.1);
}

.cat-tile.is-active {
  background: #fff5f5;
  box-shadow: 0 0 0 2px rgba(230, 0, 18, 0.12), 0 14px 26px rgba(0, 0, 0, 0.08);
}

.cat-tile__icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 10px;
}

.cat-tile__title {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: #111;
  word-break: break-word;
}

.cat-tile__sub {
  margin-top: 8px;
  font-size: 13px;
  color: #777;
  text-align: center;
}

.cat-tile--more {
  background: #fafafa;
  border: 1px dashed #d8d8d8;
}

.cat-tile--more:hover {
  background: #fff;
}


.cart-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cart-item-qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 8px;
}

.cart-item-qty {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
}

.cart-summary-card {
  margin-top: 28px;
  background: #fff;
  border-radius: 20px;
  padding: 22px 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.cart-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 16px;
}

.cart-summary-checkout {
  margin-top: 10px;
  width: 100%;
}

/* ===== Checkout page ===== */
.checkout-head {
  margin-bottom: 16px;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 18px;
  align-items: start;
}

.checkout-card {
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.08);
}

.checkout-card-title {
  margin: 0 0 16px;
  font-size: 20px;
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-label {
  font-size: 14px;
  font-weight: 700;
  color: #222;
}

.checkout-input {
  width: 100%;
  border: 1px solid #d9d9d9;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.checkout-input:focus {
  border-color: #1e63e9;
  box-shadow: 0 0 0 3px rgba(30, 99, 233, 0.12);
}

.checkout-textarea {
  min-height: 110px;
  resize: vertical;
}

.checkout-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.checkout-items {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ededed;
  color: #333;
}

.checkout-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  color: #333;
}

.checkout-total-final {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid #e7e7e7;
  font-size: 18px;
}

.checkout-place-btn {
  width: 100%;
  margin-top: 16px;
  padding: 14px 18px;
  border: none;
  cursor: pointer;
}

.checkout-back-link {
  display: inline-block;
  margin-top: 14px;
  color: #666;
  font-weight: 600;
}

.checkout-back-link:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .checkout-card {
    padding: 18px;
    border-radius: 16px;
  }

  .checkout-grid-2 {
    grid-template-columns: 1fr;
  }
}



.product-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.product-action-row button {
  flex-shrink: 0;
}

.wishlist-btn {
  border: none;
  background: transparent;
  font-size: 22px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}



.wishlist-btn span {
  display: inline-block;
  width: 1em;
  text-align: center;
}

.wishlist-btn[aria-pressed="true"] {
  color: #e53935;
}

.wishlist-btn:hover {
  transform: scale(1.15);
}


/* ===== Wishlist list page ===== */
.wishlist-page {
  margin-top: 24px;
}

.wishlist-head {
  margin-bottom: 18px;
}

.wishlist-head h1 {
  margin: 0 0 6px;
  font-size: 20px;
}

.wishlist-head p {
  margin: 0;
  color: #555;
}

.wishlist-empty {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 18px;
  padding: 20px;
  color: #666;
}

.wishlist-list-wrap {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 20px;
  overflow: hidden;
}

.wishlist-list-head,
.wishlist-row {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) 140px 140px;
  align-items: center;
  gap: 16px;
}

.wishlist-list-head {
  padding: 14px 20px;
  background: #fafafa;
  border-bottom: 1px solid #ececec;
  font-weight: 700;
  color: #333;
}

.wishlist-row {
  padding: 18px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.wishlist-row:last-child {
  border-bottom: none;
}

.wishlist-product {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.wishlist-thumb-link {
  flex: 0 0 auto;
}

.wishlist-thumb {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  background: #f3f3f3;
}

.wishlist-meta {
  min-width: 0;
}

.wishlist-name {
  color: #111;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.35;
}

.wishlist-name:hover {
  text-decoration: underline;
}

.wishlist-price {
  font-weight: 700;
  color: #111;
}

.wishlist-actions {
  display: flex;
  align-items: center;
}

.wishlist-remove-btn {
  border: 1px solid #d8d8d8;
  background: #fff;
  color: #111;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

.wishlist-remove-btn:hover {
  background: #f7f7f7;
}

@media (max-width: 820px) {
  .wishlist-list-head {
    display: none;
  }

  .wishlist-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .wishlist-price,
  .wishlist-actions {
    padding-left: 88px;
  }
}

/* ===== Cart page row layout ===== */
.cart-page-list {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 24px;
}

.cart-page-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 140px 180px 120px;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.cart-page-row:last-child {
  border-bottom: none;
}

.cart-page-product {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.cart-page-thumb-link {
  flex: 0 0 auto;
}

.cart-page-thumb {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  background: #f3f3f3;
}

.cart-page-meta {
  min-width: 0;
}

.cart-page-name {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.cart-page-name-link {
  color: #111;
  text-decoration: none;
  font-weight: 700;
}

.cart-page-name-link:hover {
  text-decoration: underline;
}

.cart-page-price {
  font-weight: 700;
  color: #111;
}

.cart-page-qty {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-page-actions {
  display: flex;
  justify-content: flex-start;
}

.cart-page-actions .cart-remove-btn {
  white-space: nowrap;
}

@media (max-width: 820px) {
  .cart-page-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .cart-page-price,
  .cart-page-qty,
  .cart-page-actions {
    padding-left: 88px;
  }
}

.is-hidden {
  display: none !important;
}