/* GoCart: phone-friendly layout + styles for new features. Loaded after site.css and gocart-theme.css. */

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

img, video {
    max-width: 100%;
    height: auto;
}

/* ---------- new feature styles (all screen sizes) ---------- */
.order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

    .order-actions .track-btn {
        width: auto;
        margin-top: 0;
    }

.btn-outline-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid #dc3545;
    color: #dc3545;
    background: #fff;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

    .btn-outline-danger:hover {
        background: #dc3545;
        color: #fff;
    }

.return-btn {
    padding: 6px 12px;
    font-size: .85rem;
    margin-top: 6px;
}

.color-picker {
    margin-bottom: 14px;
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.color-chip {
    position: relative;
    cursor: pointer;
}

    .color-chip input {
        position: absolute;
        opacity: 0;
        inset: 0;
    }

    .color-chip span {
        display: inline-block;
        padding: 8px 16px;
        border: 2px solid #d1d5db;
        border-radius: 999px;
        background: #fff;
        font-weight: 600;
    }

    .color-chip input:checked + span {
        border-color: #16a34a;
        background: #f0fdf4;
        color: #166534;
    }

    .color-chip input:focus-visible + span {
        outline: 3px solid #86efac;
    }

.desc-toggle summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .desc-toggle summary::-webkit-details-marker {
        display: none;
    }

    .desc-toggle summary h4 {
        margin: 0;
    }

    .desc-toggle summary::after {
        content: "\25BE";
        font-size: 1.2rem;
        transition: transform .2s;
    }

.desc-toggle:not([open]) summary::after {
    transform: rotate(-90deg);
}

.desc-toggle p {
    margin-top: 12px;
}

.admin-tabs-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.admin-tabs {
    flex-wrap: nowrap !important;
    white-space: nowrap;
    margin-bottom: 0 !important;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

    .filter-pills .pill {
        padding: 6px 14px;
        border-radius: 999px;
        border: 1px solid #d1d5db;
        text-decoration: none;
        color: inherit;
    }

        .filter-pills .pill.active {
            background: #16a34a;
            border-color: #16a34a;
            color: #fff;
        }

.search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

    .search-row .save-btn {
        width: auto;
    }

.admin-desc summary {
    cursor: pointer;
    font-size: .85rem;
    color: #16a34a;
}

/* ---------- phones and small tablets ---------- */
@media (max-width: 768px) {
    main {
        padding-left: 12px;
        padding-right: 12px;
    }

    .container, .account-content, .admin-content, .track-page {
        padding-left: 12px;
        padding-right: 12px;
        max-width: 100%;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .account-card, .seller-card, .product-description-card {
        padding: 14px;
    }

    .product-grid, .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
    }

    .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cart-page, .product-details-page, .reviews-layout, .track-layout {
        grid-template-columns: 1fr !important;
    }

    .order-card-head, .track-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .order-line {
        flex-wrap: wrap;
    }

    .order-line-main {
        min-width: 0;
        flex: 1 1 140px;
    }

    .order-actions > * {
        flex: 1 1 140px;
        justify-content: center;
        text-align: center;
    }

    .admin-layout {
        grid-template-columns: 1fr;
        display: block;
    }

    .admin-sidebar {
        width: 100%;
    }

    table.table {
        font-size: .85rem;
    }

    .table th, .table td {
        padding: 6px 8px;
    }

    .product-actions {
        flex-direction: column;
    }

        .product-actions form, .product-actions .save-btn, .product-actions .wishlist-btn {
            width: 100%;
        }

    .form-control, select, textarea, input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"] {
        font-size: 16px; /* stops iPhones zooming in on focus */
    }

    .save-btn, .cancel-btn, .btn {
        min-height: 44px;
    }

    .search-row {
        flex-direction: column;
    }

        .search-row .save-btn {
            width: 100%;
        }
}

@media (max-width: 480px) {
    .product-grid, .category-grid {
        gap: 8px;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .account-cards {
        grid-template-columns: 1fr !important;
    }

    .summary-row {
        font-size: .95rem;
    }

    .location-content {
        width: 94vw;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ---------- add-to-cart button on product cards ---------- */
.card-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 8px;
    padding: 8px 10px;
    background: #16a34a;
    color: #fff !important;
    border: 0;
    border-radius: 10px;
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    cursor: pointer;
}

    .card-cart-btn:hover {
        background: #15803d;
    }

    .card-cart-btn i {
        font-size: 1.15rem;
    }

.home-product-info form {
    margin: 0;
}

@media (max-width: 480px) {
    .card-cart-btn span {
        font-size: .8rem;
    }
}

/* install page */
.install-page {
    max-width: 640px;
    margin: 24px auto;
    padding: 0 16px;
    text-align: center;
}

    .install-page img.app-icon {
        width: 110px;
        border-radius: 24px;
        box-shadow: 0 6px 20px rgba(0,0,0,.15);
    }

    .install-page ol {
        text-align: left;
    }

/* unpaid order banner */
.pay-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 18px;
}

    .pay-banner p {
        margin: 4px 0 0;
        color: #78350f;
    }

    .pay-banner .track-btn {
        background: #16a34a;
    }

/* colour pickers */
.color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.swatch-pick {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 8px;
    border: 2px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    font-size: .9rem;
}

    .swatch-pick input {
        position: absolute;
        opacity: 0;
        inset: 0;
        cursor: pointer;
    }

    .swatch-pick:has(input:checked) {
        border-color: #16a34a;
        background: #f0fdf4;
        font-weight: 600;
    }

.swatch-dot {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.25);
    vertical-align: -3px;
}

.color-chip .swatch-dot {
    margin-right: 4px;
}

.colors-details {
    margin-top: 6px;
}

    .colors-details summary {
        cursor: pointer;
        color: #16a34a;
        font-size: .85rem;
    }

    .colors-details form {
        margin-top: 8px;
        min-width: 260px;
    }

/* photo per colour */
.color-photo-box {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.cp-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    background: #fafafa;
}

    .cp-row label {
        font-size: .85rem;
        font-weight: 600;
        margin: 0;
    }

.color-photo-current {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0;
}

    .color-photo-current figure {
        margin: 0;
        text-align: center;
        font-size: .75rem;
    }

    .color-photo-current img {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 8px;
        border: 1px solid #e5e7eb;
    }

.color-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    font-size: .85rem;
}

