:root{--bg:#fbf9fc;--card:#fff;--accent:#16834a;--text:#20172a;--muted:#716879}
*{box-sizing:border-box;margin:0;padding:0;font-family:'Montserrat',sans-serif}
body{background:var(--bg);color:var(--text);padding-bottom:84px}
header{display:flex;justify-content:space-between;align-items:center;padding:16px 24px;background:#fff;border-bottom:1px solid #e8e0ed;position:sticky;top:0;z-index:10}
header h2{color:var(--accent)}
nav button{background:none;border:1px solid #333;color:var(--text);padding:8px 14px;margin-left:8px;border-radius:6px;cursor:pointer}
nav button.active,nav button:hover{border-color:var(--accent);color:var(--accent)}
.page{display:none;padding:24px}
.page.active{display:block}
.container{max-width:1200px;margin:auto}
h3{margin-bottom:16px;color:var(--accent)}
form,input,select,textarea,button{font-size:14px}
form{background:var(--card);padding:20px;border-radius:10px;margin-bottom:30px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:20px}
.card{background:var(--card);border-radius:14px;overflow:hidden;border:1px solid #e8e0ed;transition:.2s}
.card:hover{border-color:var(--accent)}
.card img{width:100%;height:200px;object-fit:cover;cursor:pointer}
.card-body{padding:12px}
.card-body h4{margin-bottom:6px}
.price{color:var(--accent);font-weight:bold;margin:6px 0}
.btn{background:var(--accent);color:#000;border:none;padding:8px 12px;border-radius:6px;cursor:pointer;margin-right:6px}
.btn-ghost{background:none;border:1px solid #555;color:var(--text)}
.btn-danger{background:#b91c1c;color:#fff;border:none}
.flex{display:flex;gap:8px;flex-wrap:wrap}
input,select,textarea{background:#fff;border:1px solid #d9ccdf;color:var(--text);padding:8px;border-radius:6px;width:100%}
label{font-size:12px;color:var(--muted)}
.variation-row{display:flex;gap:8px;margin-top:8px}
.filter-bar-vertical{display:flex;flex-direction:column;gap:8px;width:180px}
.filter-btn{background:none;border:1px solid #333;color:var(--text);padding:10px;text-align:left;border-radius:6px;cursor:pointer}
.filter-btn.active,.filter-btn:hover{background:var(--accent);color:#000}
.collection-wrap{display:flex;gap:20px}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.8);display:none;align-items:center;justify-content:center;z-index:50}
.modal.active{display:flex}
.modal-content{background:var(--card);padding:20px;border-radius:10px;max-width:600px;width:90%;max-height:90vh;overflow:auto}
.badge{background:var(--accent);color:#000;border-radius:50%;padding:2px 6px;font-size:12px;margin-left:4px}
.cart-item,.wish-item{display:flex;gap:12px;border-bottom:1px solid #333;padding:10px 0}
.cart-item img,.wish-item img{width:60px;height:60px;object-fit:cover;border-radius:6px}
.qty-control{display:flex;align-items:center;gap:6px}
.qty-control button{padding:4px 8px}
@media(max-width:768px){
 .collection-wrap{flex-direction:column}
 .filter-bar-vertical{flex-direction:row;overflow-x:auto;width:100%}
}
.modal-content{color:#20172a}.variation-group{margin:12px 0}.variation-group label{display:block}.variation-group select{margin-top:4px}.bottom-nav{position:fixed!important;left:0;right:0;bottom:0;z-index:80}


/* KÉMOLUX — 3-column product layout */

#productGrid {
 display: grid;
 grid-template-columns: repeat(3, minmax(0, 1fr));
 gap: 20px;
 flex: 1;
 align-items: start;
}

#productGrid .card {
 width: 100%;
 min-width: 0;
}

#productGrid .card img {
 width: 100%;
 height: 220px;
 object-fit: cover;
}

/* Tablet */
@media (max-width: 900px) {
 #productGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
 }
}

/* Mobile */
@media (max-width: 480px) {
 #productGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
 }
 
 #productGrid .card img {
  height: 150px;
 }
 
 #productGrid .card-body {
  padding: 9px;
 }
 
 #productGrid .card-body h3 {
  font-size: 14px;
 }
 
 #productGrid .card-body p {
  font-size: 12px;
 }
 
 #productGrid .flex {
  gap: 5px;
 }
 
 #productGrid .flex button {
  font-size: 11px;
  padding: 7px;
 }
}

