/* ==========================================================
   Amazon-Style UI — Eclothing Frontend
   ========================================================== */
:root {
    /* Amazon palette */
    --amz-header: #131921;
    --amz-nav: #232f3e;
    --amz-accent: #febd69;
    --amz-accent-hover: #f3a847;
    --amz-link: #007185;
    --amz-link-hover: #c7511f;
    --amz-price: #0F1111;
    --amz-deal: #CC0C39;
    --amz-star: #FFA41C;
    --amz-bg: #EAEDED;
    --amz-card: #ffffff;
    --amz-border: #DDD;
    --amz-text: #0F1111;
    --amz-text-secondary: #565959;
    --amz-footer-mid: #37475A;
    --amz-footer-bottom: #131A22;
    --radius: 4px;
    --transition: 0.2s ease;
    /* Backward compat */
    --brand: #febd69;
    --brand-hover: #f3a847;
    --daraz-orange: #febd69;
    --daraz-orange-hover: #f3a847;
    --daraz-dark: #131921;
    --daraz-gray: #565959;
    --daraz-light-gray: #EAEDED;
    --daraz-border: #DDD;
    --white: #ffffff;
    --black: #000000;
    --dark: #131921;
    --text: #0F1111;
    --text-secondary: #565959;
    --light: #EAEDED;
    --surface: #ffffff;
    --border: #DDD;
    --green: #007600;
    --muted: #565959;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    overflow-x: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Amazon Ember', Arial, sans-serif;
    background-color: var(--amz-bg);
    color: var(--amz-text);
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.header-wrapper, .top-bar, .footer {
    max-width: 100vw;
    overflow-x: hidden;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
}

/* ==========================================================
   TOP BAR — Amazon dark nav strip
   ========================================================== */
.top-bar {
    background: var(--amz-nav);
    font-size: 13px;
    padding: 0;
    line-height: 40px;
    border-bottom: 3px solid #febd69;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    position: relative;
    z-index: 50;
    margin-bottom: 4px;
}

.top-bar .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.top-bar-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    justify-content: center;
    flex: 1;
}

.top-bar a {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    padding: 0 10px;
    transition: background var(--transition);
    text-transform: none;
    letter-spacing: 0;
    line-height: 40px;
    display: inline-block;
}

.top-bar a:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.top-bar-auth {
    border-left: 1px solid rgba(255,255,255,0.2);
    margin-left: 8px;
    padding-left: 4px;
}

.top-bar-auth a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 0 14px;
    line-height: 40px;
}

/* ==========================================================
   HEADER — Amazon dark header
   ========================================================== */
.header-wrapper {
    background: var(--amz-header);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: none;
    backdrop-filter: none;
}

.header-wrapper:hover {
    box-shadow: none;
}

.header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    flex-wrap: nowrap;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.3px;
    gap: 4px;
    flex-shrink: 0;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: border-color var(--transition);
}

.logo:hover {
    border-color: #fff;
}

.logo img {
    height: 34px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* Search — Amazon style */
.search-box {
    flex-grow: 1;
    display: flex;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    border: none;
    height: 42px;
    transition: box-shadow var(--transition);
}

.search-box:focus-within {
    box-shadow: 0 0 0 3px var(--amz-accent);
    border-color: transparent;
    background: #fff;
}

.search-box input {
    flex-grow: 1;
    padding: 0 14px;
    border: none;
    background: #fff;
    outline: none;
    font-size: 15px;
    color: var(--amz-text);
    font-family: inherit;
    height: 100%;
}

.search-box input::placeholder {
    color: #888;
}

.search-box button {
    background: var(--amz-accent);
    border: none;
    color: var(--amz-text);
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    height: 42px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-size: 18px;
    transition: background var(--transition);
    border-radius: 0 4px 4px 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-box button:hover {
    background: var(--amz-accent-hover);
}

/* Cart icon */
.cart-icon {
    font-size: 26px;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: border-color var(--transition);
    position: relative;
}

.cart-icon:hover {
    border-color: #fff;
    color: #fff;
    background: transparent;
}

/* Auth links */
.auth-links {
    display: flex;
    align-items: center;
    gap: 2px;
}

.auth-links a {
    text-decoration: none;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: border-color var(--transition);
    white-space: nowrap;
    background: transparent;
}

.auth-links a:hover {
    border-color: #fff;
    color: #fff;
    background: transparent;
}

.auth-links a:first-child {
    background: transparent;
    color: #fff;
}

.auth-links a:first-child:hover {
    background: transparent;
    border-color: #fff;
    color: #fff;
}

/* ==========================================================
   HERO SLIDER — Daraz / Amazon style full-width banner
   ========================================================== */
.hero-slider-container {
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
    height: 380px;
}

.hero-slider { width: 100%; height: 100%; position: relative; }

.hero-slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    z-index: 1;
}

.hero-slide.active { opacity: 1; visibility: visible; z-index: 2; }

.hero-slide-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: stretch;
    height: 100%;
}