/* colour picker under the product photos */
.gallery-colors {
    margin-top: 16px;
    padding: 14px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
}

.color-photo-current figure select {
    margin-top: 4px;
    min-width: 100px;
}

.color-photo-current img {
    width: 70px;
    height: 70px;
}

/* background choice */
.bg-choice {
    display: grid;
    gap: 10px;
}

.bg-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
}

    .bg-option:has(input:checked) {
        border-color: #16a34a;
        background: #f0fdf4;
    }

    .bg-option input {
        margin-top: 4px;
    }

/* ---------- variants and specs ---------- */
.variant-picker .variant-group {
    margin-bottom: 10px;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}

    .spec-table th {
        width: 38%;
        text-align: left;
        color: #555;
        font-weight: 600;
        padding: 6px 8px;
        border-bottom: 1px solid #eee;
        vertical-align: top;
    }

    .spec-table td {
        padding: 6px 8px;
        border-bottom: 1px solid #eee;
        word-break: break-word;
    }

.spec-details {
    margin-top: 4px;
    font-size: .82rem;
}

    .spec-details ul {
        margin: 4px 0 0;
        padding-left: 18px;
    }

.options-editor textarea {
    font-family: inherit;
    width: 100%;
}

/* =====================================================================
   PHONE-FRIENDLY EVERYTHING
   Fixes fixed widths, wide tables, forms, modals and small tap targets
   on every page. Loaded last, so it wins over site.css / gocart-theme.css.
   ===================================================================== */

/* never let anything push the page sideways */
*, *::before, *::after {
    box-sizing: border-box;
}

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

p, h1, h2, h3, h4, li, td, th, .alert {
    overflow-wrap: break-word;
}

iframe, canvas, svg {
    max-width: 100%;
}

pre, code {
    white-space: pre-wrap;
    word-break: break-word;
}

/* thumb-friendly everywhere on touch screens */
@media (hover: none) and (pointer: coarse) {
    a, button, .btn, .save-btn, .cancel-btn, summary, select, label.color-chip span, .swatch-pick {
        touch-action: manipulation;
    }

    button, .btn, .save-btn, .cancel-btn, .btn-outline-danger {
        min-height: 44px;
    }

    .color-chip span {
        padding: 10px 16px;
    }
}

/* ---------- tablets and phones (up to 900px) ---------- */
@media (max-width: 900px) {
    /* tables scroll sideways inside their own box instead of breaking the page */
    .admin-content table,
    .account-content table,
    .seller-card table,
    main table.table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

        .admin-content table td, .account-content table td, .seller-card table td {
            white-space: normal;
            min-width: 90px;
        }

    /* two-column product page and checkout stack */
    .product-details-page {
        padding: 12px !important;
        gap: 14px !important;
    }

    .product-main-image, .product-image-placeholder {
        height: auto !important;
        max-height: 420px;
        aspect-ratio: 1 / 1;
        object-fit: contain;
    }

    .product-image-placeholder {
        display: flex;
    }

    .product-title {
        font-size: 24px !important;
        line-height: 1.25;
    }

    .product-price {
        font-size: 28px !important;
        margin: 8px 0 !important;
    }

    .thumb-row {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }

    .thumb {
        flex: 0 0 64px;
    }

        .thumb img {
            width: 64px;
            height: 64px;
            object-fit: cover;
        }

    .gallery-colors {
        margin-top: 12px;
        padding: 12px;
    }

    .product-actions {
        gap: 10px;
    }

    /* admin: whole layout becomes one column, nav tabs scroll */
    .admin-layout {
        display: block !important;
    }

    .admin-sidebar {
        width: 100% !important;
        min-height: 0 !important;
    }

    .admin-content {
        padding: 12px !important;
    }

    .stat-card {
        padding: 14px;
    }

    /* account area */
    .account-container {
        padding: 10px !important;
    }

    .account-sidebar {
        width: 100% !important;
    }

    .account-content {
        padding: 14px !important;
    }

    .address-card, .notif-row, .order-row {
        flex-wrap: wrap;
    }

    /* dropdown menus never run off the screen */
    .profile-menu {
        width: min(260px, 92vw);
        right: 0;
    }
}

