/* =========================
   HEADER / MOBILE MENU / CART
   ========================= */

.header{
  position:absolute;
  top:0;
  left: 0;
  width: 100%;
  background: transparent;
  z-index:1200;
  padding:12px 0 0;
  transition:padding .28s ease;
}

.header.is-scrolled{
  position: fixed;
  padding-top:8px;
}

.header-inner{
  min-height:var(--header-height);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 18px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:22px;
  background:rgba(15,15,15,.42);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  box-shadow:0 14px 40px rgba(0,0,0,.16);
}

.header.is-scrolled .header-inner{
  background:rgba(15,15,15,.68);
  box-shadow:0 16px 44px rgba(0,0,0,.22);
}

.logo{
  display:inline-flex;
  align-items:center;
  flex-shrink:0;
}

.logo img{
  height:42px;
  width:auto;
  object-fit:contain;
}

.nav-desktop{
  display:flex;
  align-items:center;
  gap:26px;
  margin-left:auto;
}

.nav-desktop a{
  position:relative;
  color:#fff;
  font-size:15px;
  line-height:1;
  transition:opacity .22s ease;
}

.nav-desktop a::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-7px;
  width:100%;
  height:2px;
  background:var(--accent);
  transform:scaleX(0);
  transform-origin:left;
  transition:transform .22s ease;
}

.nav-desktop a:hover::after,
.nav-desktop a:focus-visible::after,
.nav-desktop a[aria-current="page"]::after{
  transform:scaleX(1);
}

.nav-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.btn-icon{
  position:relative;
  min-width:46px;
  min-height:46px;
  padding:0 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:14px;
  background:rgba(255,255,255,.08);
  color:#fff;
  cursor:pointer;
  transition:
    transform .2s ease,
    background .2s ease,
    border-color .2s ease;
}

.btn-icon:hover,
.btn-icon:focus-visible{
  transform:translateY(-1px);
  background:rgba(255,255,255,.14);
  border-color:rgba(255,255,255,.28);
}

.cart-count{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:999px;
  background:var(--accent);
  color:#111;
  font-size:12px;
  font-weight:800;
  font-family:'Inter', Arial, sans-serif;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 6px 14px rgba(0,0,0,.2);
}

.menu-btn{
  display:none;
  flex-direction:column;
  gap:4px;
  padding-inline:12px;
}

.menu-btn span{
  width:18px;
  height:2px;
  background:#fff;
  display:block;
  border-radius:999px;
  transition:transform .22s ease, opacity .22s ease;
}

.menu-btn.is-active span:nth-child(1){
  transform:translateY(6px) rotate(45deg);
}
.menu-btn.is-active span:nth-child(2){
  opacity:0;
}
.menu-btn.is-active span:nth-child(3){
  transform:translateY(-6px) rotate(-45deg);
}

.overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.52);
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
  opacity:0;
  pointer-events:none;
  transition:opacity .28s ease;
  z-index:1190;
}

.overlay.active{
  opacity:1;
  pointer-events:auto;
}

.mobile-menu{
  position:fixed;
  top:0;
  right:0;
  width:min(88vw, 360px);
  height:100dvh;
  background:rgba(15,15,15,.96);
  color:#fff;
  transform:translateX(100%);
  transition:transform .32s cubic-bezier(.22,.61,.36,1);
  z-index:1300;
  padding:22px 18px 24px;
  display:flex;
  flex-direction:column;
  box-shadow:-18px 0 40px rgba(0,0,0,.25);
}

.mobile-menu.active{
  transform:translateX(0);
}

.mobile-menu-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding-bottom:16px;
  border-bottom:1px solid rgba(255,255,255,.12);
}

.mobile-menu-header h3{
  margin:0;
  color:#fff;
  font-size:28px;
  line-height:1;
}

#menuClose{
  border:none;
  background:transparent;
  color:#fff;
  font-size:28px;
  cursor:pointer;
}

.mobile-links{
  display:flex;
  flex-direction:column;
  gap:0;
  margin-top:20px;
}

.mobile-links a{
  display:block;
  padding:16px 0;
  border-bottom:1px solid rgba(255,255,255,.08);
  color:#fff;
  font-size:20px;
  line-height:1;
}

.mobile-links a[aria-current="page"]{
  color:var(--accent);
}

