/* ============
   Muebles Del Arabe – Modern UI Refresh (2026)
   Drop-in replacement for furniture.css
   ============ */

/* CSS Reset-lite */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }

:root{
  /* Colors */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;

  --text: #0f172a;
  --muted: #64748b;

  --primary: #1d4ed8;      /* modern blue */
  --primary-2: #0ea5e9;    /* accent */
  --primary-ink: #ffffff;

  --border: #e2e8f0;
  --shadow: 0 12px 30px rgba(2, 6, 23, .10);

  /* Sizing */
  --radius: 18px;
  --radius-sm: 12px;
  --container: 1120px;

  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-serif: ui-serif, Georgia, "Times New Roman", Times, serif;
}

/* Page */
body{
  background: radial-gradient(1100px 550px at 15% -10%, rgba(29,78,216,.10), transparent 55%),
              radial-gradient(1000px 600px at 85% 0%, rgba(14,165,233,.10), transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
}

a{ color: inherit; }
img{ max-width: 100%; display: block; }

/* Layout helpers kept for compatibility */
.floatleft{ float:left; } /* legacy */
.center{ display: block; text-align: center; margin: 1em auto 0; }
.padding{ padding-bottom: 2em; }
.onehalf{ float: left; width: 50%; } /* legacy index layout */
.bold{ font-weight: 700; padding-bottom: .5em; }
.item{ padding-top: .5em; }
.orderPadd{ padding-bottom: 3em; }
.tab { display: inline-block; margin-left: 40px; }
.fill{ width: 91%; }
#middle{ width: 7.25%; }
#imgOrder{ margin-left: 15%; margin-right: 15%; }

/* Wrapper */
#wrapper{
  background: transparent;
  padding: 1.25rem 1rem 2rem;
  max-width: var(--container);
  margin: 0 auto;
}

/* Header */
header{
  position: sticky; /* modern sticky header */
  top: 0;
  z-index: 9999;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226,232,240,.7);
  box-shadow: 0 8px 20px rgba(2, 6, 23, .06);
}

header > a{
  display: inline-flex;
  align-items: center;
  padding: .65rem 1rem .65rem 1rem;
}

header img{
  width: 128px;
  height: auto;
  transition: transform .15s ease;
}

header img:hover{ transform: scale(1.04); }

/* Nav */
nav{
  width: 100%;
  padding: 0 1rem .8rem 1rem;
}

nav ul{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: .65rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  font-size: .98rem;
}

nav li{
  position: relative;
  width: auto;
  padding: 0;           /* remove legacy borders/padding */
  border: none;
  font-weight: 700;
}

nav a{
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: .55rem .85rem;
  border-radius: 999px;
  color: var(--text);
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

nav a:hover{
  background: rgba(29,78,216,.10);
  color: var(--primary);
}

/* Dropdown */
nav ul ul{
  position: absolute;
  left: 0;
  top: 100%; /* remove gap */
  
  min-width: 230px;
  padding: .4rem;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(2, 6, 23, .15);

  /* Smooth open/close */
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;

  transition:
    opacity .18s ease,
    transform .18s ease,
    visibility 0s linear .18s; /* delay hiding */
}

nav ul ul li{
  width: 100%;
  background: transparent;
  padding: 0;
}

nav ul ul a{
  width: 100%;
  border-radius: 10px;
  padding: .55rem .65rem;
}

nav ul ul a:hover{
  background: rgba(29,78,216,.10);
  color: var(--primary);
}

/* Keep dropdown open */
nav li:hover > ul,
nav li:focus-within > ul {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;

  transition:
    opacity .18s ease,
    transform .18s ease,
    visibility 0s;
}

/* Invisible hover bridge */
nav li::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 18px; /* extra hover catch area */
}

/* Sub-head blocks */
#subHead, #order{
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: var(--primary-ink);
  padding: 6.25rem 1.25rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  margin: 0 auto 1rem;
}

/* Main */
main{
  margin-top: .75rem;
}

/* Home slideshow */
.slideshow{
  max-width: 980px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface);
}


/* Home page category tiles */
.home-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
  margin-top: 1.25rem;
}
.home-grid a{
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(2, 6, 23, .06);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform .15s ease, box-shadow .15s ease;
}
.home-grid a:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.home-grid img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 768px) {
  .home-grid{ grid-template-columns: 1fr; }
    
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  #wrapper {
    width: 100%;
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Headings */
h1{
  text-align: center;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
  margin: 1.25rem 0 0.75rem;
}
h2{ font-size: 1.45rem; letter-spacing: -0.01em; }

/* Gallery grid (categories page) */
#gallery{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  justify-content: center;
  font-family: var(--font-sans); /* overrides legacy Times */
  font-weight: 600;
}

/* Product card */
section{
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(2, 6, 23, .06);
  transition: transform .15s ease, box-shadow .15s ease;
}

section:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Image */
.image-container{
  width: 100%;
  height: 220px;
  margin: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(241,245,249,1), rgba(241,245,249,.5));
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-container img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

section:hover .image-container img{ transform: scale(1.03); }

/* Description */
.descr{
  display: block;
  padding: .95rem 1rem 1.05rem;
}

.itemNum{
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
  background: rgba(29,78,216,.08);
  border: 1px solid rgba(29,78,216,.18);
  padding: .35rem .65rem;
  border-radius: 999px;
  width: auto;
  margin: 0 0 .6rem 0;
}