/* ---------- phones (up to 640px) ---------- */
@media (max-width: 640px) {
    /* top strip: wrap and stay tidy */
    .top-bar {
        flex-wrap: wrap;
        gap: 4px 12px !important;
        justify-content: space-between;
    }

    .top-links {
        flex-wrap: wrap;
        gap: 4px 10px !important;
        justify-content: flex-end;
        font-size: 12px;
    }

    .location-bar {
        max-width: 100%;
    }

    .deliver-text {
        display: inline-block;
        max-width: 70vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: bottom;
    }

    /* header: logo + icons on one line, search under it */
    .main-header {
        padding: 10px 12px !important;
    }

    .logo {
        font-size: 24px !important;
    }

    .search-box {
        min-width: 0;
        font-size: 16px;
    }

    /* sign in / register / forgot password / verify pages */
    .register-page {
        align-items: flex-start;
        padding: 12px 0;
    }

    .register-wrapper, .register-container {
        padding: 0 12px;
    }

    .register-card {
        width: 100% !important;
        max-width: 100%;
        padding: 22px 18px !important;
        border-radius: 16px;
    }

        .register-card .form-control {
            height: 48px;
        }

    /* pop-up boxes use the full width */
    .custom-modal-content, .location-content {
        width: 94vw !important;
        max-width: 94vw;
        padding: 18px !important;
        max-height: 88vh;
        overflow-y: auto;
    }

    .addr-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

        .addr-actions .cancel-btn {
            flex: 1 1 100%;
        }

    /* forms: one column, full-width fields and buttons */
    .form-row, .form-grid, .two-col {
        margin-left: 0;
        margin-right: 0;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-control, .form-select, select, textarea, input {
        max-width: 100%;
    }

    .account-card, .seller-card, .security-card, .review-form-card {
        padding: 14px !important;
        border-radius: 14px;
    }

    .section-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .seller-stats, .admin-stats, .search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
    }

    .search-grid {
        gap: 10px;
    }

    /* cart rows */
    .cart-card {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px;
    }

        .cart-card .qty-btn {
            width: 36px;
            height: 36px;
        }

    .summary-row {
        gap: 10px;
    }

    /* orders */
    .order-card-head {
        gap: 4px;
    }

    .order-thumb, .order-thumb-empty {
        width: 56px;
        height: 56px;
        flex: none;
    }

    .order-row-main {
        min-width: 0;
        flex: 1 1 60%;
    }

    .order-track {
        display: none;
    }

    .pay-banner {
        padding: 12px;
    }

        .pay-banner .order-actions {
            width: 100%;
        }

    .order-actions > * {
        flex: 1 1 100%;
    }

    .order-actions form {
        display: block;
        width: 100%;
    }

        .order-actions form button, .order-actions .btn-outline-danger {
            width: 100%;
            justify-content: center;
        }

    .return-btn {
        width: 100%;
        text-align: center;
    }

    /* reviews */
    .reviews-layout {
        gap: 14px;
    }

    .review-card {
        padding: 12px;
    }

    .bar-row {
        grid-template-columns: 32px 1fr 26px;
    }

    .review-pager {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    /* seller product table: show each product as a card */
    .seller-card table.responsive-cards,
    .table-scroll table {
        font-size: .8rem;
    }

    .colors-details form {
        min-width: 0;
        width: 100%;
    }

    .color-photo-current figure {
        width: calc(33.33% - 8px);
    }

    .color-photo-current img {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .color-presets {
        gap: 6px;
    }

    .swatch-pick {
        padding: 5px 10px 5px 6px;
        font-size: .85rem;
    }

    .bg-option {
        padding: 10px;
    }

    /* hero and landing */
    .app-hero {
        margin: 10px 12px 4px;
        padding: 20px 16px;
    }

        .app-hero h1 {
            font-size: 23px;
        }

    .hero-cta {
        flex-wrap: wrap;
        gap: 8px;
    }

        .hero-cta a {
            flex: 1 1 140px;
            text-align: center;
        }

    .welcome-banner {
        padding: 16px;
    }

    .sell-hero {
        padding: 22px 16px;
    }

    /* install page */
    .install-page {
        margin: 12px auto;
    }

        .install-page img.app-icon {
            width: 90px;
        }

    /* tracking steps stay readable */
    .track-page {
        padding: 12px 12px 90px;
    }

    .track-layout {
        gap: 12px;
    }

    /* leave space for the fixed bottom bar on every page */
    main {
        padding-bottom: calc(var(--gc-nav-h, 62px) + 24px);
    }
}

/* ---------- small phones (up to 400px) ---------- */
@media (max-width: 400px) {
    body {
        font-size: 14px;
    }

    .home-product-grid, .product-grid, .category-grid {
        gap: 8px !important;
    }

    .home-product-info {
        padding: 8px 10px 12px !important;
    }

    .seller-stats, .admin-stats {
        grid-template-columns: 1fr !important;
    }

    .logo {
        font-size: 22px !important;
    }

    .header-icons {
        gap: 6px !important;
    }

        .header-icons i {
            font-size: 20px;
        }

    .bottom-nav a {
        font-size: 10px;
    }

    .card-cart-btn {
        padding: 8px 6px;
    }

        .card-cart-btn span {
            font-size: .75rem;
        }

    .color-chip span {
        padding: 8px 12px;
        font-size: .85rem;
    }

    .spec-table th {
        width: 45%;
    }
}

/* ---------- phones turned sideways ---------- */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
    .main-header {
        position: static;
    }

    .bottom-nav {
        height: 48px;
    }

        .bottom-nav a span, .bottom-nav a small {
            display: none;
        }

    .custom-modal-content, .location-content {
        max-height: 94vh;
    }
}

/* ---------- notches / home bar (installed app) ---------- */
@supports (padding: env(safe-area-inset-left)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ---------- respect the phone's "reduce motion" setting ---------- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ---------- printing ---------- */
@media print {
    .top-bar, .main-header, .bottom-nav, .admin-tabs-wrap, .order-actions, .pay-banner {
        display: none !important;
    }

    body {
        overflow: visible;
    }
}

/* =====================================================================
   ROUND 2: navigation text, Home, Sell on GoCart, Wishlist, Cart
   Words must never stack letter-by-letter; menus stay on one line.
   ===================================================================== */

/* ---- navigation: single-line labels everywhere ---- */
.top-bar, .top-links, .top-links a, .top-bar a, .location-bar, .logo,
.header-icons, .bottom-nav a, .bottom-nav a span, .cat-name, .see-all,
.hero-cta, .shop-btn, .checkout-btn, .save-btn, .cancel-btn, .btn,
.deliver-change, .nav-link, .admin-tabs a {
    white-space: nowrap;
}

    .top-links a, .top-bar a {
        display: inline-block;
    }

@media (max-width: 900px) {
    /* top strip: one tidy row that scrolls instead of stacking */
    .top-bar {
        flex-wrap: nowrap !important;
        gap: 12px !important;
        overflow: hidden;
    }

    .location-bar {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-links {
        flex: 0 1 auto;
        display: flex;
        flex-wrap: nowrap !important;
        align-items: center;
        gap: 8px !important;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

        .top-links::-webkit-scrollbar {
            display: none;
        }

        .top-links span {
            opacity: .5;
        }

    /* header: logo left, icons right, search full width underneath */
    .main-header {
        flex-wrap: wrap;
        align-items: center;
    }

    .header-icons {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
    }

    .search-container {
        display: flex;
        width: 100%;
    }

    .search-box {
        flex: 1 1 auto;
        min-width: 0;
        width: 100%;
        text-overflow: ellipsis;
    }

    /* bottom bar: icon above a one-line label */
    .bottom-nav a {
        padding: 4px 2px;
        min-width: 0;
    }

        .bottom-nav a span:not(.icon-wrap):not(.icon-badge) {
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 100%;
        }

    /* category circles scroll sideways, label stays on one line */
    .cat-row {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

        .cat-row::-webkit-scrollbar {
            display: none;
        }

    .cat-item {
        text-align: center;
    }

    .cat-name {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 12px;
    }
}

@media (max-width: 640px) {
    .top-bar {
        padding: 6px 12px !important;
    }

    .top-links {
        font-size: 12px;
    }

    .deliver-text {
        max-width: 55vw;
    }
}

/* footer links: wrap as whole phrases, centred */
footer {
    overflow-wrap: normal;
}

    footer a {
        display: inline-block;
        white-space: nowrap;
        margin: 2px 2px;
    }

/* ---- HOME ---- */
@media (max-width: 640px) {
    .app-hero {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        gap: 10px;
    }

    .app-hero-text {
        width: 100%;
    }

    .app-hero h1 {
        font-size: 22px;
        line-height: 1.2;
    }

    .hero-cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        padding: 12px 16px;
    }

    .deliver-strip {
        display: flex;
        align-items: center;
        gap: 10px;
        width: calc(100% - 24px);
        margin: 10px 12px 0;
        padding: 10px 12px;
        text-align: left;
    }

    .deliver-copy {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

        .deliver-copy small {
            font-size: 11px;
        }

        .deliver-copy .deliver-text {
            display: block;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .deliver-change {
        flex: none;
        font-size: 13px;
    }

    .featured-products {
        padding: 14px 12px 4px !important;
    }

    .section-header-row {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between;
        gap: 8px;
    }

        .section-header-row > div {
            min-width: 0;
        }

    .section-header h2, .featured-products h2 {
        font-size: 18px !important;
        margin: 0;
    }

    .section-header p {
        font-size: 12px;
        margin: 2px 0 0;
    }

    .see-all {
        flex: none;
        font-size: 13px;
    }

    .home-product-card {
        min-width: 0;
    }

    .home-product-image, .home-product-image-placeholder {
        width: 100%;
        height: auto !important;
        aspect-ratio: 1 / 1;
        object-fit: contain;
    }

    .home-product-info h3 {
        font-size: 14px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin: 4px 0;
    }

    .home-product-info h4, .home-product-info .price {
        font-size: 16px;
    }

    .home-product-info p {
        font-size: 12px;
        margin: 2px 0;
    }

    .product-badge {
        font-size: 10px;
        padding: 2px 8px;
    }

    .trust-strip {
        padding: 14px 12px 24px;
        gap: 10px;
    }
}

/* ---- SELL ON GOCART ---- */
@media (max-width: 640px) {
    .sell-hero {
        padding: 22px 16px !important;
        border-radius: 14px;
        margin-bottom: 16px;
    }

        .sell-hero h1 {
            font-size: 1.6rem;
            line-height: 1.2;
        }

        .sell-hero p {
            font-size: 1rem;
            max-width: 100%;
        }

        .sell-hero .sell-cta {
            display: block;
            text-align: center;
            width: 100%;
            white-space: normal;
        }

    .sell-ads {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 18px;
    }

    .sell-ad {
        padding: 18px;
    }

        .sell-ad h3 {
            font-size: 1.1rem;
        }

    .sell-steps {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .sell-step {
        display: grid;
        grid-template-columns: 42px 1fr;
        column-gap: 12px;
        text-align: left;
        align-items: start;
    }

        .sell-step .num {
            grid-row: 1 / span 2;
            margin: 0;
        }

        .sell-step h3, .sell-step p {
            margin: 0;
            grid-column: 2;
        }

        .sell-step p {
            font-size: .9rem;
        }

    .sell-section-title {
        margin: 22px 0 10px;
        font-size: 1.2rem;
    }

    .sell-calc {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

        .sell-calc input {
            max-width: 100%;
            width: 100%;
        }

    .account-content ul {
        padding-left: 20px;
    }

    .account-cards {
        gap: 12px;
    }

    details summary {
        padding: 4px 0;
    }
}

/* ---- WISHLIST ---- */
@media (max-width: 640px) {
    .wishlist-header {
        margin-bottom: 16px;
    }

        .wishlist-header h1 {
            font-size: 24px !important;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .wishlist-header p {
            font-size: 14px !important;
            margin: 4px 0 0;
        }

    .empty-wishlist {
        padding: 36px 16px !important;
        border-radius: 16px;
    }

        .empty-wishlist i {
            font-size: 56px !important;
            margin-bottom: 10px !important;
        }

        .empty-wishlist h3 {
            font-size: 22px !important;
            margin-bottom: 8px !important;
        }

        .empty-wishlist p {
            font-size: 14px;
            margin-bottom: 16px !important;
        }

    .shop-btn {
        display: inline-block;
        padding: 12px 22px;
    }

    .wishlist-remove-btn {
        padding: 10px;
        font-size: .85rem;
        margin-top: 6px;
        border-radius: 8px;
    }

    .home-product-card form {
        padding: 0 8px 8px;
    }
}

/* ---- CART ---- */
@media (max-width: 640px) {
    .cart-page {
        padding: 10px !important;
        gap: 14px !important;
    }

    .cart-items, .cart-summary {
        padding: 14px !important;
        border-radius: 16px;
    }

    .cart-title {
        font-size: 20px !important;
        margin-bottom: 8px;
    }

    /* each item: photo + name/quantity on top, price + remove underneath */
    .cart-card {
        display: grid !important;
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 4px 12px;
        align-items: start;
        padding: 14px 0 !important;
    }

        .cart-card .cart-image {
            width: 76px !important;
            height: 76px !important;
            border-radius: 12px;
        }

            .cart-card .cart-image img {
                width: 100% !important;
                height: 100% !important;
                object-fit: contain !important;
            }

    .cart-details {
        margin-left: 0 !important;
        min-width: 0;
    }

        .cart-details h3 {
            font-size: 15px !important;
            margin: 0 0 4px !important;
            line-height: 1.3;
        }

        .cart-details p {
            font-size: 12px;
            margin: 0 0 2px;
        }

    .cart-quantity {
        margin-top: 8px !important;
        gap: 10px !important;
    }

        .cart-quantity form {
            margin: 0;
        }

        .cart-quantity .qty-btn {
            width: 38px !important;
            height: 38px !important;
        }

    .cart-price {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-top: 4px;
        padding-top: 8px;
        border-top: 1px dashed #e5e7eb;
    }

        .cart-price h4 {
            font-size: 18px !important;
            margin: 0;
        }

        .cart-price form {
            margin: 0;
        }

    .remove-btn {
        margin: 0 !important;
        padding: 8px 14px;
        border-radius: 8px;
        min-height: 38px;
    }

    .summary-row {
        font-size: .95rem;
        margin-bottom: 10px;
    }

    .summary-total {
        font-size: 18px !important;
        margin-top: 12px;
    }

    .cart-summary h2 {
        font-size: 18px;
    }

    .checkout-btn {
        padding: 14px;
        font-size: 1rem;
    }

    .empty-cart {
        padding: 28px 12px !important;
    }

    .empty-cart-icon {
        width: 110px !important;
        height: 100px !important;
    }
}

/* ---- all other pages: headings and cards ---- */
@media (max-width: 640px) {
    .account-content h1, .admin-content h1, .track-page h1, main h1 {
        font-size: 1.4rem;
        line-height: 1.25;
    }

    .account-content h2, .admin-content h2 {
        font-size: 1.15rem;
    }

    .account-card {
        padding: 14px;
    }

        .account-card h3 {
            font-size: 1.05rem;
        }

    .btn, .save-btn, .cancel-btn {
        white-space: normal;
    }
    /* long button text may wrap as whole words */
}

/* ---------- "added to cart" message ---------- */
.cart-toast {
    position: fixed;
    z-index: 2000;
    left: 50%;
    transform: translateX(-50%);
    top: 14px;
    width: min(520px, 94vw);
    display: flex;
    align-items: center;
    gap: 10px;
    background: #14532d;
    color: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    animation: cartToastIn .25s ease-out;
}

    .cart-toast i {
        color: #86efac;
        font-size: 1.2rem;
        flex: none;
    }

    .cart-toast span {
        flex: 1 1 auto;
        min-width: 0;
        font-size: .92rem;
    }

    .cart-toast strong {
        overflow-wrap: anywhere;
    }

    .cart-toast a {
        flex: none;
        color: #fff;
        font-weight: 700;
        text-decoration: underline;
        white-space: nowrap;
    }

    .cart-toast button {
        flex: none;
        background: none;
        border: 0;
        color: #fff;
        font-size: 1.4rem;
        line-height: 1;
        padding: 0 4px;
        cursor: pointer;
    }

@keyframes cartToastIn {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* =====================================================================
   APP FEEL: confirm box, short description, flat pages instead of cards
   ===================================================================== */

/* toast: error version */
.cart-toast.bad {
    background: #7f1d1d;
}

    .cart-toast.bad i {
        color: #fecaca;
    }

/* confirmation box */
.gc-confirm {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .55);
    animation: gcFade .15s ease-out;
}

.gc-confirm-box {
    width: min(380px, 100%);
    background: #fff;
    border-radius: 18px;
    padding: 22px 20px 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,.3);
}

    .gc-confirm-box p {
        margin: 0 0 18px;
        font-size: 1.05rem;
        font-weight: 600;
        color: #111827;
        line-height: 1.4;
    }

.gc-confirm-actions {
    display: flex;
    gap: 10px;
}

    .gc-confirm-actions button {
        flex: 1 1 0;
        min-height: 46px;
        border-radius: 12px;
        border: 0;
        font-weight: 700;
        font-size: .95rem;
        cursor: pointer;
    }

.gc-no {
    background: #f3f4f6;
    color: #111827;
}

.gc-yes {
    background: #16a34a;
    color: #fff;
}

    .gc-yes.danger {
        background: #dc2626;
    }

@keyframes gcFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 640px) {
    .gc-confirm {
        align-items: flex-end;
        padding: 0;
    }

    .gc-confirm-box {
        width: 100%;
        border-radius: 20px 20px 0 0;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
        animation: gcUp .2s ease-out;
    }
}

@keyframes gcUp {
    from {
        transform: translateY(40px);
    }

    to {
        transform: translateY(0);
    }
}

/* short description */
.desc-block h4 {
    margin: 0 0 8px;
}

.desc-text {
    margin: 0;
    line-height: 1.55;
}

.desc-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.desc-more {
    background: none;
    border: 0;
    padding: 6px 0 0;
    color: #16a34a;
    font-weight: 700;
    cursor: pointer;
    font-size: .95rem;
}

    .desc-more[hidden] {
        display: none;
    }

/* Edit cart button */
.edit-cart-form {
    margin-top: 10px;
}

.edit-cart-btn {
    border-color: #2563eb !important;
    color: #2563eb !important;
    width: 100%;
    justify-content: center;
}

    .edit-cart-btn:hover {
        background: #2563eb !important;
        color: #fff !important;
    }

/* ---------- flat, app-style pages on phones ---------- */
@media (max-width: 900px) {
    body, main {
        background: #fff;
    }

    /* pages are one clean surface; sections are separated by thin lines, not boxes */
    .account-content, .admin-content, .track-page, .cart-page, .product-details-page {
        background: transparent;
        box-shadow: none;
        border: 0;
        border-radius: 0;
    }

    .account-card, .seller-card, .security-card, .review-form-card, .cart-items, .cart-summary,
    .product-description-card, .product-gallery, .sell-step, .stat-card, .address-card,
    .empty-wishlist, .register-card, .gallery-colors, .welcome-banner {
        background: transparent !important;
        box-shadow: none !important;
        border: 0 !important;
        border-radius: 0 !important;
    }

    .account-card, .seller-card, .security-card, .review-form-card, .product-description-card, .address-card {
        padding: 14px 0 !important;
        border-bottom: 1px solid #eef0f3 !important;
    }

    .cart-items, .cart-summary, .product-gallery {
        padding: 0 !important;
    }

    .cart-summary {
        border-top: 1px solid #eef0f3 !important;
        padding-top: 14px !important;
    }

    .gallery-colors {
        padding: 8px 0 !important;
    }

    .account-card:last-child, .seller-card:last-child {
        border-bottom: 0 !important;
    }

    /* the cards that are real things (products, orders, notices) keep a soft outline */
    .home-product-card, .search-card, .order-card, .review-card, .pay-banner, .order-card-head + * {
        box-shadow: none !important;
        border: 1px solid #eef0f3;
        border-radius: 14px;
    }

    /* forms: clean fields, no heavy boxes */
    .form-control, .form-select, select, textarea, input[type="text"], input[type="email"], input[type="password"],
    input[type="tel"], input[type="number"], input[type="date"] {
        border: 0 !important;
        border-bottom: 1.5px solid #d1d5db !important;
        border-radius: 0 !important;
        background: transparent !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
        box-shadow: none !important;
    }

        .form-control:focus, .form-select:focus, select:focus, textarea:focus, input:focus {
            border-bottom-color: #16a34a !important;
            outline: 0;
            box-shadow: none !important;
        }

        textarea.form-control, textarea {
            border: 1.5px solid #d1d5db !important;
            border-radius: 10px !important;
            padding: 10px !important;
        }

    .form-group label, .form-label, label {
        font-size: .85rem;
        color: #6b7280;
        font-weight: 600;
        margin-bottom: 2px;
    }

    .save-btn, .checkout-btn {
        border-radius: 14px;
        min-height: 48px;
        font-weight: 700;
    }

    /* sign in / register: full screen, no floating card */
    .register-page {
        background: #fff !important;
        align-items: flex-start;
    }

    .register-card {
        padding: 20px 4px !important;
    }

    /* page headings feel like app screens */
    main h1 {
        font-weight: 800;
        letter-spacing: -.01em;
    }
}

/* ---------- delivery location in the top bar: short, then "..." ---------- */
.location-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

    .location-bar i {
        flex: none;
    }

    .location-bar .deliver-text {
        display: inline-block;
        min-width: 0;
        max-width: 240px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: middle;
    }

@media (max-width: 900px) {
    .location-bar {
        flex: 1 1 auto;
    }

        .location-bar .deliver-text {
            max-width: 38vw;
        }
}

@media (max-width: 400px) {
    .location-bar .deliver-text {
        max-width: 32vw;
    }
}

/* =====================================================================
   PRODUCT CARDS, PRICES, DEALS, SHOP, EDIT PRODUCT
   ===================================================================== */

/* every product card: same size, same border, same button position */
.home-product-grid, .product-grid {
    align-items: stretch;
}

.home-product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: none;
    cursor: pointer;
}

    .home-product-card .home-product-image,
    .home-product-card .home-product-image-placeholder {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        object-fit: contain;
        background: #fff;
        flex: none;
        display: flex;
        align-items: center;
        justify-content: center;
    }

.home-product-info {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 10px 12px 12px;
    min-width: 0;
}

    .home-product-info h3 {
        font-size: .95rem;
        line-height: 1.3;
        margin: 4px 0;
        min-height: 2.6em;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .home-product-info .product-rating {
        min-height: 20px;
    }

.card-price {
    margin-top: auto;
    padding-top: 6px;
}

    .card-price h4 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 800;
        color: #111827;
    }

.home-product-info .card-cart-btn {
    margin-top: 8px;
    width: 100%;
    min-height: 40px;
}

/* previous price sits on top, smaller */
.price-was {
    font-size: .78rem;
    color: #9ca3af;
    line-height: 1.2;
    min-height: 1.1em;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .price-was s {
        color: #9ca3af;
    }

.price-was-empty {
    visibility: hidden;
}

.price-off {
    background: #dc2626;
    color: #fff;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: .7rem;
    font-weight: 700;
}

.price-block {
    margin: 6px 0 10px;
}

    .price-block .price-was {
        font-size: .9rem;
    }

    .price-block .product-price {
        margin: 2px 0 0 !important;
    }

/* 50% off strip */
.deal-strip {
    margin: 12px 12px 4px;
    padding: 14px 0 6px 12px;
    background: linear-gradient(135deg, #dc2626, #f97316);
    border-radius: 18px;
    color: #fff;
    overflow: hidden;
}

.deal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 12px;
    margin-bottom: 10px;
}

    .deal-head h2 {
        margin: 0;
        font-size: 1.15rem;
        font-weight: 800;
        color: #fff;
    }

.deal-arrows {
    display: flex;
    gap: 8px;
}

    .deal-arrows button {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: 0;
        background: rgba(255,255,255,.95);
        color: #dc2626;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 1rem;
    }

.deal-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 0 12px 12px 0;
    scrollbar-width: none;
}

    .deal-track::-webkit-scrollbar {
        display: none;
    }

.deal-card {
    position: relative;
    flex: 0 0 150px;
    scroll-snap-align: start;
    background: #fff;
    color: #111827;
    text-decoration: none;
    border-radius: 14px;
    padding: 8px 8px 10px;
    display: flex;
    flex-direction: column;
}

    .deal-card img, .deal-noimg {
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: contain;
        background: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
    }

.deal-off {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    background: #dc2626;
    color: #fff;
    font-weight: 800;
    font-size: .75rem;
    border-radius: 6px;
    padding: 2px 7px;
}

.deal-name {
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.25;
    margin: 6px 0 2px;
    min-height: 2.5em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.deal-price {
    font-weight: 800;
    font-size: 1.05rem;
    color: #dc2626;
}

@media (min-width: 900px) {
    .deal-strip {
        margin: 16px auto 4px;
        max-width: 1280px;
        padding-left: 20px;
    }

    .deal-card {
        flex-basis: 190px;
    }
}

/* seller shop page and link */
.seller-link {
    color: #16a34a;
    font-weight: 700;
    text-decoration: none;
}

    .seller-link:hover {
        text-decoration: underline;
    }

.shop-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 12px 40px;
}

.shop-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.shop-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex: none;
}

.shop-head h1 {
    margin: 0;
    font-size: 1.4rem;
}

.shop-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: .9rem;
}

/* seller: product list */
.mp-add {
    width: auto;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.mp-list {
    display: flex;
    flex-direction: column;
}

.mp-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eef0f3;
}

.mp-thumb {
    width: 72px;
    height: 72px;
    flex: none;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 1.6rem;
}

    .mp-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.mp-main {
    flex: 1 1 auto;
    min-width: 0;
}

.mp-name {
    display: block;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mp-sub {
    font-size: .8rem;
    color: #6b7280;
}

.mp-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-size: .85rem;
    margin-top: 2px;
}

.mp-actions {
    display: flex;
    gap: 8px;
    flex: none;
}

    .mp-actions form {
        margin: 0;
    }

/* seller: edit product */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #16a34a;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 6px;
}

.edit-section {
    margin: 22px 0 10px;
    font-size: 1.05rem;
    padding-bottom: 6px;
    border-bottom: 1px solid #eef0f3;
}

.edit-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.edit-photo {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}

    .edit-photo img {
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: contain;
        background: #fff;
        border-radius: 8px;
    }

.ep-main, .ep-delete {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
    margin: 0;
    cursor: pointer;
}

.ep-delete {
    color: #dc2626;
}

.ep-main input:checked + span {
    color: #16a34a;
    font-weight: 700;
}

.edit-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    position: sticky;
    bottom: calc(var(--gc-nav-h, 0px) + 8px);
    background: #fff;
    padding: 10px 0;
}

    .edit-actions .save-btn {
        flex: 1 1 auto;
    }

    .edit-actions .cancel-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 20px;
        text-decoration: none;
    }

/* per-photo background choice under each new photo */
.photo-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .photo-tile .photo-bg {
        width: 100%;
        font-size: .78rem;
        padding: 4px;
        border: 1px solid #d1d5db !important;
        border-radius: 8px !important;
        background: #fff !important;
    }

/* draft restored */
.draft-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: .9rem;
}

    .draft-banner button {
        background: none;
        border: 0;
        color: #065f46;
        font-weight: 700;
        text-decoration: underline;
        cursor: pointer;
        padding: 4px;
    }