.cart-drawer{
  position:fixed;
  top:0;
  right:0;
  width:min(92vw, 430px);
  height:100dvh;
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  transform:translateX(100%);
  transition:transform .34s cubic-bezier(.22,.61,.36,1);
  z-index:1300;
  display:flex;
  flex-direction:column;
  box-shadow:-18px 0 46px rgba(0,0,0,.16);
  border-left:1px solid rgba(17,17,17,.08);
}

.cart-drawer.active{
  transform:translateX(0);
}

.cart-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:22px 20px 18px;
  border-bottom:1px solid var(--border);
}

.cart-heading{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.cart-label{
  margin:0;
  color:var(--muted);
  font-size:12px;
  line-height:1;
}

.cart-title{
  margin:0;
  font-size:30px;
  line-height:1;
  color:#111;
}

#cartClose{
  border:none;
  background:transparent;
  color:#111;
  font-size:28px;
  line-height:1;
  cursor:pointer;
}

.cart-body{
  flex:1;
  overflow:auto;
  padding:18px 20px;
}

.cart-body::-webkit-scrollbar{
  width:8px;
}
.cart-body::-webkit-scrollbar-thumb{
  background:rgba(17,17,17,.14);
  border-radius:999px;
}

.cart-footer{
  padding:18px 20px 20px;
  border-top:1px solid var(--border);
  background:rgba(255,255,255,.86);
}

#checkoutBtn{
  width:100%;
  min-height:54px;
  border:none;
  border-radius:16px;
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 18px;
  cursor:pointer;
  box-shadow:0 14px 26px rgba(242,140,24,.24);
  transition:transform .2s ease, box-shadow .2s ease;
}

#checkoutBtn:hover,
#checkoutBtn:focus-visible{
  transform:translateY(-1px);
  box-shadow:0 18px 30px rgba(242,140,24,.30);
}

body.menu-open,
body.cart-open,
body.account-open{
  overflow:hidden;
}

@media (max-width: 900px){
  .nav-desktop{
    display:none;
  }

  .menu-btn{
    display:flex;
  }

  .header{
    padding-top:10px;
  }

  .header-inner{
    min-height:72px;
    padding:12px 14px;
    border-radius:18px;
  }

  .logo img{
    height:36px;
  }

  .btn-icon{
    min-width:42px;
    min-height:42px;
    padding:0 12px;
  }

  .cart-drawer{
    width:min(80vw, 420px);
  }
}

@media (max-width: 640px){
  .container{
    width:min(100% - 20px, var(--container));
  }

  .header-inner{
    gap:10px;
  }

  .mobile-menu{
    width:100%;
    padding:20px 16px 22px;
  }

  .mobile-menu-header h3{
    font-size:24px;
  }

  .mobile-links a{
    font-size:18px;
    padding:14px 0;
  }

  .cart-header,
  .cart-body,
  .cart-footer{
    padding-left:16px;
    padding-right:16px;
  }

  .cart-title{
    font-size:26px;
  }

  #checkoutBtn{
    min-height:52px;
    border-radius:14px;
  }
}

@media (prefers-reduced-motion: reduce){
  .header,
  .header-inner,
  .btn-icon,
  .overlay,
  .mobile-menu,
  .cart-drawer,
  .menu-btn span,
  #checkoutBtn{
    transition:none !important;
  }
}

.cart-trigger{
  width:46px;
  height:46px;
  min-width:46px;
  min-height:46px;
  padding:0;
  border-radius:14px;
  overflow:visible;
}

.cart-trigger__icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
  color:#fff;
  transform:translateY(0) scale(1);
  transition:transform .22s ease;
}

.cart-trigger:hover .cart-trigger__icon,
.cart-trigger:focus-visible .cart-trigger__icon{
  transform:translateY(-1px) scale(1.04);
}

.cart-count{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:999px;
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#fff;
  font-size:12px;
  font-weight:800;
  font-family:'Inter', Arial, sans-serif;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 8px 18px rgba(0,0,0,.24);
  transform-origin:center;
}

.cart-count.is-bump{
  animation:cartCountBump .34s cubic-bezier(.22,.61,.36,1);
}

@keyframes cartCountBump{
  0%{
    transform:scale(1);
  }
  35%{
    transform:scale(1.22);
  }
  70%{
    transform:scale(.94);
  }
  100%{
    transform:scale(1);
  }
}

