:root {
    --primary: rgb(245, 158, 29);
    --dark: rgb(15, 23, 39);
    --border: #eaeaea;
    --soft: #f7f7f7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--dark);
    background: #fff;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
}

/* Override Bootstrap's fluid h3 that conflicts with component-specific sizes */
h3, .h3 { font-size: 1.5rem; }
@media (max-width: 768px) { h3, .h3 { font-size: 1.25rem; } }

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
}

.korejo-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 768px) {
    .korejo-container {
        padding: 0 16px;
    }
}

/* ================= HEADER ================= */
header {
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 999;
}

.top-row {
    max-width: 1400px;
    margin: auto;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.logo {
    font-size: 26px;
    font-weight: 800;
    text-decoration: none;
    color: var(--dark);
    font-family: 'Space Grotesk', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 32px;
}

/* SEARCH (DESKTOP) */
.search-desktop {
    flex: 1;
    max-width: 560px;
    display: flex;
    background: #f1f5f9;
    border-radius: 28px;
    overflow: hidden;
    border: 1.5px solid transparent;
    transition: all 0.3s;
}

.search-desktop:focus-within {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(245, 158, 29, 0.08);
}

.search-desktop input {
    flex: 1;
    border: none;
    background: none;
    padding: 11px 18px;
    outline: none;
    font-size: 14px;
    color: var(--dark);
}

.search-desktop input::placeholder {
    color: #94a3b8;
}

.search-desktop button {
    background: none;
    border: none;
    padding: 0 18px 0 0;
    color: #64748b;
    cursor: pointer;
    transition: 0.3s;
    font-size: 18px;
    display: flex;
    align-items: center;
}

.search-desktop button:hover {
    color: var(--primary);
}

/* ICONS */
.icons {
    display: flex;
    gap: 20px;
}

.icon {
    position: relative;
    font-size: 24px;
    cursor: pointer;
    transition: 0.3s;
}

.icon:hover {
    color: var(--primary);
}

.icon .badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* SEARCH (MOBILE) */
.search-mobile {
    display: none;
    padding: 0 16px 14px;
}

.search-mobile .search {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 24px;
    overflow: hidden;
    border: 1.5px solid transparent;
    transition: all 0.3s;
}

.search-mobile .search:focus-within {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(245, 158, 29, 0.08);
}

.search-mobile input {
    flex: 1;
    border: none;
    background: none;
    padding: 11px 14px 11px 16px;
    outline: none;
    font-size: 14px;
    color: var(--dark);
}

.search-mobile input::placeholder {
    color: #94a3b8;
}

.search-mobile button {
    background: none;
    border: none;
    padding: 0 14px 0 0;
    color: #64748b;
    cursor: pointer;
    font-size: 17px;
    display: flex;
    align-items: center;
    transition: 0.3s;
}

.search-mobile button:hover {
    color: var(--primary);
}

/* ================= NAV (DESKTOP) ================= */
.nav {
    display: flex;
    justify-content: center;
    gap: 28px;
    padding: 12px;
    border-top: 1px solid var(--border);
    font-family: 'Montserrat';
}

.nav a {
    text-decoration: none;
    color: var(--dark);
    font-size: 14px;
    position: relative;
    transition: 0.3s;
}

.nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: 0.3s;
}

.nav a:hover {
    color: var(--primary);
}

.nav a:hover::after {
    width: 100%;
}

/* ================= BOTTOM BAR ================= */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid var(--border);
    display: none;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 999;
    animation: slideUp 0.3s ease;
}

.bottom-bar a {
    text-decoration: none;
    color: var(--dark);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: 0.3s;
}

.bottom-bar a i {
    font-size: 18px;
}

.bottom-bar a .badge {
    position: absolute;
    top: 5px;
    right: 20%;
    background: var(--primary);
    color: white;
    font-size: 9px;
    font-weight: 800;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid white;
}

.bottom-bar a:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ================= MOBILE ================= */
@media(max-width:768px) {

    .search-desktop {
        display: none;
    }

    .search-mobile {
        display: block;
    }

    .nav {
        display: none;
    }

    .bottom-bar {
        display: flex;
    }

    /* ─── Modern mobile header ─── */
    header {
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    }

    .top-row {
        padding: 14px 16px 10px;
        gap: 16px;
    }

    .logo {
        font-size: 22px;
        gap: 8px;
    }

    .logo img {
        height: 28px;
    }

    .icons {
        gap: 18px;
    }

    .icon {
        font-size: 22px;
    }

    .icon .badge {
        width: 18px;
        height: 18px;
        font-size: 9px;
        top: -5px;
        right: -9px;
        border-width: 2px;
    }

    .search-mobile {
        padding: 0 16px 14px;
    }

    .search-mobile input {
        padding: 11px 14px 11px 16px;
        font-size: 14px;
    }
}