/* KÉMOLUX compact marketplace-style collection */
.collection-wrap { display:block; }
.collection-main { width:100%; min-width:0; }
.collection-toolbar {
  position:sticky; top:0; z-index:30;
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:12px 0; margin-bottom:8px;
  background:var(--bg);
}
.category-toggle-wrap { position:relative; flex:0 0 auto; }
.category-toggle {
  display:flex; align-items:center; gap:9px; min-height:42px;
  padding:9px 13px; border:1px solid #d8cde5; border-radius:9px;
  background:#fff; color:var(--text); cursor:pointer; font-weight:600;
}
.category-toggle-icon { color:var(--accent); font-size:17px; }
.category-chevron { margin-left:3px; font-size:18px; }
.category-menu {
  position:absolute; top:calc(100% + 8px); left:0; width:min(290px, calc(100vw - 36px));
  padding:12px; border:1px solid #e8e0ed; border-radius:12px;
  background:#fff; box-shadow:0 12px 32px rgba(32,23,42,.16); z-index:60;
}
.category-menu[hidden] { display:none; }
.category-menu-heading { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.category-menu-close { border:0; background:transparent; font-size:25px; line-height:1; cursor:pointer; color:var(--text); }
.category-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.category-options .filter-btn { text-align:center; padding:9px 7px; border:1px solid #e5ddea; border-radius:7px; background:#fff; }
.category-options .filter-btn.active,.category-options .filter-btn:hover { background:var(--accent); border-color:var(--accent); color:#fff; }
.collection-search { display:flex; align-items:center; gap:5px; flex:1; max-width:560px; }
.collection-search input { width:100%; min-width:0; height:42px; padding:10px 13px; border:1px solid #d8cde5; border-radius:9px; background:#fff; }
.collection-search #clearCollectionSearch { flex:0 0 34px; height:34px; border:0; border-radius:50%; background:#f0eaf4; color:var(--text); font-size:22px; cursor:pointer; }
.collection-search-status { min-height:18px; margin:0 0 9px; color:var(--muted); font-size:12px; }
#productGrid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; align-items:start; }
#productGrid .card { width:100%; min-width:0; border-radius:10px; }
#productGrid .product-image { display:block; width:100%; aspect-ratio:3 / 4; height:auto; object-fit:cover; }
#productGrid .card-body { padding:9px; }
#productGrid .card-body h3 { margin:0 0 5px; font-size:14px; line-height:1.35; color:var(--text); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
#productGrid .category-label, #productGrid .card-body > p:not(.price) { display:none; }
#productGrid .price { margin:4px 0 9px; font-size:14px; }
#productGrid .product-actions { display:flex; gap:8px; align-items:center; }
#productGrid .product-icon-btn { display:inline-flex; justify-content:center; align-items:center; width:36px; height:34px; padding:0; border:1px solid #e2d8e9; border-radius:7px; background:#fff; color:var(--text); cursor:pointer; font-size:18px; }
#productGrid .product-icon-btn.cart-action { background:var(--accent); color:#fff; border-color:var(--accent); }
#productGrid .product-icon-btn:hover { transform:translateY(-1px); }
#productGrid .empty-state { grid-column:1 / -1; }
@media(max-width:760px) {
  .collection-toolbar { top:0; gap:8px; }
  #productGrid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  #productGrid .card-body { padding:8px; }
  #productGrid .card-body h3 { font-size:12px; }
  #productGrid .price { font-size:13px; }
  #productGrid .product-icon-btn { width:32px; height:31px; }
  .category-toggle { padding:8px 10px; font-size:12px; }
  .collection-search input { height:40px; font-size:12px; }
}

/* Compact 3:4 shopping cards for cart and wishlist */
.shopping-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}
.shopping-card {
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.shopping-card-image {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    height: auto;
    object-fit: cover;
    background: #f1edf4;
}
.shopping-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    padding: 11px;
    min-width: 0;
}
.shopping-card-body h3 {
    margin: 0;
    color: var(--purple);
    font-size: .95rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.shopping-card-body p { margin: 2px 0; font-size: .88rem; }
.shopping-card-variation { color: var(--muted); font-size: .78rem !important; }
.shopping-card-subtotal { color: var(--purple); font-size: .9rem; }
.shopping-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 5px;
}
.compact-qty-control { gap: 5px; }
.compact-qty-control button { min-width: 28px; padding: 4px 8px; }
.compact-qty-control span { min-width: 18px; text-align: center; font-weight: 700; }
.compact-remove-btn { padding: 7px 9px; font-size: .75rem; }
.compact-action-btn {
    width: 40px;
    height: 38px;
    padding: 0;
    font-size: 1.1rem;
    border-radius: 9px;
}
.wishlist-actions { justify-content: flex-start; }
#cartTotal { margin: 20px 0; color: var(--purple); }
@media (max-width: 720px) {
    .shopping-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .shopping-card-body { padding: 9px; }
    .shopping-card-body h3 { font-size: .85rem; }
    .shopping-card-body p { font-size: .82rem; }
    .shopping-card-actions { gap: 5px; }
}
@media (max-width: 350px) {
    .shopping-card-grid { gap: 8px; }
    .shopping-card-body { padding: 7px; }
    .compact-remove-btn { padding: 6px 7px; }
}

/* KÉMOLUX category navigation */
.category-toggle-wrap-horizontal{width:100%;min-width:0}
.category-options-horizontal{display:flex!important;flex-direction:row;flex-wrap:nowrap;gap:9px;overflow-x:auto;overflow-y:hidden;padding:8px 2px 12px;scrollbar-width:thin}
.category-options-horizontal .filter-btn{flex:0 0 auto;white-space:nowrap;min-height:42px;padding:10px 16px;border-radius:24px}
.collection-toolbar{align-items:center;gap:14px}
.wishlist-shopping-card .shopping-card-image{cursor:pointer}
#wishItems .wishlist-shopping-card{overflow:hidden}
#wishItems .shopping-card-body{padding:14px}
#wishItems .wishlist-shopping-card .shopping-card-body h3{cursor:pointer}
#wishItems .wishlist-shopping-card .shopping-card-body .price{margin:7px 0 12px}
#productModal .modal-content{max-width:560px}
#productModal .modal-content img{max-height:340px;object-fit:contain}
.admin-product{padding:12px;border-bottom:1px solid #eee}
.admin-product img{width:76px;height:76px;object-fit:cover;border-radius:9px}
.order-tools{display:flex;flex-wrap:wrap;gap:10px;margin:15px 0}
.order-tools input,.order-tools select{max-width:230px}
.order-summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin:15px 0}
.order-summary-card{background:#f7f1fb;border:1px solid #e5d9ee;border-radius:12px;padding:15px}
.order-summary-card strong{display:block;font-size:1.25rem;color:#4B0082;margin-top:5px}
.order-delete{white-space:nowrap}

.category-toggle-wrap-horizontal{width:100%;min-width:0}.category-options-horizontal{display:flex!important;flex-direction:row;flex-wrap:nowrap;gap:9px;overflow-x:auto;padding:8px 2px 12px;scrollbar-width:thin}.category-options-horizontal .filter-btn{flex:0 0 auto;white-space:nowrap;min-height:42px;padding:10px 16px;border-radius:24px}.collection-toolbar{align-items:center;gap:14px}
.wishlist-shopping-card .shopping-card-image,.wishlist-shopping-card h3{cursor:pointer}
#wishItems .wishlist-shopping-card{overflow:hidden}#wishItems .shopping-card-body{padding:14px}
.order-summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin:15px 0}.order-summary-card{background:#f7f1fb;border:1px solid #e5d9ee;border-radius:12px;padding:15px}.order-summary-card strong{display:block;font-size:1.25rem;color:#4B0082;margin-top:5px}.order-tools{display:flex;flex-wrap:wrap;gap:10px;margin:15px 0}.order-tools input,.order-tools select{max-width:260px}.order-delete{white-space:nowrap}.order-group{border:1px solid #e4d9eb;border-radius:10px;padding:12px;margin:10px 0}.order-group summary{font-weight:700;color:#4B0082;cursor:pointer}

/* Search is a separate full-width row below the category controls */
.collection-toolbar{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:9px}
.category-toggle-wrap-horizontal{width:100%;min-width:0}
.category-options-horizontal{display:flex;flex-direction:row;flex-wrap:nowrap;gap:7px;overflow-x:auto;overflow-y:hidden;padding:2px 1px 8px;scrollbar-width:thin}
.category-options-horizontal .filter-btn{flex:0 0 auto;white-space:nowrap;text-align:center;padding:9px 12px}
.collection-search{width:100%;max-width:none;flex:0 0 auto}
.collection-search input{width:100%}
@media(max-width:760px){
 .collection-toolbar{gap:7px}
 .category-options-horizontal .filter-btn{font-size:12px;padding:8px 10px}
 .collection-search{max-width:none}
}

/* Product detail gallery: one image at a time, with adjacent slides revealed by arrows/swipe. */
.product-image-slider{position:relative;width:100%;overflow:hidden;border-radius:12px;background:#f4eff7;}
.product-image-viewport{width:100%;overflow:hidden;}
.product-image-track{display:flex;width:100%;transition:transform .32s ease;touch-action:pan-y;}
.product-image-track .product-slide{display:block;flex:0 0 100%;width:100%;height:min(58vh,420px);max-height:420px;object-fit:contain;background:#f4eff7;}
.image-slider-arrow{position:absolute;z-index:2;top:50%;transform:translateY(-50%);width:38px;height:38px;border:0;border-radius:50%;background:#ffffffdf;color:#4b0082;font-size:29px;line-height:1;box-shadow:0 2px 10px #0002;}
.image-slider-prev{left:10px}.image-slider-next{right:10px}
.product-image-dots{display:flex;justify-content:center;gap:7px;padding:10px 0 4px;}
.product-image-dot{width:8px;height:8px;padding:0;border:0;border-radius:50%;background:#cbbbd5;}
.product-image-dot.active{background:#4b0082;transform:scale(1.25);}