@media (max-width: 900px){
  .cart-trigger{
    width:42px;
    height:42px;
    min-width:42px;
    min-height:42px;
    border-radius:12px;
  }

  .cart-trigger__icon{
    width:20px;
    height:20px;
  }
}

/* =========================
   CART ITEMS
   ========================= */

.cart-empty{
  display:grid;
  place-items:center;
  min-height:220px;
  text-align:center;
  padding:24px 12px;
  border:1px dashed var(--border);
  border-radius:20px;
  background:rgba(17,17,17,.03);
}

.cart-empty p{
  margin:0;
  color:var(--muted);
  font-size:15px;
}

.cart-item{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:16px;
  align-items:center;
  padding:16px 0;
  border-bottom:1px solid rgba(17,17,17,.08);
}

.cart-item:first-child{
  padding-top:0;
}

.cart-item__info{
  min-width:0;
}

.cart-item__info h4{
  margin:0 0 6px;
  font-family:'Inter', Arial, sans-serif;
  font-size:15px;
  line-height:1.35;
  font-weight:700;
  color:#111;
}

.cart-item__info p{
  margin:0;
  font-size:14px;
  color:var(--muted);
  font-weight:600;
}

.cart-item__actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:nowrap;
}

.cart-item__actions span{
  min-width:22px;
  text-align:center;
  font-size:14px;
  font-weight:700;
  color:#111;
}

.cart-item__actions button{
  width:36px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(17,17,17,.10);
  border-radius:12px;
  background:#fff;
  color:#111;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  box-shadow:0 6px 18px rgba(0,0,0,.06);
  transition:
    transform .18s ease,
    background .18s ease,
    border-color .18s ease,
    box-shadow .18s ease;
}

.cart-item__actions button:hover,
.cart-item__actions button:focus-visible{
  transform:translateY(-1px);
  background:#f7f2eb;
  border-color:rgba(17,17,17,.18);
  box-shadow:0 10px 22px rgba(0,0,0,.10);
}

.cart-item__actions button[data-remove]{
  color:#8a1f1f;
  background:#fff7f7;
  border-color:rgba(138,31,31,.14);
}

.cart-item__actions button[data-remove]:hover,
.cart-item__actions button[data-remove]:focus-visible{
  background:#ffecec;
  border-color:rgba(138,31,31,.22);
}

/* Close buttons styling */
#cartClose,
#menuClose{
  width:42px;
  height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(17,17,17,.10);
  border-radius:12px;
  background:#fff;
  color:#111;
  font-size:20px;
  line-height:1;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(0,0,0,.06);
  transition:transform .18s ease, background .18s ease, border-color .18s ease;
}

#cartClose:hover,
#cartClose:focus-visible,
#menuClose:hover,
#menuClose:focus-visible{
  transform:translateY(-1px);
  background:#f7f2eb;
  border-color:rgba(17,17,17,.18);
}

/* =========================
   MOBILE CART WIDTH
   ========================= */

@media (max-width: 900px){
  .cart-drawer{
    width:min(80vw, 420px);
  }
}

@media (max-width: 640px){
  .cart-drawer{
    width:80vw;
    min-width:280px;
    max-width:360px;
  }

  .cart-item{
    grid-template-columns:1fr;
    align-items:flex-start;
  }

  .cart-item__actions{
    margin-top:4px;
  }

  .cart-item__actions button{
    width:34px;
    height:34px;
    border-radius:10px;
  }
}

.cart-body {
  padding: 0 18px 18px;
  overflow-y: auto;
  flex: 1;
}

#cartItems {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 20px;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.cart-item__media {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  background: #f3f4f6;
  flex-shrink: 0;
}

.cart-item__image,
.cart-item__image--placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-item__image--placeholder {
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

.cart-item__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.cart-item__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.cart-item__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 800;
  color: #111827;
}

.cart-item__meta {
  color: #6b7280;
  font-weight: 600;
}

.cart-item__price {
  font-size: 0.95rem;
}

.cart-item__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.cart-item__qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cart-item__qty-btn,
.cart-item__remove {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: #f8fafc;
  color: #111827;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.cart-item__qty-btn:hover,
.cart-item__remove:hover {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.2);
}

.cart-item__remove {
  color: #b42318;
}

.cart-item__qty-value {
  min-width: 18px;
  text-align: center;
  font-weight: 700;
  color: #111827;
}

.cart-item__line-total {
  font-weight: 800;
  color: #111827;
  white-space: nowrap;
}