@media(max-width:480px) {
    .top-row {
        padding: 12px 14px 8px;
        gap: 14px;
    }

    .logo {
        font-size: 20px;
    }

    .logo img {
        height: 24px;
    }

    .icons {
        gap: 16px;
    }

    .icon {
        font-size: 20px;
    }

    .search-mobile {
        padding: 0 14px 12px;
    }

    .search-mobile input {
        padding: 10px 12px 10px 14px;
        font-size: 13px;
    }
}

.error-box {
    display: none;
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
}

.user-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 20px;
}

.user-dashboard-head {
    min-height: 210px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 34px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 39, .06);
}

.user-dashboard-head span {
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: .08em;
}

.user-dashboard-head h1 {
    margin: 8px 0 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 38px;
}

.user-dashboard-head p {
    max-width: 560px;
    margin: 0;
    color: #64748b;
    line-height: 1.7;
}

.user-dashboard-head a {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.user-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.user-dashboard-card {
    min-height: 180px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 22px;
    background: #fff;
    color: var(--dark);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    transition: transform .2s, box-shadow .2s;
}

.user-dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(15, 23, 39, .08);
}

.user-dashboard-card i {
    color: var(--primary);
    font-size: 30px;
}

.user-dashboard-card strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
}

.user-dashboard-card small {
    color: #64748b;
    line-height: 1.5;
}

.category-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 20px;
}

.category-hero {
    min-height: 280px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--border);
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    gap: 24px;
    align-items: center;
    padding: 34px;
}

.category-parent {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.category-hero h1 {
    margin: 8px 0 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 42px;
}

.category-hero p {
    margin: 0;
    color: #64748b;
    line-height: 1.8;
}

.category-hero img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
}

.category-subgrid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.category-subcard {
    min-height: 160px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--dark);
    text-decoration: none;
    display: grid;
    gap: 12px;
}

.category-subcard img,
.category-subcard span {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 8px;
}

.category-subcard img {
    object-fit: cover;
}

.category-subcard span {
    display: grid;
    place-items: center;
    background: #f8fafc;
    color: var(--primary);
    font-size: 28px;
}

.category-products-empty {
    min-height: 220px;
    margin-top: 18px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    color: #64748b;
}

.category-products-empty i {
    color: var(--primary);
    font-size: 34px;
}


.kf-footer01 {
    background: var(--dark);
    margin-top: 60px;
}

.kf-top01 {
    max-width: 1400px;
    margin: auto;
    padding: 60px 20px 40px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.2fr;
    gap: 40px;
}

.kf-logo01 {
    color: #fff;
    text-decoration: none;
    font-size: 32px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 18px;
    display: inline-block;
}

.kf-col01 p {
    color: rgba(255, 255, 255, .7);
    line-height: 1.8;
    font-size: 14px;
}

.kf-col01 h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 18px;
    font-family: 'Space Grotesk', sans-serif;
}

.kf-col01 ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.kf-col01 ul li {
    margin-bottom: 12px;
}

.kf-col01 ul li a {
    text-decoration: none;
    color: rgba(255, 255, 255, .7);
    transition: .3s;
    font-size: 14px;
}

.kf-col01 ul li a:hover {
    color: var(--primary);
}

.kf-social01 {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.kf-social01 a {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .3s;
}

.kf-social01 a:hover {
    background: var(--primary);
}

.kf-contact01 li {
    color: rgba(255, 255, 255, .7);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.kf-contact01 i {
    color: var(--primary);
}

.kf-bottom01 {
    border-top: 1px solid rgba(255, 255, 255, .08);
    text-align: center;
    padding: 18px;
}

.kf-bottom01 p {
    color: rgba(255, 255, 255, .6);
    font-size: 13px;
    margin: 0;
}

@media(max-width:900px) {

    .kf-top01 {
        grid-template-columns: 1fr 1fr;
    }

    .user-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-hero {
        grid-template-columns: 1fr;
    }

    .category-subgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .kf-footer01{
        display: none;
    }

}

@media(max-width:600px) {

    .kf-top01 {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 40px 20px;
    }

    .kf-logo01 {
        font-size: 28px;
    }

    .user-dashboard {
        padding: 20px 14px 80px;
    }

    .user-dashboard-head {
        padding: 24px;
        flex-direction: column;
        min-height: auto;
    }

    .user-dashboard-head h1 {
        font-size: 30px;
    }

    .user-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .category-page {
        padding: 20px 14px 80px;
    }

    .category-hero {
        padding: 24px;
    }

    .category-hero h1 {
        font-size: 32px;
    }

    .category-subgrid {
        grid-template-columns: 1fr;
    }

}

/* =======================
   CART DRAWER
======================= */
.cart-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    backdrop-filter: blur(4px);
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: #fff;
    z-index: 2001;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cart-drawer.open { right: 0; }
.cart-drawer-overlay.open { opacity: 1; visibility: visible; }

.cart-drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-drawer-header h3 { font-size: 18px; margin: 0; font-weight: 800; font-family: 'Space Grotesk', sans-serif; }
.cart-close { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--muted); }

.cart-drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; }