@media (max-width: 640px) {
    .home-product-info {
        padding: 8px 10px 10px;
    }

        .home-product-info h3 {
            font-size: .85rem;
        }

    .deal-card {
        flex-basis: 138px;
    }

    .mp-thumb {
        width: 60px;
        height: 60px;
    }

    .mp-actions .btn {
        padding: 6px 10px;
    }

    .edit-row {
        grid-template-columns: 1fr;
    }
}

/* ---------- orange prices, product tags, GoCartSA logo ---------- */
.card-price h4, .home-product-info h4, .product-price, .deal-price, .price-block .product-price {
    color: #ff9900 !important;
}

.home-product-card {
    position: relative;
}

.card-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .02em;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
}

.tag-popular {
    background: #ff9900;
}

.tag-new {
    background: #16a34a;
}

.tag-top {
    background: #2563eb;
}

.logo .logo-sa {
    font-size: .55em;
    font-weight: 800;
    letter-spacing: .04em;
    margin-left: 2px;
    vertical-align: baseline;
    color: #16a34a;
}

.logo {
    white-space: nowrap;
}

/* ---------- logo: small black "SA" under GoCart ---------- */
.logo {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
}

    .logo .logo-sa {
        display: block;
        align-self: flex-end;
        margin: 1px 0 0;
        font-size: .38em;
        font-weight: 800;
        letter-spacing: .18em;
        color: #111827 !important;
        line-height: 1;
    }