.hero-slide-content {
    flex: 1 1 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 50px 40px 50px 30px;
    z-index: 3;
    position: relative;
}

.hero-badge-new {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--amz-deal); color: #fff;
    padding: 5px 14px; border-radius: 2px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px;
    margin-bottom: 16px; width: fit-content;
}

.slide-title {
    font-size: 36px; font-weight: 800;
    color: #0F1111; margin-bottom: 12px;
    line-height: 1.15; letter-spacing: -0.3px;
}

.slide-subtitle {
    font-size: 15px; color: #565959;
    margin-bottom: 24px; line-height: 1.6; max-width: 420px;
}

.hero-promo-wrap {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px; flex-wrap: wrap;
}

.promo-discount-badge {
    background: var(--amz-deal); color: #fff;
    padding: 4px 10px; font-weight: 700;
    border-radius: 2px; font-size: 13px;
}

.promo-text {
    font-size: 14px; color: #565959; font-weight: 400;
}

.hero-emi-badge {
    font-size: 13px; color: #0F1111;
    background: #fff; padding: 8px 14px;
    border-radius: 3px;
    display: inline-flex; align-items: center; gap: 8px;
    margin-bottom: 20px; border: 1px solid #DDD;
    font-weight: 400; width: fit-content;
}

.hero-emi-badge i { color: var(--green); }

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

.hero-primary-btn {
    background: #FFD814;
    color: #0F1111;
    padding: 11px 28px; border-radius: 8px;
    font-weight: 400; font-size: 14px;
    text-decoration: none; display: inline-flex;
    align-items: center; gap: 8px;
    box-shadow: none;
    transition: all var(--transition);
    border: 1px solid #FCD200; font-family: inherit;
}

.hero-primary-btn:hover {
    background: #F7CA00;
    box-shadow: none;
    color: #0F1111;
}

.hero-secondary-btn {
    background: #fff; color: #0F1111;
    border: 1px solid #D5D9D9; padding: 11px 28px;
    border-radius: 8px; font-weight: 400; font-size: 14px;
    text-decoration: none; transition: all var(--transition);
    font-family: inherit;
}

.hero-secondary-btn:hover {
    background: #f7fafa; border-color: #B6B6B6;
    color: #0F1111;
}

.hero-slide-image {
    flex: 0 0 40%; position: relative;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; padding: 10px 16px 10px 0;
}

.hero-slide-image img {
    max-width: 100%; max-height: 100%; width: auto; height: auto;
    object-fit: contain;
    transition: transform 0.4s ease;
    border-radius: 4px;
}

.hero-slide-image:hover img { transform: scale(1.02); }

.image-gradient-overlay { display: none; }

/* Slider Controls */
.slider-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: 1px solid #ddd; width: 40px; height: 80px;
    border-radius: 0; display: flex; align-items: center;
    justify-content: center; cursor: pointer; font-size: 20px;
    color: #333; transition: all var(--transition); z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.slider-btn:hover {
    background: #fff; color: #000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.12);
    transform: translateY(-50%);
}

.prev-btn { left: 0; }
.next-btn { right: 0; }

.slider-dots {
    position: absolute; bottom: 14px; left: 50%;
    transform: translateX(-50%); display: flex; gap: 6px; z-index: 10;
}

.dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(0,0,0,0.15); cursor: pointer;
    transition: all var(--transition); border: 1px solid rgba(0,0,0,0.1);
}

.dot.active {
    background: #0F1111; width: 20px; border-radius: 8px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================
   HERO FEATURES — Daraz trust strip below banner
   ========================================================== */
.hero-features {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 0; background: #fff;
    border: 1px solid #e0e0e0; border-radius: 4px;
    margin: 16px 0 24px; overflow: hidden;
}

.hero-feature {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 20px;
    border-right: 1px solid #f0f0f0;
    transition: background 0.15s; cursor: pointer;
    text-decoration: none; color: inherit;
}

.hero-feature:last-child { border-right: none; }

.hero-feature:hover {
    background: #f5f5f5;
    text-decoration: none; color: inherit;
}

.hero-feature-icon {
    width: 40px; height: 40px; border-radius: 50%;
    background: #FFF0D4; color: #E47911;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}

.hero-feature-text h4 {
    font-size: 13px; font-weight: 700;
    color: #0F1111; margin-bottom: 2px; line-height: 1.3;
}

.hero-feature-text p {
    font-size: 12px; color: #565959;
    line-height: 1.3; margin: 0;
}

/* ==========================================================
   SECTION TITLES — Amazon style
   ========================================================== */
.section-title {
    font-size: 20px; color: #0F1111;
    margin-bottom: 16px; font-weight: 700;
    letter-spacing: 0; display: flex;
    align-items: center; gap: 10px;
    padding: 20px 0 8px; border-bottom: none;
}

.section-title::before { display: none; }
.section-title::after {
    content: ''; flex: 1; height: 1px;
    background: #e0e0e0;
}

/* ==========================================================
   PRODUCT GRID — Amazon product cards
   ========================================================== */
.product-grid {
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 12px; margin-bottom: 40px;
}

.product-card {
    background: #fff; border-radius: 2px;
    overflow: hidden; text-decoration: none;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex; flex-direction: column;
    border: none; position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.product-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.product-img {
    width: 100%; padding-top: 100%;
    position: relative; background: #fff; overflow: hidden;
}

.product-img img {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: contain; padding: 12px;
    transition: transform 0.3s ease;
    background: #fff;
}

.product-card:hover .product-img img { transform: scale(1.05); }

.discount-ribbon {
    position: absolute; top: 8px; left: 0;
    background: #F85606; color: #fff;
    padding: 3px 10px; font-size: 11px; font-weight: 700;
    z-index: 2; border-radius: 0 2px 2px 0;
}

.product-details {
    padding: 12px 12px 14px; display: flex;
    flex-direction: column; flex-grow: 1;
    border-top: 1px solid #f5f5f5;
}

.product-name {
    font-size: 13px; color: #212121;
    line-height: 1.4; height: 36px;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; margin-bottom: 8px;
    font-weight: 400;
}

.product-name:hover { color: #F85606; text-decoration: none; }

.product-price {
    font-size: 22px; color: #F85606;
    font-weight: 700; margin-bottom: 2px; letter-spacing: -0.3px;
}

.product-price::before {
    content: ''; font-size: 13px; vertical-align: top;
}

.product-old-price-container {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; min-height: 16px;
}

.old-price {
    color: #9e9e9e; text-decoration: line-through; font-size: 12px;
}

.discount-badge {
    color: #F85606; font-weight: 700;
    background: #FFF0E9; padding: 1px 6px;
    border-radius: 2px; font-size: 11px;
}

/* Cart icon label */
.cart-label {
    font-size: 12px; color: #fff; font-weight: 700;
    margin-left: 4px;
}

/* Product card links */
.product-img-link { display: block; text-decoration: none; color: inherit; }
.product-name-link { text-decoration: none; color: inherit; }
.product-name-link:hover .product-name { color: #F85606; }

/* Price row */
.product-price-row {
    display: flex; align-items: baseline; gap: 8px;
    flex-wrap: wrap; margin-bottom: 4px;
}

/* EMI line */
.product-emi {
    font-size: 11px; color: #757575;
    margin-bottom: 4px;
}

/* Delivery line */
.product-delivery {
    font-size: 11px; color: #388E3C;
    margin-bottom: 10px; font-weight: 500;
}
.product-delivery i { color: #388E3C; margin-right: 4px; font-size: 10px; }

/* Placeholder */
.product-img-placeholder {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #ccc; font-size: 2rem; background: #fafafa;
}

/* Add to Cart — Daraz orange button */
.add-to-cart-btn {
    margin-top: auto; width: 100%;
    background: #F85606;
    color: #fff; border: none;
    padding: 9px 0; border-radius: 2px;
    font-size: 13px; font-weight: 600;
    cursor: pointer; text-transform: none;
    letter-spacing: 0; transition: background 0.2s;
    font-family: inherit;
}

.add-to-cart-btn:hover {
    background: #E04D05;
}

/* Empty state */
.empty-state {
    grid-column: 1 / -1; text-align: center;
    padding: 60px 20px; background: #fff;
    border: 1px solid var(--amz-border); border-radius: var(--radius);
}
.empty-state i { font-size: 48px; color: #ccc; display: block; margin-bottom: 12px; }
.empty-state p { color: #565959; font-size: 16px; }

/* Back to top */
.back-to-top {
    background: #37475A; text-align: center;
    padding: 14px 0; cursor: pointer;
    color: #DDD; font-size: 13px;
    transition: background 0.2s;
}
.back-to-top:hover { background: #485769; }

/* Footer social */
.footer-social {
    display: flex; gap: 16px; margin-top: 6px;
}
.footer-social a {
    font-size: 22px; color: #DDD;
    transition: color var(--transition);
}
.footer-social a:hover { color: #fff; }

/* Footer bottom / copyright */
.footer-bottom {
    background: #131A22; text-align: center;
    padding: 20px 16px; color: #999; font-size: 12px;
}

/* ==========================================================
   FOOTER — Amazon multi-tier dark footer
   ========================================================== */
.footer {
    background: var(--amz-nav); padding: 40px 0 0;
    margin-top: 0; color: #ddd;
}

.footer-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 30px; padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-col h4 {
    color: #fff; font-size: 16px;
    margin-bottom: 14px; font-weight: 700;
    text-transform: none; letter-spacing: 0;
    position: static; padding-bottom: 0;
}

.footer-col h4::after { display: none; }

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }

.footer-col a {
    color: #DDD; text-decoration: none;
    font-size: 14px; transition: color var(--transition);
    display: inline-block;
}

.footer-col a:hover {
    color: #fff; text-decoration: underline;
    transform: none;
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 1200px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 992px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .header { gap: 10px; flex-wrap: wrap; }
    .hero-features { grid-template-columns: repeat(2, 1fr); }
    .hero-feature { border-bottom: 1px solid #f0f0f0; }
    .hero-feature:nth-child(2) { border-right: none; }
}

@media (max-width: 768px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .top-bar { display: none; }
    .hero-slider-container { height: 300px; }
    .hero-slide-content { padding: 30px 20px; }
    .hero-slide-image { display: none; }
    .hero-slide-inner { flex-direction: column; }
    .hero-slide-content { flex: 1 1 100%; }
    .slide-title { font-size: 24px; }
    .header { gap: 8px; flex-wrap: wrap; }
    .search-box { order: 3; flex-basis: 100%; width: 100%; }
    .auth-links { width: 100%; display: flex; justify-content: flex-end; }
    .hero-features { grid-template-columns: repeat(2, 1fr); }
    .hero-feature { border-bottom: 1px solid #f0f0f0; }
    .hero-feature:nth-child(2) { border-right: none; }
    .hero-feature:nth-child(4) { border-right: none; }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .hero-slide-content { padding: 24px 14px; }
    .slide-title { font-size: 20px; }
    .hero-primary-btn, .hero-secondary-btn { padding: 9px 18px; font-size: 13px; }
    .product-grid { gap: 8px; }
    .container { padding-left: 10px; padding-right: 10px; }
    .hero-features { grid-template-columns: 1fr; }
    .hero-feature { padding: 14px 16px; border-right: none; border-bottom: 1px solid #f0f0f0; }
    .hero-feature:last-child { border-bottom: none; }
}
