/* ==========================================================================
   Flipkart Clone — front-end stylesheet
   Palette and layout mirror the Flipkart storefront.
   ========================================================================== */

:root {
    --blue:        #2874f0;
    --blue-dark:   #1a5ed6;
    --yellow:      #ff9f00;
    --orange:      #fb641b;
    --green:       #388e3c;
    --red:         #ff6161;
    --page-bg:     #f1f3f6;
    --card-bg:     #ffffff;
    --text:        #212121;
    --text-soft:   #878787;
    --text-mid:    #565656;
    --border:      #f0f0f0;
    --border-dark: #e0e0e0;
    --footer-bg:   #172337;
    --shadow:      0 1px 2px 0 rgba(0, 0, 0, .08);
    --shadow-lg:   0 2px 10px 0 rgba(0, 0, 0, .12);
    --radius:      2px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: Roboto, -apple-system, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--page-bg);
    line-height: 1.4;
}

a    { color: inherit; text-decoration: none; }
img  { max-width: 100%; display: block; }
ul   { list-style: none; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

.container    { max-width: 1248px; margin: 0 auto; padding: 0 12px; }
.container-lg { max-width: 1600px; margin: 0 auto; padding: 0 16px; }

.card {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.hide { display: none !important; }
.text-green  { color: var(--green); }
.text-soft   { color: var(--text-soft); }
.text-center { text-align: center; }
.strike      { text-decoration: line-through; color: var(--text-soft); font-weight: 400; }

/* ==========================================================================
   Header
   ========================================================================== */

.header {
    background: var(--blue);
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .2);
}

.header-inner {
    max-width: 1600px;
    margin: 0 auto;
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- logo --- */
.logo { display: block; padding: 0 4px; }

.logo-title {
    display: flex;
    align-items: baseline;
    font-size: 15px;
    font-style: italic;
    font-weight: 700;
    color: #fff;
    letter-spacing: .2px;
}

.logo-sub {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-style: italic;
    color: #fff;
    margin-top: -3px;
}

.logo-sub b { color: var(--yellow); font-weight: 500; }
.logo-sub svg { width: 10px; height: 10px; }

/* --- search --- */
.search-form {
    flex: 1;
    min-width: 0;          /* flex items default to min-width:auto and refuse to shrink */
    max-width: 570px;
    position: relative;
}

.search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: var(--radius);
    height: 36px;
    padding: 0 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .08);
}

.search-box button {
    background: none;
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: var(--blue);
    padding: 0 8px 0 0;
}

.search-box input {
    flex: 1;
    min-width: 0;          /* inputs carry an intrinsic size; let it collapse */
    border: 0;
    outline: 0;
    font-size: 14px;
    color: var(--text);
    background: transparent;
}

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

/* live suggestions */
.suggestions {
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    overflow: hidden;
    z-index: 120;
}