/* 50% off strip now sits inside the featured section */
.featured-products .deal-strip {
    margin: 0 0 16px;
    padding-left: 14px;
}

@media (min-width: 900px) {
    .featured-products .deal-strip {
        max-width: none;
    }
}

/* ---------- compact 50% off strip under the featured heading ---------- */
.featured-products .deal-strip {
    margin: 0 0 14px;
    padding: 8px 0 2px 10px;
    border-radius: 14px;
}

.deal-head {
    margin-bottom: 6px;
    padding-right: 10px;
}

.deal-title {
    font-size: .85rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: .02em;
}

.deal-arrows button {
    width: 26px;
    height: 26px;
    font-size: .75rem;
}

.deal-track {
    gap: 8px;
    padding-bottom: 8px;
}

.deal-card {
    flex: 0 0 108px;
    padding: 6px 6px 8px;
    border-radius: 10px;
}

.deal-off {
    top: 6px;
    left: 6px;
    font-size: .62rem;
    padding: 1px 5px;
}

.deal-name {
    font-size: .72rem;
    min-height: 0;
    -webkit-line-clamp: 1;
    margin: 4px 0 1px;
}

.deal-card .price-was {
    font-size: .68rem;
    min-height: 0;
}

.deal-price {
    font-size: .9rem;
}