/* Table */
table{
  width: 100%;
  border-collapse: collapse;
}

table td{
  width: auto;
  border-bottom: 1px solid var(--border);
  padding: .45rem 0;
  font-weight: 600;
  font-size: .95rem;
}

.alignLeft{ text-align: left; color: var(--text); }
.alignRight{ text-align: right; color: var(--muted); padding-left: 12px; }

/* Forms */
form{
  width: min(780px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 10px 22px rgba(2, 6, 23, .06);
}

input, textarea, select{
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .65rem .75rem;
  background: var(--surface);
}

input{ margin-bottom: .6rem; width: 48%; }
textarea{ margin-bottom: .6rem; width: 100%; height: 7rem; resize: vertical; }
select{ width: 100%; }

input:focus, textarea:focus, select:focus{
  outline: none;
  border-color: rgba(29,78,216,.55);
  box-shadow: 0 0 0 4px rgba(29,78,216,.12);
}

/* Footer */
footer{
  background: transparent;
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
  padding: 1.25rem 1rem 1.75rem;
}

/* Mobile/desktop toggles preserved */
.mobile{ display: none; }
.desktop{ display: inline; }
#mobile{ display: none; }
#desktop{ display: inline; }

/* Mobile nav tiles (existing #onlyMobile list) */
#onlyMobile{ display: none; padding: 0 1rem 1rem; }
#onlyMobile ul{
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  padding: 0;
  margin: 0;
}
#onlyMobile li{
  text-align: center;
  font-weight: 800;
  padding: .65rem .6rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(2, 6, 23, .05);
}
#onlyMobile a{ text-decoration: none; color: var(--primary); }
#onlyMobile li:hover{
  background: rgba(29,78,216,.08);
  border-color: rgba(29,78,216,.2);
}

/* Responsive */
@media (max-width: 768px){
  header > a{ width: 100%; justify-content: center; }
  nav{ padding-bottom: .6rem; }
  nav ul{ justify-content: center; }

  nav li:hover ul{ display:none; } /* same behavior as before */

  #subHead{ padding-top: 10.5rem; }
  #order{ padding-top: 10.5rem; }

  .onehalf{ float: none; width: 100%; }

  .mobile{ display: inline; }
  .desktop{ display: none; }
  #mobile{ display: inline; }
  #desktop{ display: none; }

  #onlyMobile{ display:block; }

  #gallery{ grid-template-columns: 1fr; }
}

/* Large screens */
@media (min-width: 1024px){
  #wrapper{ padding-left: 1.25rem; padding-right: 1.25rem; }
}


/* Image modal / lightbox */
.image-container{ cursor: zoom-in; }

#imgModal{
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none; /* toggled by JS */
}
#imgModal[aria-hidden="false"]{ display: block; }

#imgModal .backdrop{
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#imgModal .dialog{
  position: relative;
  max-width: min(1100px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  margin: 1rem auto;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface);
  border: 1px solid rgba(226,232,240,.8);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 25px 65px rgba(2, 6, 23, .35);
}

#imgModal .toolbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .75rem;
  background: rgba(241,245,249,.8);
  border-bottom: 1px solid var(--border);
}

#imgModal .title{
  font-weight: 800;
  font-size: .98rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#imgModal .close{
  appearance: none;
  border: 1px solid rgba(226,232,240,.9);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: .45rem .7rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
#imgModal .close:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(2, 6, 23, .10);
  background: rgba(29,78,216,.08);
}

#imgModal .content{
  padding: .5rem;
  background: var(--surface);
}
#imgModal img{
  width: 100%;
  height: auto;
  max-height: calc(100vh - 8rem);
  object-fit: contain;
  display: block;
}
#imgModal .hint{
  padding: .45rem .75rem .75rem;
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
}

@media (max-width: 768px){
  #imgModal .dialog{
    max-width: calc(100vw - 1rem);
    margin: .5rem auto;
  }
  #imgModal img{ max-height: calc(100vh - 9.5rem); }
}


/* Logo circular background fix */
header > a{
  background: linear-gradient(135deg, var(--primary), var(--primary-2));               /* white circle background */
  border-radius: 999px;              /* makes it circular */
  padding: .55rem .9rem;             /* space around logo */
  box-shadow: 0 10px 25px rgba(2,6,23,.15);
}

header img{
  display: block;
}

@media (max-width: 768px){
  header > a{
    margin: .5rem auto;
  }
}


/* Home slideshow: make fotorama fill the card (fixes empty right side) */
.slideshow{ max-width: min(1120px, 100%); }
.slideshow .fotorama,
.slideshow .fotorama__wrap,
.slideshow .fotorama__stage,
.slideshow .fotorama__stage__shaft{
  width: 100% !important;
  max-width: 100% !important;
}

/* Ensure slideshow images cover nicely */
.slideshow .fotorama__img{
  object-fit: cover;
}


/* remove/override Fotorama caption defaults */
.fotorama{
    background-color: #1d4ed8;
}

/* Home grid visibility/layout fixes */
.home-grid{ clear: both; } /* floats above won't interfere */
.home-grid a{ display: block; }
.home-grid img{
  width: 100% !important; /* override inline width="35%/55%" */
  height: 260px;
  object-fit: cover;
}

@media (max-width: 768px){
  .home-grid img{ height: 210px; }
}
