/* ===============================
   DaniVesa – Core Styles
   =============================== */

/* Basic selection and scroll */
::selection { background: #f59e0b33; }
html, body { scroll-behavior: smooth; font-family: system-ui, sans-serif; }

/* Drawer slide animations */
#cartDrawer aside { transition: transform .2s ease; }
#cartDrawer:not(.hidden) aside { transform: translateX(0); }
#cartDrawer.hidden aside { transform: translateX(100%); }

/* Scrollbar styling */
* { scrollbar-width: thin; scrollbar-color: #94a3b8 transparent; }
*::-webkit-scrollbar { height: 8px; width: 8px; }
*::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }
.dark * { scrollbar-color: #475569 transparent; }
.dark *::-webkit-scrollbar-thumb { background: #475569; }

/* Let browsers know we support both modes */
:root { color-scheme: light dark; }

/* ===============================
   Forms & Inputs
   =============================== */

input, textarea, select {
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgb(203 213 225);
  background: #ffffff;
  color: #0f172a;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgb(99 102 241);
}

.dark input, .dark textarea, .dark select {
  background: #0f172a;      /* slate-900 */
  color: #e2e8f0;           /* slate-200 */
  border-color: #334155;    /* slate-700 */
}

/* Avoid clipped/overlapping select text */
select {
  width: 100%;
  min-width: 100%;
  white-space: normal;
  line-height: 1.4;
}

/* ===============================
   Custom chevron for <select>
   =============================== */

select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 2rem;
  background-position: right 0.875rem center !important;
  background-size: 10px 6px !important;
  background-repeat: no-repeat !important;
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12' width='20' height='12'>\
<path d='M2 2l8 8 8-8' fill='none' stroke='%231f2937' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/>\
</svg>") !important; /* slate-800 */
}
.dark select {
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12' width='20' height='12'>\
<path d='M2 2l8 8 8-8' fill='none' stroke='%23e2e8f0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/>\
</svg>") !important; /* slate-200 */
}

/* Overlay chevron that always shows */
label.grid { position: relative; }
label.grid:has(> select) > select { background-image: none !important; }

label.grid:has(> select)::after {
  content: "";
  position: absolute;
  right: 0.875rem;
  top: 50%;
  width: 10px;
  height: 6px;
  transform: translateY(-50%);
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: 10px 6px;
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12' width='20' height='12'>\
<path d='M2 2l8 8 8-8' fill='none' stroke='%231f2937' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/>\
</svg>");
  opacity: .9;
}
html.dark label.grid:has(> select)::after {
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12' width='20' height='12'>\
<path d='M2 2l8 8 8-8' fill='none' stroke='%23e2e8f0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/>\
</svg>");
}

/* Keep popup options readable */
option { color:#0f172a; background:#ffffff; }
.dark option { color:#e2e8f0; background:#0f172a; }

/* Number inputs: keep native spinners */
input[type="number"] { padding-right: .75rem; }

/* ===== Spinner background: transparent in LIGHT only (keep DARK as-is) ===== */
html:not(.dark) input[type="number"]::-webkit-inner-spin-button,
html:not(.dark) input[type="number"]::-webkit-outer-spin-button {
  background: transparent !important;
  opacity: 1 !important;
}
/* Ensure WebKit still renders the spinner arrows */
html:not(.dark) input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: inner-spin-button;
}
/* NOTE: do NOT set -moz-appearance:textfield; it hides spinners in Firefox */

/* ===============================
   Language Dropdown
   =============================== */

.lang-btn{
  display:inline-flex; align-items:center; gap:.5rem;
  line-height:1; border:1px solid rgb(203 213 225);
  background:#fff; color:#0f172a;
  padding:.35rem .6rem; border-radius:.75rem; font-weight:700; cursor:pointer;
}
.dark .lang-btn{ border-color:#334155; background:#0f172a; color:#e2e8f0; }

.lang-btn .flag{ width:18px; height:12px; border-radius:2px; overflow:hidden; display:inline-flex; line-height:0; }
.lang-menu .flag{ width:24px; height:16px; border-radius:2px; overflow:hidden; display:inline-flex; line-height:0; }
.flag-svg{ width:100%; height:100%; display:block; }

.lang-btn .lang-code{ font-size:.85rem; letter-spacing:.02em; }
.lang-btn .chev{ opacity:.7; font-size:.85rem; }

/* Menu container */
.lang-menu{
  position:absolute; right:0; top:100%; margin-top:.35rem; min-width:12rem;
  border:1px solid rgb(226 232 240); border-radius:.75rem; background:#fff;
  box-shadow:0 10px 15px -3px rgba(0,0,0,.1); padding:.25rem; z-index:60;
}
.dark .lang-menu{ border-color:#1e293b; background:#0f172a; box-shadow:0 10px 15px -3px rgba(0,0,0,.5); }

.lang-menu li{
  display:flex; align-items:center; gap:.75rem; padding:.5rem .75rem;
  border-radius:.6rem; cursor:pointer; font-weight:500; color:#334155;
}
.dark .lang-menu li{ color:#cbd5e1; }

.lang-menu li:hover, .lang-menu li[aria-selected="true"]{ background:#f1f5f9; color:#0f172a; }
.dark .lang-menu li:hover, .dark .lang-menu li[aria-selected="true"]{ background:#1e293b; color:#e2e8f0; }

.lang-menu:not(.hidden){ display:block; }

/* ===============================
   Misc Elements
   =============================== */

.product-card:hover { transform: translateY(-1px); transition: transform .2s ease; }

#themeBtn, #themeBtnMobile { transition: background .2s ease, border-color .2s ease; }
#themeBtn:hover, #themeBtnMobile:hover { background: rgba(148,163,184,.1); }

/* ===============================
   Product Card Layout
   =============================== */

.product-card { display:flex; flex-direction:column; height:100%; }
.product-card > .mt-4 { display:flex; flex-direction:column; flex:1 1 auto; min-height:0; }
.product-card form { flex:1 1 auto; display:flex; flex-direction:column; }
.product-card form .add-to-cart { margin-top:auto; }

/* Cart qty input size */
#cartList .cart-qty { width: 3.5rem; text-align: right; }

/* === Dark-mode + mobile details patch =================== */

/* Prevent hidden details from capturing taps */
details:not([open]) > :not(summary) {
  display: none !important;
  pointer-events: none !important;
}

/* Ensure global dark contrast */
html.dark body {
  background-color: #0b1220;
  color: #e2e8f0;
}

/* Force dark header color */
header.sticky {
  background-color: hsla(0,0%,100%,.80);
}
html.dark header.sticky {
  background-color: rgba(15,23,42,.80) !important;
}

/* Harmonize form surfaces in dark mode */
html.dark input,
html.dark textarea,
html.dark select {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}

/* Language dropdown consistency */
html.dark .lang-menu {
  background:#0f172a;
  border-color:#1e293b;
  box-shadow:0 10px 15px -3px rgba(0,0,0,.5);
}

/* Section backgrounds in dark */
html.dark .bg-white,
html.dark .bg-slate-50,
html.dark .bg-white\/70,
html.dark .bg-white\/80 {
  background-color: #0f172a !important;
}