@media (min-width: 900px) {
    .deal-card {
        flex-basis: 130px;
    }
}

/* ---------- logo: GoCartSA all on one line ---------- */
.logo {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    flex-wrap: nowrap;
    white-space: nowrap;
    line-height: normal;
}

    .logo .logo-sa {
        display: inline;
        align-self: baseline;
        margin: 0 0 0 2px;
        font-size: .55em;
        font-weight: 800;
        letter-spacing: .04em;
        color: #111827 !important;
        line-height: 1;
    }

/* ---------- 50% off strip: no header, arrows on the sides, see-all card ---------- */
.deal-strip {
    position: relative;
    padding: 8px 10px;
}

.featured-products .deal-strip {
    padding: 8px 10px;
}

.deal-strip .deal-track {
    padding: 0 0 4px;
}

.deal-strip .deal-prev, .deal-strip .deal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 0;
    background: rgba(255,255,255,.95);
    color: #dc2626;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.deal-strip .deal-prev {
    left: 4px;
}

.deal-strip .deal-next {
    right: 4px;
}

.deal-card.deal-all {
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 6px;
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 2px dashed rgba(255,255,255,.8);
    font-weight: 800;
    font-size: .8rem;
}

    .deal-card.deal-all i {
        font-size: 1.8rem;
    }