.cart-footer {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding: 18px;
  background: #fff;
}

.cart-footer__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 1rem;
  color: #111827;
}

.cart-footer__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#clearCartBtn {
  width: fit-content;
  min-width: 130px;
  align-self: flex-start;
  flex: 0 0 auto;
}

#checkoutBtn {
  width: 100%;
  flex: 0 0 auto;
  justify-content: center;
}

.cart-empty {
  padding: 28px 0;
  margin-top: 20px;
  color: #6b7280;
  text-align: center;
}

/* =========================
   ACCOUNT DRAWER
   ========================= */

.account-drawer{
  position:fixed;
  top:0;
  right:0;
  width:min(92vw, 380px);
  height:100dvh;
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  transform:translateX(100%);
  transition:transform .34s cubic-bezier(.22,.61,.36,1);
  z-index:1300;
  display:flex;
  flex-direction:column;
  box-shadow:-18px 0 46px rgba(0,0,0,.16);
  border-left:1px solid rgba(17,17,17,.08);
}

.account-drawer.active{
  transform:translateX(0);
}

.account-drawer__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:22px 20px 18px;
  border-bottom:1px solid var(--border);
}

#accountClose{
  width:42px;
  height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(17,17,17,.10);
  border-radius:12px;
  background:#fff;
  color:#111;
  font-size:20px;
  line-height:1;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(0,0,0,.06);
  transition:transform .18s ease, background .18s ease, border-color .18s ease;
}

#accountClose:hover,
#accountClose:focus-visible{
  transform:translateY(-1px);
  background:#f7f2eb;
  border-color:rgba(17,17,17,.18);
}

.account-drawer__nav{
  flex:1;
  padding:16px;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
}

.account-drawer__links{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.account-drawer__footer{
  margin-top:auto;
  padding-top:16px;
  border-top:1px solid var(--border);
}

.account-drawer__item{
  display:flex;
  align-items:center;
  gap:14px;
  padding:16px;
  border-radius:14px;
  border:1px solid rgba(17,17,17,.07);
  background:#fff;
  color:#111;
  text-decoration:none;
  font-size:15px;
  font-weight:600;
  box-shadow:0 2px 8px rgba(0,0,0,.04);
  transition:transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.account-drawer__item:hover,
.account-drawer__item:focus-visible{
  transform:translateY(-1px);
  background:#f7f2eb;
  border-color:rgba(17,17,17,.12);
  box-shadow:0 6px 18px rgba(0,0,0,.08);
}

.account-drawer__item-icon{
  width:40px;
  height:40px;
  border-radius:12px;
  background:rgba(242,140,24,.10);
  color:var(--accent);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}

.account-drawer__item-label{
  flex:1;
}

.account-drawer__item-arrow{
  color:var(--muted);
  flex-shrink:0;
  transition:transform .18s ease, color .18s ease;
}

.account-drawer__item:hover .account-drawer__item-arrow,
.account-drawer__item:focus-visible .account-drawer__item-arrow{
  transform:translateX(2px);
  color:var(--accent);
}

.account-drawer__item--logout{
  color:#8a1f1f;
  border-color:rgba(138,31,31,.10);
}

.account-drawer__item--logout .account-drawer__item-icon{
  background:rgba(138,31,31,.08);
  color:#8a1f1f;
}

.account-drawer__item--logout:hover,
.account-drawer__item--logout:focus-visible{
  background:#fff7f7;
  border-color:rgba(138,31,31,.16);
}

@media (max-width:640px){
  .account-drawer{
    width:80vw;
    min-width:280px;
    max-width:360px;
  }
}

@media (prefers-reduced-motion:reduce){
  .account-drawer{
    transition:none !important;
  }
  .account-drawer__item{
    transition:none !important;
  }
}

/* =========================
   ACCOUNT / LOGIN ICON
   ========================= */

.account-btn{
  width:46px;
  height:46px;
  min-width:46px;
  min-height:46px;
  padding:0;
  border-radius:14px;
  text-decoration:none;
  overflow:visible;
}

.account-btn svg{
  display:block;
  color:#fff;
  transition:transform .22s ease;
}

.account-btn:hover svg,
.account-btn:focus-visible svg{
  transform:translateY(-1px) scale(1.04);
}

@media (max-width: 900px){
  .account-btn{
    width:42px;
    height:42px;
    min-width:42px;
    min-height:42px;
    border-radius:12px;
  }
}