.cart-item-row { display: grid; grid-template-columns: 80px 1fr auto; gap: 15px; margin-bottom: 20px; position: relative; }
.cart-item-img { aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }

.cart-item-name { font-weight: 700; font-size: 14px; margin-bottom: 5px; color: var(--dark); }
.cart-item-options { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.cart-item-options span { background: var(--soft); padding: 2px 8px; border-radius: 4px; margin-right: 5px; }
.cart-item-price { font-weight: 800; color: var(--primary); font-size: 15px; margin-bottom: 10px; }

.cart-item-qty { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; width: fit-content; overflow: hidden; }
.qty-btn { width: 30px; height: 30px; background: var(--soft); border: none; cursor: pointer; font-weight: 700; }
.cart-item-qty input { width: 40px; border: none; text-align: center; font-size: 13px; font-weight: 700; background: transparent; }

.cart-item-remove { background: none; border: none; color: #ef4444; cursor: pointer; padding: 5px; font-size: 18px; transition: 0.3s; }
.cart-item-remove:hover { transform: scale(1.1); }

.cart-empty-msg { text-align: center; padding: 60px 0; color: var(--muted); }
.cart-empty-msg i { font-size: 48px; display: block; margin-bottom: 15px; opacity: 0.2; }

.cart-drawer-footer { padding: 24px; border-top: 1px solid var(--border); background: var(--soft); }
.cart-summary { display: flex; justify-content: space-between; font-size: 18px; margin-bottom: 20px; }
.cart-summary strong { color: var(--dark); font-weight: 800; font-family: 'Space Grotesk', sans-serif; }

.cart-actions { display: grid; gap: 10px; }
.btn-checkout { background: var(--dark); color: #fff; text-align: center; padding: 14px; border-radius: 12px; font-weight: 800; text-decoration: none; transition: 0.3s; }
.btn-continue { background: #fff; color: var(--dark); text-align: center; padding: 12px; border-radius: 12px; font-weight: 700; text-decoration: none; border: 1px solid var(--border); }
.btn-checkout:hover { background: var(--primary); }

/* ═══════════════════════════════════════
   CART DRAWER — APPLIED DEALS SECTION
   ═══════════════════════════════════════ */

.cart-deals-container {
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

.cart-deals-section {
  padding: 14px 24px;
}

.cart-deals-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-deals-title i {
  color: var(--primary);
  font-size: 13px;
}

.cart-deal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--dark);
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 10px;
  transition: all 0.2s;
}

.cart-deal-row:last-child {
  margin-bottom: 0;
}

.cart-deal-row:hover {
  border-color: #d1d5db;
}

.cart-deal-row .deal-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.cart-deal-row .deal-icon.icon-discount {
  background: #fef2f2;
  color: #ef4444;
}

.cart-deal-row .deal-icon.icon-shipping {
  background: #eff6ff;
  color: #3b82f6;
}

.cart-deal-row .deal-icon.icon-gift {
  background: #fffbeb;
  color: #f59e0b;
}

.cart-deal-row .deal-icon.icon-check {
  background: #f0fdf4;
  color: #10b981;
}

.cart-deal-row span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.cart-deal-row .deal-amount {
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.cart-deal-row .deal-amount.negative {
  color: #ef4444;
  background: #fef2f2;
}

.cart-deal-row .deal-amount.positive {
  color: #10b981;
  background: #f0fdf4;
}

.cart-deal-row .deal-amount.info {
  color: #3b82f6;
  background: #eff6ff;
}

/* =======================
   ANIMATIONS
======================= */
@keyframes flyToCart {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.8; }
    100% { left: var(--target-x); top: var(--target-y); transform: scale(0.2); opacity: 0; }
}

@keyframes badgeBump {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.flying-item {
    position: fixed;
    z-index: 9999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    background-size: cover;
    background-position: center;
    pointer-events: none;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    border: 3px solid #fff;
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cart-count.bump {
    animation: badgeBump 0.4s ease-out;
}

@media (max-width: 600px) {
    .cart-drawer { width: 100%; right: -100%; }
}