/* ---------- logo: small black "SA" under GoCart, at the start ---------- */
.logo {
    display: inline-block;
    white-space: nowrap;
    line-height: 1;
}

    .logo .logo-sa {
        display: block;
        margin: 2px 0 0 0;
        text-align: left;
        font-size: .35em;
        font-weight: 800;
        letter-spacing: .25em;
        color: #111827 !important;
        line-height: 1;
    }

/* ---------- "See All" links: clear, tappable buttons ---------- */
.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

    .section-header-row .see-all, a.see-all {
        display: inline-flex !important;
        align-items: center;
        gap: 6px;
        flex: none;
        white-space: nowrap;
        padding: 8px 16px;
        border-radius: 999px;
        background: #fff7ed;
        border: 1.5px solid #ff9900;
        color: #c2410c !important;
        font-weight: 800;
        font-size: .9rem;
        text-decoration: none;
        line-height: 1;
        position: relative;
        z-index: 2;
    }

        .section-header-row .see-all:hover, a.see-all:hover {
            background: #ff9900;
            color: #fff !important;
        }

/* deals strip hugs its cards instead of stretching across the page */
.featured-products .deal-strip {
    display: block;
    width: fit-content;
    max-width: 100%;
}

.deal-track {
    max-width: 100%;
}

/* "See all deals" card stands out */
.deal-card.deal-all {
    background: #fff;
    color: #dc2626;
    border: 2px solid #fff;
}

    .deal-card.deal-all span {
        color: #dc2626;
    }

    .deal-card.deal-all i {
        color: #dc2626;
    }