.suggestions a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.suggestions a:last-child { border-bottom: 0; }
.suggestions a:hover      { background: #f5faff; }
.suggestions img          { width: 38px; height: 38px; object-fit: contain; }
.suggestions .s-name      { font-size: 13px; }
.suggestions .s-cat       { font-size: 11px; color: var(--text-soft); }

/* --- header actions --- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 26px;
    margin-left: auto;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.btn-login {
    background: #fff;
    color: var(--blue);
    font-weight: 600;
    padding: 5px 40px;
    border-radius: var(--radius);
    white-space: nowrap;
}

.btn-login:hover { background: #f7f7f7; }

.header-link {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    cursor: pointer;
    position: relative;
}

.cart-link { position: relative; }

.cart-badge {
    position: absolute;
    top: -8px;
    left: 12px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 1px solid var(--blue);
}

/* --- account dropdown --- */
.dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    width: 232px;
    background: #fff;
    color: var(--text);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-weight: 400;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: .15s ease;
    z-index: 130;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 24px;
    border: 6px solid transparent;
    border-top: 0;
    border-bottom-color: #fff;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.dropdown-menu a:last-child { border-bottom: 0; }
.dropdown-menu a:hover      { background: #f5faff; color: var(--blue); }
.dropdown-menu svg          { color: var(--blue); flex-shrink: 0; }

/* ==========================================================================
   Category navigation strip
   ========================================================================== */

.catnav {
    background: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 56px;
    z-index: 90;
}

.catnav-inner {
    max-width: 1248px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.catnav-inner::-webkit-scrollbar { display: none; }

.catnav-item {
    position: relative;
    padding: 8px 12px 6px;
    text-align: center;
    flex-shrink: 0;
}

.catnav-item img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin: 0 auto;
    transition: transform .2s;
}

.catnav-item span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 2px;
    white-space: nowrap;
}

.catnav-item:hover img  { transform: translateY(-3px); }
.catnav-item:hover span { color: var(--blue); }

.catnav-item .chev { transition: transform .2s; }
.catnav-item:hover .chev { transform: rotate(180deg); }

.catnav-sub {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: #fff;
    box-shadow: var(--shadow-lg);
    text-align: left;
    padding: 6px 0;
    opacity: 0;
    visibility: hidden;
    transition: .15s;
    z-index: 95;
}

.catnav-item:hover .catnav-sub { opacity: 1; visibility: visible; }

.catnav-sub a {
    display: block;
    padding: 9px 20px;
    font-size: 14px;
    white-space: nowrap;
}

.catnav-sub a:hover { background: #f5faff; color: var(--blue); }

/* ==========================================================================
   Flash messages
   ========================================================================== */

.flash {
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: var(--radius);
    font-size: 14px;
    border-left: 4px solid;
}

.flash-success { background: #e8f5e9; border-color: var(--green); color: #1b5e20; }
.flash-error   { background: #fff0f0; border-color: var(--red);   color: #b71c1c; }
.flash-info    { background: #e8f1fe; border-color: var(--blue);  color: #0d47a1; }

/* ==========================================================================
   Home page
   ========================================================================== */

.home { padding: 10px 0 24px; }

/* --- hero slider --- */
.slider {
    position: relative;
    background: #fff;
    overflow: hidden;
    margin-bottom: 10px;
}

.slides {
    display: flex;
    transition: transform .45s ease;
}

.slides a { min-width: 100%; }

.slides img {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 72px;
    background: #fff;
    border: 0;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}

.slider-btn:hover { color: var(--blue); }
.slider-btn.prev  { left: 0;  border-radius: 0 4px 4px 0; }
.slider-btn.next  { right: 0; border-radius: 4px 0 0 4px; }

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

.slider-dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .65);
    cursor: pointer;
}

.slider-dots i.on { background: var(--blue); width: 18px; border-radius: 4px; }

/* --- product row section --- */
.section {
    background: #fff;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 10px;
    border-bottom: 1px solid var(--border);
}

.section-head h2 {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -.2px;
}

.section-head .sub {
    font-size: 12px;
    color: var(--text-soft);
    margin-top: 2px;
}

.btn-viewall {
    background: var(--blue);
    color: #fff;
    padding: 9px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.btn-viewall:hover { background: var(--blue-dark); }

/* horizontally scrolling deal row */
.deal-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(200px, 1fr);
    overflow-x: auto;
    scrollbar-width: thin;
    padding: 8px 0 16px;
}

.deal-card {
    padding: 16px 12px;
    text-align: center;
    border-right: 1px solid var(--border);
}

.deal-card:last-child { border-right: 0; }

.deal-card .thumb {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.deal-card .thumb img {
    max-height: 150px;
    width: auto;
    object-fit: contain;
    transition: transform .25s;
}

.deal-card:hover .thumb img { transform: scale(1.05); }
.deal-card .name  { font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.deal-card .price { font-size: 14px; color: var(--green); font-weight: 500; }
.deal-card .brand { font-size: 12px; color: var(--text-soft); }

/* --- offer strips --- */
.strip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.strip-grid img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    box-shadow: var(--shadow);
}

/* ==========================================================================
   Product cards (grid listing)
   ========================================================================== */

.product-grid {
    display: grid;
    /* minmax(0,1fr) rather than 1fr: 1fr tracks refuse to shrink below the
       card's min-content width, which pushes the whole page wider */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: #fff;
}

.product-grid > * { min-width: 0; }

.product-card {
    padding: 16px 12px 20px;
    position: relative;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transition: box-shadow .2s;
}

.product-card:hover { box-shadow: var(--shadow-lg); z-index: 2; }

.product-card .thumb {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    position: relative;
}

.product-card .thumb img {
    max-height: 200px;
    width: auto;
    object-fit: contain;
}

.product-card .name {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
}

.product-card:hover .name { color: var(--blue); }
.product-card .rating-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

.product-card .price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 16px;
    font-weight: 500;
}

.product-card .price-row .off { color: var(--green); font-size: 13px; font-weight: 500; }
.product-card .assured { margin-top: 6px; }

/* wishlist heart on the card */
.wish-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow);
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c2c2c2;
    transition: .15s;
}

.wish-btn:hover      { color: var(--red); }
.wish-btn.on         { color: var(--red); }
.wish-btn.on svg     { fill: var(--red); }

/* rating chip */
.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--green);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    line-height: 1.3;
}

.rating-count { font-size: 12px; color: var(--text-soft); font-weight: 600; }

.assured-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--blue);
    font-weight: 600;
}

.stars .star.on  { color: #ffc107; }
.stars .star.off { color: #d9d9d9; }

/* ==========================================================================
   Listing page (filters + results)
   ========================================================================== */

.listing {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0 30px;
    align-items: start;
}

.filters {
    background: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 128px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.filters h3 {
    font-size: 18px;
    font-weight: 500;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filters h3 a { font-size: 12px; color: var(--blue); font-weight: 600; }

.filter-group { padding: 14px 16px; border-bottom: 1px solid var(--border); }

.filter-group h4 {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 12px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    padding: 5px 0;
    cursor: pointer;
}

.filter-group label:hover { color: var(--blue); }
.filter-group input[type=checkbox],
.filter-group input[type=radio] { accent-color: var(--blue); width: 15px; height: 15px; cursor: pointer; }

.price-inputs { display: flex; align-items: center; gap: 8px; }

.price-inputs select,
.price-inputs input {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    outline: 0;
}

.results-head {
    background: #fff;
    box-shadow: var(--shadow);
    padding: 12px 16px;
    margin-bottom: 6px;
}

.results-head h1 { font-size: 18px; font-weight: 500; }
.results-head .count { font-size: 12px; color: var(--text-soft); font-weight: 400; margin-left: 6px; }

.sort-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    overflow-x: auto;
}

.sort-bar b { font-size: 14px; font-weight: 500; flex-shrink: 0; }

.sort-bar a {
    font-size: 14px;
    padding: 4px 0;
    color: var(--text-mid);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.sort-bar a.on { color: var(--blue); font-weight: 500; border-color: var(--blue); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f5ff;
    border: 1px solid #d6e4ff;
    color: var(--blue);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 14px;
}

.chip span { cursor: pointer; font-weight: 700; }

.empty-state {
    background: #fff;
    padding: 60px 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.empty-state img  { width: 180px; margin: 0 auto 20px; }
.empty-state h3   { font-size: 18px; font-weight: 500; margin-bottom: 8px; }
.empty-state p    { color: var(--text-soft); margin-bottom: 18px; }

/* pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fff;
    padding: 16px;
    box-shadow: var(--shadow);
}

.pagination a, .pagination span {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-mid);
}

.pagination a:hover { background: #f0f5ff; color: var(--blue); }
.pagination .on     { background: var(--blue); color: #fff; font-weight: 500; }
.pagination .off    { color: #c2c2c2; }

/* ==========================================================================
   Product detail page
   ========================================================================== */

.detail {
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: 0;
    background: #fff;
    box-shadow: var(--shadow);
    margin: 10px 0 24px;
    align-items: start;
}

.gallery {
    position: sticky;
    top: 128px;
    padding: 16px;
    display: flex;
    gap: 14px;
}

.thumb-strip { display: flex; flex-direction: column; gap: 10px; }

.thumb-strip button {
    width: 56px;
    height: 56px;
    border: 1px solid var(--border-dark);
    background: #fff;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius);
}

.thumb-strip button.on { border-color: var(--blue); border-width: 2px; }
.thumb-strip img { width: 100%; height: 100%; object-fit: contain; }

.main-image {
    flex: 1;
    border: 1px solid var(--border);
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.main-image img { max-height: 100%; width: auto; object-fit: contain; }

.gallery-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.btn-cart, .btn-buy {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 54px;
    border: 0;
    cursor: pointer;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: .3px;
    text-transform: uppercase;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.btn-cart { background: var(--yellow); }
.btn-buy  { background: var(--orange); }
.btn-cart:hover { background: #f39200; }
.btn-buy:hover  { background: #ef5a0d; }
.btn-cart:disabled, .btn-buy:disabled { background: #c2c2c2; cursor: not-allowed; }

.detail-body { padding: 20px 24px 40px; border-left: 1px solid var(--border); }

.breadcrumb {
    font-size: 12px;
    color: var(--text-soft);
    padding: 12px 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.breadcrumb a:hover { color: var(--blue); }

.detail-body h1 {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 8px;
}

.detail-rating { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.special-price {
    color: var(--green);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

.price-block { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.price-block .now { font-size: 28px; font-weight: 500; }
.price-block .mrp { font-size: 16px; }
.price-block .off { font-size: 16px; color: var(--green); font-weight: 500; }

.detail-table { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 14px 8px; margin-top: 22px; }
.detail-table > * { min-width: 0; }
.detail-table > .lbl { font-size: 14px; color: var(--text-soft); font-weight: 500; }

.offer-list li {
    display: flex;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 8px;
    align-items: flex-start;
}

.offer-list li svg { flex-shrink: 0; margin-top: 2px; color: var(--green); }
.offer-list b { font-weight: 500; }

.highlight-list li {
    position: relative;
    padding-left: 16px;
    font-size: 14px;
    margin-bottom: 8px;
}

.highlight-list li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 8px;
    width: 5px;
    height: 5px;
    background: #878787;
    border-radius: 50%;
}

.seller-name { color: var(--blue); font-weight: 500; }

.stock-out { color: var(--red); font-weight: 500; font-size: 15px; }

.delivery-input {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--blue);
    max-width: 220px;
    padding-bottom: 4px;
}

.delivery-input input { border: 0; outline: 0; flex: 1; font-size: 14px; }
.delivery-input button { border: 0; background: none; color: var(--blue); font-weight: 500; cursor: pointer; }

/* specification table */
.specs { margin-top: 34px; }
.specs h2 { font-size: 24px; font-weight: 500; margin-bottom: 16px; }
.spec-group { margin-bottom: 24px; }
.spec-group h3 { font-size: 18px; font-weight: 500; margin-bottom: 12px; }
.spec-group table { width: 100%; border-collapse: collapse; }

.spec-group td {
    padding: 10px 12px;
    font-size: 14px;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.spec-group td:first-child { color: var(--text-soft); width: 240px; }

/* reviews */
.reviews { margin-top: 34px; }
.reviews h2 { font-size: 20px; font-weight: 500; margin-bottom: 16px; }

.review-summary {
    display: flex;
    align-items: center;
    gap: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.review-score { text-align: center; }
.review-score .num { font-size: 42px; font-weight: 500; }
.review-score .num small { font-size: 20px; }
.review-score .cnt { font-size: 13px; color: var(--text-soft); }

.review-bars { flex: 1; min-width: 240px; }
.review-bars .bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.review-bars .track { flex: 1; height: 5px; background: #e0e0e0; border-radius: 3px; overflow: hidden; }
.review-bars .fill  { height: 100%; background: var(--green); }

.review-item { padding: 18px 0; border-bottom: 1px solid var(--border); }
.review-item .top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.review-item .rt  { font-weight: 500; font-size: 14px; }
.review-item p    { font-size: 14px; color: var(--text-mid); margin-bottom: 8px; }
.review-item .by  { font-size: 13px; color: var(--text-soft); }

.review-form { margin-top: 20px; background: #fafafa; padding: 18px; border-radius: var(--radius); }
.review-form h3 { font-size: 16px; font-weight: 500; margin-bottom: 14px; }

.star-picker { display: flex; gap: 4px; font-size: 26px; cursor: pointer; margin-bottom: 12px; }
.star-picker span { color: #d9d9d9; }
.star-picker span.on { color: #ffc107; }

/* ==========================================================================
   Forms & buttons
   ========================================================================== */

.field { margin-bottom: 18px; position: relative; }

.field label {
    display: block;
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    outline: 0;
    background: #fff;
    color: var(--text);
}

.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--blue); }

.field textarea { resize: vertical; min-height: 90px; }
.field .err { color: var(--red); font-size: 12px; margin-top: 5px; display: block; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: 0;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    background: var(--blue);
    color: #fff;
    box-shadow: var(--shadow);
}

.btn:hover        { background: var(--blue-dark); }
.btn-orange       { background: var(--orange); text-transform: uppercase; }
.btn-orange:hover { background: #ef5a0d; }
.btn-yellow       { background: var(--yellow); text-transform: uppercase; }
.btn-yellow:hover { background: #f39200; }
.btn-block        { width: 100%; }
.btn-sm           { padding: 7px 14px; font-size: 13px; }

.btn-outline {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border-dark);
    box-shadow: none;
}

.btn-outline:hover { background: #f7f7f7; color: var(--text); }

/* ==========================================================================
   Auth pages (login / register)
   ========================================================================== */

.auth-wrap {
    display: flex;
    justify-content: center;
    padding: 40px 12px 60px;
}

.auth-card {
    display: grid;
    grid-template-columns: 40% 60%;
    width: 100%;
    max-width: 750px;
    min-height: 528px;
    background: #fff;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-side {
    background: var(--blue);
    color: #fff;
    padding: 40px 33px;
}

.auth-side h2 { font-size: 28px; font-weight: 600; line-height: 1.3; margin-bottom: 16px; }
.auth-side p  { font-size: 18px; color: #dbdbdb; line-height: 1.5; }
.auth-side img { width: 220px; margin-top: 40px; }

.auth-form { padding: 40px 35px 24px; display: flex; flex-direction: column; }
.auth-form .note { font-size: 12px; color: var(--text-soft); margin: 18px 0; line-height: 1.6; }
.auth-form .note a { color: var(--blue); }
.auth-form .swap { text-align: center; color: var(--blue); font-weight: 600; font-size: 14px; margin-top: auto; padding-top: 20px; }

/* ==========================================================================
   Cart page
   ========================================================================== */

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 366px;
    gap: 10px;
    padding: 12px 0 40px;
    align-items: start;
}

.cart-panel { background: #fff; box-shadow: var(--shadow); }
.cart-item > *, .order-row > * { min-width: 0; }

.cart-panel > h2 {
    font-size: 18px;
    font-weight: 500;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.cart-item {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 20px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.cart-item .ci-thumb img { width: 112px; height: 112px; object-fit: contain; }
.cart-item .ci-name { font-size: 16px; margin-bottom: 4px; }
.cart-item .ci-name:hover { color: var(--blue); }
.cart-item .ci-seller { font-size: 12px; color: var(--text-soft); margin-bottom: 10px; }
.cart-item .ci-price { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 500; }

.qty-box { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }

.qty-control { display: flex; align-items: center; gap: 10px; }

.qty-control button {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border-dark);
    background: #fff;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-mid);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-control button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.qty-control button:disabled { color: #d9d9d9; cursor: not-allowed; }

.qty-control .val {
    width: 44px;
    height: 26px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    text-align: center;
    font-weight: 500;
}

.link-action {
    background: none;
    border: 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text);
    cursor: pointer;
    padding: 4px 8px;
}

.link-action:hover { color: var(--blue); }

.cart-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .1);
}

.cart-footer .btn-orange { min-width: 250px; height: 51px; font-size: 16px; }

/* price details sidebar */
.price-panel { background: #fff; box-shadow: var(--shadow); position: sticky; top: 128px; }

.price-panel h3 {
    font-size: 16px;
    color: var(--text-soft);
    font-weight: 500;
    text-transform: uppercase;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.price-rows { padding: 16px; }

.price-rows .row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 8px 0;
}

.price-rows .row.total {
    border-top: 1px dashed var(--border-dark);
    margin-top: 10px;
    padding-top: 16px;
    font-size: 18px;
    font-weight: 600;
}

.price-rows .saving {
    border-top: 1px dashed var(--border-dark);
    padding-top: 14px;
    margin-top: 4px;
    color: var(--green);
    font-size: 15px;
    font-weight: 500;
}

.secure-note {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-top: 12px solid #f5f5f5;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 500;
}

.coupon-box { padding: 14px 16px; border-top: 1px solid var(--border); }
.coupon-box form { display: flex; gap: 8px; }
.coupon-box input { flex: 1; padding: 9px 10px; border: 1px solid var(--border-dark); border-radius: var(--radius); outline: 0; text-transform: uppercase; }
.coupon-applied { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--green); font-weight: 500; }

/* ==========================================================================
   Checkout
   ========================================================================== */

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 366px;
    gap: 10px;
    padding: 12px 0 40px;
    align-items: start;
}

.step { background: #fff; box-shadow: var(--shadow); margin-bottom: 10px; }

.step-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
}

.step-head .num {
    width: 24px;
    height: 24px;
    border-radius: var(--radius);
    background: #f0f0f0;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.step-head .ttl { font-size: 14px; color: var(--text-soft); font-weight: 500; text-transform: uppercase; letter-spacing: .3px; }
.step-head .val { font-size: 14px; margin-top: 3px; }
.step-head .tick { color: var(--blue); margin-left: 4px; }

.step.on .step-head { background: var(--blue); color: #fff; }
.step.on .step-head .num { background: #fff; color: var(--blue); }
.step.on .step-head .ttl { color: #fff; }

.step-body { padding: 0 20px 20px 60px; }

.addr-option {
    display: flex;
    gap: 14px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.addr-option:hover { background: #fafafa; }
.addr-option.sel   { background: #f5faff; }
.addr-option input { accent-color: var(--blue); margin-top: 4px; }
.addr-option .tag  { background: #f0f0f0; color: var(--text-soft); font-size: 11px; padding: 2px 7px; border-radius: 2px; text-transform: uppercase; font-weight: 600; }
.addr-option .nm   { font-weight: 500; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.addr-option .ad   { font-size: 14px; color: var(--text-mid); line-height: 1.6; max-width: 640px; }

.addr-form { padding: 20px; background: #f5faff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; max-width: 640px; }
.form-grid .full { grid-column: 1 / -1; }

/* payment options */
.pay-option {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.pay-option:hover { background: #fafafa; }
.pay-option.sel   { background: #f5faff; }
.pay-option input { accent-color: var(--blue); margin-top: 3px; }
.pay-option .pm-name { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.pay-option .pm-desc { font-size: 12px; color: var(--text-soft); margin-top: 4px; }

.pay-fields {
    padding: 16px 0 4px;
    max-width: 460px;
    border-top: 1px dashed var(--border-dark);
    margin-top: 14px;
}

.sandbox-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #fff8e1;
    border: 1px solid #ffe082;
    color: #7a5900;
    font-size: 13px;
    padding: 12px 14px;
    border-radius: var(--radius);
    margin: 14px 0;
    line-height: 1.6;
}

/* payment processing screen */
.processing { max-width: 480px; margin: 60px auto; text-align: center; background: #fff; padding: 44px 30px; box-shadow: var(--shadow); }
.processing h2 { font-size: 20px; font-weight: 500; margin: 22px 0 8px; }
.processing p  { color: var(--text-soft); }

.spinner {
    width: 54px;
    height: 54px;
    border: 4px solid #e3e3e3;
    border-top-color: var(--blue);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin .9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Order confirmation / my orders / tracking
   ========================================================================== */

.confirm-card { background: #fff; box-shadow: var(--shadow); padding: 40px; text-align: center; margin: 20px 0; }
.confirm-card .tick-circle { width: 74px; height: 74px; border-radius: 50%; background: var(--green); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.confirm-card h1 { font-size: 24px; font-weight: 500; margin-bottom: 8px; }
.confirm-card p  { color: var(--text-soft); margin-bottom: 6px; }
.confirm-card .ordno { font-weight: 600; color: var(--text); }
.confirm-actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

.order-card { background: #fff; box-shadow: var(--shadow); margin-bottom: 12px; }

.order-card .oc-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
    flex-wrap: wrap;
    gap: 10px;
}

.order-card .oc-head .no { font-weight: 500; }
.order-card .oc-head .dt { font-size: 13px; color: var(--text-soft); }

.order-row {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) 160px 200px;
    gap: 16px;
    padding: 18px 20px;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.order-row img { width: 72px; height: 72px; object-fit: contain; }
.order-row .nm { font-size: 14px; margin-bottom: 4px; }
.order-row .qt { font-size: 13px; color: var(--text-soft); }
.order-row .pr { font-weight: 500; }

.status-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.status-pill::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.status-pill.active::before    { background: var(--green); }
.status-pill.delivered::before { background: var(--green); }
.status-pill.cancelled::before { background: var(--red); }
.status-pill .sub { display: block; font-size: 12px; color: var(--text-soft); font-weight: 400; margin-top: 3px; }

/* tracking timeline */
.track { display: flex; align-items: flex-start; padding: 30px 20px 10px; overflow-x: auto; }

.track-step { flex: 1; min-width: 120px; text-align: center; position: relative; }

.track-step::before {
    content: '';
    position: absolute;
    top: 11px;
    left: -50%;
    width: 100%;
    height: 3px;
    background: #e0e0e0;
}

.track-step:first-child::before { display: none; }
.track-step.done::before { background: var(--green); }

.track-step i {
    position: relative;
    z-index: 2;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #e0e0e0;
    display: block;
    margin: 0 auto 10px;
}

.track-step.done i { border-color: var(--green); background: var(--green); }
.track-step .lb { font-size: 13px; font-weight: 500; }
.track-step .dt { font-size: 11px; color: var(--text-soft); margin-top: 3px; }

/* ==========================================================================
   Account pages (sidebar layout)
   ========================================================================== */

.account-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
    padding: 16px 0 40px;
    align-items: start;
}

.account-side { background: #fff; box-shadow: var(--shadow); }

.acct-user {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-bottom: 8px solid #f1f3f6;
}

.acct-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f0f5ff;
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
}

.acct-user .hi { font-size: 12px; color: var(--text-soft); }
.acct-user .nm { font-weight: 500; }

.acct-menu a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-mid);
}

.acct-menu a svg  { color: var(--blue); flex-shrink: 0; }
.acct-menu a:hover { background: #f5faff; color: var(--blue); }
.acct-menu a.active { color: var(--blue); font-weight: 600; background: #f5faff; }

/* grid children must be allowed to shrink, or wide content widens the page */
.listing > *,
.cart-layout > *,
.checkout-layout > *,
.account-layout > *,
.detail > * { min-width: 0; }

/* account page column splits */
.stat-cols   { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.detail-cols { display: grid; grid-template-columns: 1fr 1fr;        gap: 12px; margin-bottom: 40px; }

.panel { background: #fff; box-shadow: var(--shadow); padding: 24px; }
.panel h2 { font-size: 18px; font-weight: 500; margin-bottom: 20px; }
.panel h2 .edit { font-size: 13px; color: var(--blue); font-weight: 600; margin-left: 16px; cursor: pointer; }

.addr-card { border: 1px solid var(--border-dark); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; position: relative; }
.addr-card .acts { position: absolute; top: 14px; right: 14px; display: flex; gap: 14px; }
.addr-card .acts a { font-size: 13px; color: var(--blue); font-weight: 500; }
.addr-card .acts a.del { color: var(--red); }

/* ==========================================================================
   Footer
   ========================================================================== */

.footer { background: var(--footer-bg); color: #fff; margin-top: auto; }

.footer-top {
    max-width: 1248px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr) 1.4fr 1.2fr;
    gap: 20px;
    padding: 40px 12px;
    border-bottom: 1px solid #454d5e;
}

.footer h4 {
    font-size: 12px;
    color: var(--text-soft);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 14px;
}

.footer li { margin-bottom: 9px; }
.footer li a { font-size: 12px; color: #fff; }
.footer li a:hover { text-decoration: underline; }

.footer-col.bordered { border-left: 1px solid #454d5e; padding-left: 20px; }
.footer address { font-style: normal; font-size: 12px; line-height: 1.9; }

.footer-bottom {
    max-width: 1248px;
    margin: 0 auto;
    padding: 20px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
}

.footer-bottom .links { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-bottom .links a { display: flex; align-items: center; gap: 7px; }
.footer-bottom .links svg { color: var(--yellow); }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast-host {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.toast {
    background: #212121;
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: toast-in .25s ease;
}

.toast.ok  { background: #1b5e20; }
.toast.err { background: #b71c1c; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Layout scaffolding
   ========================================================================== */

.page { min-height: calc(100vh - 56px); display: flex; flex-direction: column; }
.page-body { flex: 1; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
    .detail        { grid-template-columns: 380px 1fr; }
    .product-grid  { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .footer-top    { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .listing,
    .cart-layout,
    .checkout-layout,
    .account-layout { grid-template-columns: 1fr; }

    .filters, .price-panel, .gallery { position: static; max-height: none; }
    .detail { grid-template-columns: 1fr; }
    .stat-cols, .detail-cols { grid-template-columns: 1fr; }
    .detail-body { border-left: 0; }
    .order-row { grid-template-columns: 64px 1fr; }
    .order-row .pr, .order-row .st { grid-column: 2; }
}

@media (max-width: 768px) {
    .header-inner   { gap: 8px; padding: 0 10px; }
    .header-actions { gap: 14px; }
    .header-actions .hide-sm { display: none; }
    .btn-login      { padding: 5px 18px; }
    .search-form    { max-width: none; }
    .product-grid   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-card      { grid-template-columns: 1fr; min-height: 0; }
    .auth-side      { padding: 26px; }
    .auth-side img  { display: none; }
    .form-grid      { grid-template-columns: 1fr; }
    .strip-grid     { grid-template-columns: 1fr; }
    .step-body      { padding: 0 16px 16px; }
    .footer-top     { grid-template-columns: repeat(2, 1fr); }
    .footer-col.bordered { border-left: 0; padding-left: 0; }
    .slides img     { height: 160px; }
    .cart-item      { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; padding: 16px; }
    .cart-item .ci-thumb img { width: 84px; height: 84px; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-table { grid-template-columns: 1fr; gap: 6px 0; }
    .detail-table > .lbl { margin-top: 12px; }
    .deal-row     { grid-auto-columns: minmax(150px, 1fr); }
    .price-block .now { font-size: 22px; }
    .footer-top   { grid-template-columns: 1fr; }
}