/* ---------- logo: GoCartSA in one straight line (final) ---------- */
.logo {
    display: inline-block;
    white-space: nowrap;
    line-height: normal;
}

    .logo .logo-sa {
        display: inline;
        margin: 0 0 0 2px;
        font-size: .45em;
        font-weight: 800;
        letter-spacing: .04em;
        color: #111827 !important;
        line-height: 1;
        vertical-align: baseline;
    }

/* ---------- 50% off strip: header is back, tapping it opens all deals ---------- */
.deal-strip .deal-prev, .deal-strip .deal-next {
    position: static;
    transform: none;
    width: 26px;
    height: 26px;
    box-shadow: none;
    background: rgba(255,255,255,.95);
    color: #dc2626;
}

.deal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 2px;
    margin-bottom: 6px;
}

.deal-head-link {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    padding: 4px 2px;
}

    .deal-head-link .deal-title {
        font-size: .95rem;
        font-weight: 800;
        color: #fff;
    }

    .deal-head-link .deal-more {
        font-size: .78rem;
        font-weight: 700;
        color: #fff;
        opacity: .95;
        white-space: nowrap;
    }

    .deal-head-link:hover .deal-more {
        text-decoration: underline;
    }

.deal-arrows {
    display: flex;
    gap: 6px;
    flex: none;
}

.featured-products .deal-strip {
    display: block;
    width: 100%;
    max-width: 100%;
}

/* ---------- All products page: compact, products first ---------- */
.products-compact {
    padding: 10px 12px 0;
    margin: 0;
}

    .products-compact .product-filters {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin: 0;
    }

        .products-compact .product-filters select {
            flex: 1 1 150px;
            min-width: 0;
        }

    .products-compact .results-count {
        margin: 8px 2px 4px;
        color: #6b7280;
        font-size: .85rem;
    }

/* =====================================================================
   SELLER DASHBOARD on phones: equal cards, neat button grid
   ===================================================================== */
@media (max-width: 900px) {
    .seller-dashboard {
        padding: 14px 12px 24px !important;
    }

        .seller-dashboard h1 {
            font-size: 1.6rem !important;
            line-height: 1.2;
            margin: 0 0 4px;
        }

        .seller-dashboard p {
            font-size: .95rem !important;
            margin: 0 0 4px;
        }

    .seller-stats {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        margin: 16px 0 !important;
    }

        .seller-stats .stat-card {
            min-width: 0 !important;
            width: auto !important;
            padding: 14px 12px !important;
            text-align: left;
            background: #fff !important;
            border: 1px solid #e5e7eb !important;
            border-radius: 14px !important;
            box-shadow: none !important;
        }

            .seller-stats .stat-card h3 {
                font-size: 1.35rem !important;
                line-height: 1.15;
                overflow-wrap: anywhere;
            }

            .seller-stats .stat-card span {
                display: block;
                font-size: .8rem;
                margin-top: 4px;
                line-height: 1.3;
            }

    .seller-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px !important;
    }

        .seller-actions .dashboard-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            min-height: 52px;
            padding: 10px 8px !important;
            border-radius: 14px !important;
            font-size: .95rem;
            line-height: 1.2;
            white-space: normal;
        }

            .seller-actions .dashboard-btn:first-child {
                grid-column: 1 / -1;
            }
            /* Add Product stands out */
            .seller-actions .dashboard-btn:last-child:nth-child(even) {
                grid-column: auto;
            }
}
