@import url('https://fonts.googleapis.com/css2?family=Amazon+Ember:wght@300;400;500;700&display=swap');

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

:root {
    --amazon-dark: #131921;
    --amazon-light: #232f3e;
    --amazon-orange: #febd69;
    --amazon-blue: #007185;
    --amazon-yellow: #ffd814;
    --amazon-orange-dark: #fa8900;
    --error-red: #c40000;
}

body {
    font-family: 'Amazon Ember', Arial, sans-serif;
    background-color: #eaeded;
    overflow-x: hidden;
}

/* Icons */
.icon-img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
    object-fit: contain;
}

.arrow-icon {
    width: 16px;
    height: 16px;
    opacity: 0.5;
}

.menu-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    vertical-align: middle;
}

.dropdown-icon {
    width: 12px;
    height: 12px;
    margin-left: 3px;
}

.cart-img {
    width: 40px;
    height: 40px;
}

.search-icon-img {
    width: 24px;
    height: 24px;
}

.arrow-btn-icon {
    width: 20px;
    height: 20px;
}

.section-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 8px;
}

.payment-icon {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}

.btn-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 5px;
}

.toast-icon {
    width: 24px;
    height: 24px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #232f3e;
    color: white;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 3000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.show {
    display: flex;
}

.toast.success {
    background-color: #28a745;
}

.toast.error {
    background-color: #dc3545;
}

/* Header Styles */
.header {
    background-color: var(--amazon-dark);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    gap: 10px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 2px;
    border: 1px solid transparent;
}

    .logo:hover {
        border: 1px solid white;
        border-radius: 2px;
    }

.logo-img {
    height: 60px;
}

.location {
    display: none;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    border: 1px solid transparent;
}

    .location:hover {
        border: 1px solid white;
        border-radius: 2px;
    }

.location-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

    .location-text small {
        font-size: 12px;
        color: #ccc;
    }

    .location-text strong {
        font-size: 14px;
    }

.search-bar {
    flex: 1;
    display: flex;
    max-width: 600px;
    min-width: 200px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
}

.search-select {
    background-color: #f3f3f3;
    border: none;
    padding: 0 10px;
    cursor: pointer;
    font-size: 12px;
    color: #555;
    border-right: 1px solid #cdcdcd;
}

.search-input {
    flex: 1;
    border: none;
    padding: 0 10px;
    font-size: 14px;
    outline: none;
}

.search-btn {
    background-color: var(--amazon-orange);
    border: none;
    padding: 0 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

    .search-btn:hover {
        background-color: #f3a847;
    }

.header-nav {
    display: none;
    align-items: center;
    gap: 15px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    border: 1px solid transparent;
    line-height: 1.2;
}

    .nav-item:hover {
        border: 1px solid white;
        border-radius: 2px;
    }

    .nav-item small {
        font-size: 12px;
        color: #ccc;
    }

    .nav-item strong {
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 3px;
    }

.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px;
    border: 1px solid transparent;
}

    .cart-icon:hover {
        border: 1px solid white;
        border-radius: 2px;
    }

.cart-count {
    position: absolute;
    top: 8px;
    right: 46px;
    color: ORANGE;
    font-weight: bold;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 50%;
}

.cart-text {
    font-size: 14px;
    font-weight: bold;
    align-self: flex-end;
    margin-left: 5px;
}

.mobile-menu-btn {
    display: block;
    cursor: pointer;
    padding: 5px;
}

.header-bottom {
    background-color: var(--amazon-light);
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

    .header-bottom::-webkit-scrollbar {
        display: none;
    }

.menu-all {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: bold;
    padding: 5px;
    border: 1px solid transparent;
    flex-shrink: 0;
}

    .menu-all:hover {
        border: 1px solid white;
        border-radius: 2px;
    }

.header-links {
    display: flex;
    gap: 20px;
}

    .header-links a {
        color: white;
        text-decoration: none;
        font-size: 14px;
        padding: 5px;
        border: 1px solid transparent;
        flex-shrink: 0;
    }

        .header-links a:hover {
            border: 1px solid white;
            border-radius: 2px;
        }

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 365px;
    height: 100vh;
    background-color: white;
    z-index: 2000;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.3);
}

    .sidebar.active {
        left: 0;
    }

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    z-index: 1999;
    display: none;
}

    .sidebar-overlay.active {
        display: block;
    }

.sidebar-header {
    background-color: var(--amazon-light);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
}

.sidebar-user-icon {
    width: 30px;
    height: 30px;
    filter: brightness(0) invert(1);
}

.sidebar-section {
    padding: 15px 20px;
    border-bottom: 1px solid #d5dbdb;
}

    .sidebar-section h3 {
        font-size: 16px;
        margin-bottom: 15px;
        color: #111;
    }

    .sidebar-section ul {
        list-style: none;
    }

    .sidebar-section li {
        padding: 10px 0;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: #444;
        font-size: 14px;
    }

        .sidebar-section li:hover {
            color: var(--amazon-orange-dark);
            background-color: #f5f5f5;
            margin: 0 -20px;
            padding-left: 20px;
            padding-right: 20px;
        }

.close-sidebar {
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
    z-index: 2001;
}

/* Hero Section */
.hero-section {
    position: relative;
    max-width: 1500px;
    margin: 0 auto;
    background: linear-gradient(to bottom, transparent 50%, #eaeded 100%);
}

.hero-slider {
    position: relative;
    height: 250px;
    overflow: hidden;
}

@media (min-width: 768px) {
    .hero-slider {
        height: 400px;
    }
}

@media (min-width: 1024px) {
    .hero-slider {
        height: 600px;
    }
}

.hero-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    background-size: cover;
    background-position: center;
}

    .hero-slide.active {
        opacity: 1;
    }

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, #eaeded 0%, transparent 100%);
    text-align: center;
}

    .hero-content p {
        background-color: rgba(255,255,255,0.9);
        padding: 10px;
        border-radius: 4px;
        font-size: 14px;
        display: inline-block;
    }

    .hero-content a {
        color: var(--amazon-blue);
        text-decoration: none;
    }

/* Product Grid */
.products-container {
    max-width: 1500px;
    margin: -100px auto 0;
    padding: 0 15px;
    position: relative;
    z-index: 10;
}

@media (min-width: 768px) {
    .products-container {
        margin-top: -300px;
        padding: 0 20px;
    }
}

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.product-card {
    background-color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    z-index: 1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

    .product-card h2 {
        font-size: 18px;
        margin-bottom: 15px;
        color: #0f1111;
    }

.product-image {
    width: 100%;
    height: 250px;
    object-fit: contain;
    margin-bottom: 15px;
    cursor: pointer;
    transition: transform 0.2s;
}

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

.product-grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.product-grid-item {
    cursor: pointer;
}

    .product-grid-item img {
        width: 100%;
        height: 100px;
        object-fit: cover;
        margin-bottom: 5px;
    }

    .product-grid-item span {
        font-size: 12px;
        color: #565959;
    }

.see-more {
    color: var(--amazon-blue);
    text-decoration: none;
    font-size: 13px;
    margin-top: auto;
}

    .see-more:hover {
        color: var(--amazon-orange-dark);
        text-decoration: underline;
    }

/* Horizontal Scroll Section */
.scroll-section {
    background-color: white;
    margin: 20px auto;
    max-width: 1500px;
    padding: 20px;
    position: relative;
}

.scroll-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

    .scroll-header h2 {
        font-size: 20px;
        color: #0f1111;
    }

.scroll-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

    .scroll-container::-webkit-scrollbar {
        height: 8px;
    }

    .scroll-container::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .scroll-container::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }

.scroll-item {
    flex: 0 0 auto;
    width: 200px;
    cursor: pointer;
    transition: transform 0.2s;
}

    .scroll-item:hover {
        transform: translateY(-5px);
    }

    .scroll-item img {
        width: 100%;
        height: 200px;
        object-fit: contain;
        background-color: #f7f7f7;
    }

.scroll-item-info {
    padding: 10px 0;
}

    .scroll-item-info h4 {
        font-size: 14px;
        color: #0f1111;
        margin-bottom: 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.price {
    color: #b12704;
    font-size: 18px;
    font-weight: bold;
}

.original-price {
    text-decoration: line-through;
    color: #565959;
    font-size: 14px;
    margin-left: 5px;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: white;
    border: 1px solid #ddd;
    width: 40px;
    height: 100px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
    display: none;
}

@media (min-width: 768px) {
    .scroll-btn {
        display: flex;
    }
}

.scroll-btn:hover {
    background-color: #f7f7f7;
}

.scroll-btn.left {
    left: 0;
    border-radius: 0 4px 4px 0;
}

.scroll-btn.right {
    right: 0;
    border-radius: 4px 0 0 4px;
}

/* Single Product Page */
.single-product-page {
    display: none;
    max-width: 1500px;
    margin: 20px auto;
    padding: 20px;
    background-color: white;
}

    .single-product-page.active {
        display: block;
    }

.breadcrumb {
    font-size: 12px;
    color: #565959;
    margin-bottom: 20px;
}

    .breadcrumb a {
        color: var(--amazon-blue);
        text-decoration: none;
    }

.product-detail-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    .product-detail-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .product-detail-container {
        grid-template-columns: 2fr 3fr 2fr;
    }
}

/* ============================================================
   PRODUCT GALLERY — Amazon-style
   Left: vertical thumbnail strip  |  Right: large main image
   ============================================================ */
.product-gallery {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
    position: sticky;
    top: 80px;
}

/* Vertical thumbnail strip */
.thumbnail-strip {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    overflow-y: auto;
    max-height: 480px;
}

.thumb-wrap {
    width: 66px;
    height: 66px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    padding: 3px;
    flex-shrink: 0;
    transition: border-color 0.15s, box-shadow 0.15s;
    overflow: hidden;
}

.thumb-wrap:hover,
.thumb-wrap.active {
    border-color: #c45500;
    box-shadow: 0 0 0 2px rgba(196,85,0,0.25);
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Main image column */
.main-img-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.main-img-frame {
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    cursor: zoom-in;
    position: relative;
}

#main-product-img {
    width: 100%;
    max-height: 460px;
    object-fit: contain;
    display: block;
    padding: 16px;
    transition: opacity 0.15s;
}

.magnify-hint {
    text-align: center;
    font-size: 11px;
    color: #888;
    padding: 4px 0 8px;
}

/* Up/Down navigation arrows */
.img-arrow {
    background: rgba(255,255,255,0.92);
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: background 0.15s;
    padding: 0;
    flex-shrink: 0;
}

.img-arrow:hover { background: #febd69; }

/* Dot indicators */
.img-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.img-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    display: inline-block;
}

.img-dot.active { background: #c45500; }

/* Mobile buy buttons — hidden on desktop */
.mobile-buy-btns { display: none; }

/* Keep old class names working (backward compat) */
.thumbnail-list { display: flex; flex-direction: column; gap: 6px; }
.thumbnail { width: 66px; height: 66px; border: 2px solid #ddd; border-radius: 5px;
             cursor: pointer; padding: 3px; background: #fff; object-fit: contain; }
.thumbnail.active, .thumbnail:hover { border-color: #c45500; }
.main-image-wrap { flex: 1; }
.main-image { width: 100%; max-height: 460px; object-fit: contain; padding: 16px;
              background: #fff; border: 1px solid #ddd; border-radius: 6px; cursor: zoom-in; }


.product-info h1 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #0f1111;
}

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

.stars {
    color: var(--amazon-orange);
    font-size: 18px;
}

.rating-count {
    color: var(--amazon-blue);
    font-size: 14px;
    cursor: pointer;
}

.price-section {
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    margin: 15px 0;
}

.price-large {
    font-size: 28px;
    color: #b12704;
    font-weight: bold;
}

    .price-large span {
        font-size: 14px;
        vertical-align: super;
    }

.availability {
    color: #007600;
    font-size: 16px;
    margin: 10px 0;
}

.product-features {
    margin: 20px 0;
    list-style: disc;
    padding-left: 20px;
}

    .product-features li {
        margin: 8px 0;
        color: #0f1111;
    }

.buy-box {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background-color: #f7f7f7;
}

.buy-box-price {
    font-size: 18px;
    color: #b12704;
    margin-bottom: 10px;
}

.delivery-info {
    font-size: 14px;
    color: #0f1111;
    margin-bottom: 15px;
    line-height: 1.5;
}

    .delivery-info strong {
        color: #007600;
    }

.quantity-selector {
    margin-bottom: 15px;
}

    .quantity-selector label {
        display: block;
        font-size: 14px;
        margin-bottom: 5px;
        font-weight: bold;
    }

    .quantity-selector select {
        width: 100%;
        padding: 8px;
        border-radius: 8px;
        border: 1px solid #ddd;
        background-color: #f0f2f2;
    }

.btn-add-cart, .btn-buy-now {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-cart {
    background-color: var(--amazon-yellow);
}

    .btn-add-cart:hover {
        background-color: #f7ca00;
    }

.btn-buy-now {
    background-color: var(--amazon-orange);
}

    .btn-buy-now:hover {
        background-color: #fa8900;
    }

.secure-transaction {
    font-size: 12px;
    color: var(--amazon-blue);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Cart Page */
.cart-page {
    display: none;
    max-width: 1500px;
    margin: 20px auto;
    padding: 20px;
    min-height: 60vh;
}

    .cart-page.active {
        display: block;
    }

.cart-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 1024px) {
    .cart-container {
        grid-template-columns: 3fr 1fr;
    }
}

.cart-items-section {
    background-color: white;
    padding: 20px;
}

.cart-header {
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

    .cart-header h1 {
        font-size: 28px;
        font-weight: 400;
    }

    .cart-header p {
        color: #565959;
        font-size: 14px;
        margin-top: 5px;
    }

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

@media (min-width: 640px) {
    .cart-item {
        grid-template-columns: 180px 2fr 1fr;
    }
}

.cart-item-image {
    width: 100%;
    max-width: 180px;
}

    .cart-item-image img {
        width: 100%;
        object-fit: contain;
    }

.cart-item-details h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #0f1111;
}

.cart-item-details .in-stock {
    color: #007600;
    font-size: 12px;
    margin-bottom: 5px;
}

.cart-item-details .eligible {
    color: #565959;
    font-size: 12px;
    margin-bottom: 10px;
}

.cart-item-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

    .quantity-control button {
        background-color: #f0f2f2;
        border: none;
        padding: 8px 12px;
        cursor: pointer;
        font-size: 16px;
    }

        .quantity-control button:hover {
            background-color: #e3e6e6;
        }

    .quantity-control span {
        padding: 0 15px;
        font-size: 14px;
    }

.action-links {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--amazon-blue);
}

    .action-links span {
        cursor: pointer;
        border-left: 1px solid #ddd;
        padding-left: 15px;
    }

        .action-links span:first-child {
            border-left: none;
            padding-left: 0;
        }

        .action-links span:hover {
            text-decoration: underline;
        }

.cart-item-price {
    font-size: 18px;
    font-weight: bold;
    text-align: right;
}

.cart-subtotal {
    text-align: right;
    padding: 20px 0;
    font-size: 18px;
}

    .cart-subtotal span {
        font-weight: bold;
    }

.cart-summary {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    height: fit-content;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.summary-total {
    font-size: 18px;
    font-weight: bold;
    border-top: 1px solid #ddd;
    padding-top: 10px;
    margin-top: 10px;
}

.btn-checkout {
    width: 100%;
    background-color: var(--amazon-yellow);
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 15px;
}

    .btn-checkout:hover {
        background-color: #f7ca00;
    }

.empty-cart {
    text-align: center;
    padding: 60px 20px;
}

    .empty-cart img {
        width: 64px;
        height: 64px;
        opacity: 0.3;
        margin-bottom: 20px;
    }

    .empty-cart h2 {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .empty-cart p {
        color: #565959;
        margin-bottom: 20px;
    }

.btn-continue-shopping {
    background-color: var(--amazon-yellow);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* Payment Page */
.payment-page {
    display: none;
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    min-height: 60vh;
}

    .payment-page.active {
        display: block;
    }

.payment-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    .payment-container {
        grid-template-columns: 2fr 1fr;
    }
}

.payment-form {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
}

    .payment-form h2 {
        font-size: 24px;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 1px solid #ddd;
        display: flex;
        align-items: center;
        gap: 10px;
    }

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

    .form-group label {
        display: block;
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 5px;
    }

    .form-group input, .form-group select {
        width: 100%;
        padding: 10px;
        border: 1px solid #a6a6a6;
        border-radius: 4px;
        font-size: 14px;
    }

        .form-group input:focus {
            outline: none;
            border-color: var(--amazon-orange);
            box-shadow: 0 0 0 3px rgba(254, 189, 105, 0.3);
        }

        .form-group input.error {
            border-color: var(--error-red);
            background-color: #fff8f8;
        }

.error-msg {
    color: var(--error-red);
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

    .error-msg.show {
        display: block;
    }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.payment-methods {
    margin-bottom: 20px;
}

.payment-method {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .payment-method:hover {
        background-color: #f7f7f7;
    }

    .payment-method.selected {
        border-color: var(--amazon-orange);
        background-color: #fff8e1;
    }

    .payment-method input[type="radio"] {
        width: auto;
    }

.place-order-btn {
    width: 100%;
    background-color: var(--amazon-yellow);
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .place-order-btn:hover {
        background-color: #f7ca00;
    }

.order-summary-payment {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    height: fit-content;
}

/* Footer */
.footer {
    background-color: #232f3e;
    color: white;
    margin-top: 40px;
}

.back-to-top {
    background-color: #37475a;
    text-align: center;
    padding: 15px;
    cursor: pointer;
    font-size: 14px;
}

    .back-to-top:hover {
        background-color: #485769;
    }

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.footer-column h3 {
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: bold;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 10px;
    font-size: 14px;
    color: #ddd;
    cursor: pointer;
}

    .footer-column li:hover {
        text-decoration: underline;
    }

.footer-bottom {
    border-top: 1px solid #3a4553;
    padding: 30px 20px;
    text-align: center;
}

.footer-logo-img {
    height: 30px;
    margin-bottom: 10px;
}

.copyright {
    font-size: 12px;
    color: #aaa;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.mt-20 {
    margin-top: 20px;
}

/* Responsive Header */
@media (min-width: 768px) {
    .location {
        display: flex;
    }

    .header-nav {
        display: flex;
    }

    .mobile-menu-btn {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-top {
        padding: 8px 10px;
    }

    .search-bar {
        order: 3;
        width: 100%;
        max-width: none;
    }

    .logo-img {
        height: 28px;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--amazon-orange);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ============================================================
   MOBILE RESPONSIVE — full overhaul
   ============================================================ */

/* Small phones and tablets portrait */
@media (max-width: 767px) {

    /* --- Header --- */
    .header-top {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 10px;
    }

    .logo        { order: 1; }
    .logo-img    { height: 36px; }
    .cart-icon   { order: 2; margin-left: auto; }

    .search-bar {
        order: 3;
        width: 100%;
        max-width: 100%;
        min-width: unset;
        flex: none;
    }

    /* Hide the category dropdown in search on mobile to save space */
    .search-select { display: none; }

    .header-nav { display: none !important; }
    .location   { display: none !important; }

    .header-bottom {
        padding: 6px 10px;
        gap: 14px;
        font-size: 13px;
    }

    /* --- Product detail page --- */
    .single-product-page { padding: 10px !important; }
    .breadcrumb { font-size: 12px; margin-bottom: 10px; }

    .product-detail-container {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    /* Gallery: thumbnails go horizontal below main image on mobile */
    .product-gallery {
        flex-direction: column;
        position: static;
    }

    .thumbnail-strip {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: visible;
        max-height: unset;
        max-width: 100%;
        padding-bottom: 4px;
        gap: 6px;
    }

    .thumb-wrap {
        width: 58px;
        height: 58px;
        flex-shrink: 0;
    }

    /* Also keep old compat classes mobile-sized */
    .thumbnail-list { flex-direction: row; overflow-x: auto; max-height: unset; }
    .thumbnail { width: 56px; height: 56px; flex-shrink: 0; }

    .main-img-area { width: 100%; }
    .main-image-wrap { width: 100%; }

    #main-product-img, .main-image {
        max-height: 260px;
        padding: 10px;
    }

    .img-arrow { display: none; } /* use thumbnail strip + dots on mobile */

    /* Hide desktop buy-box; show inline buy buttons */
    .buy-box { display: none !important; }

    .mobile-buy-btns {
        display: flex;
        gap: 10px;
        margin-top: 16px;
    }

    .mobile-buy-btns .btn-add-cart,
    .mobile-buy-btns .btn-buy-now {
        flex: 1;
        padding: 12px 8px;
        font-size: 14px;
        border-radius: 20px;
        border: none;
        cursor: pointer;
        font-weight: bold;
    }

    .mobile-buy-btns .btn-add-cart { background: var(--amazon-yellow); color: #111; }
    .mobile-buy-btns .btn-buy-now  { background: #ffa41c; color: #111; }

    /* --- Cart page --- */
    .cart-container {
        flex-direction: column !important;
        padding: 10px !important;
        gap: 15px;
    }

    .cart-items-section,
    .cart-summary {
        width: 100% !important;
        min-width: unset !important;
    }

    .cart-item {
        flex-wrap: wrap;
        gap: 10px;
    }

    .cart-item-image img {
        width: 80px !important;
        height: 80px !important;
    }

    /* --- Payment page --- */
    .payment-container {
        flex-direction: column !important;
        padding: 10px !important;
        gap: 15px;
    }

    .payment-form,
    .order-summary-payment {
        width: 100% !important;
        min-width: unset !important;
    }

    .form-row {
        flex-direction: column !important;
        gap: 0 !important;
    }

    /* --- Products grid on home --- */
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
        padding: 10px !important;
    }

    .product-card { padding: 12px !important; }

    /* --- Scroll sections --- */
    .scroll-item {
        min-width: 140px !important;
        max-width: 140px !important;
    }

    .scroll-item img { height: 110px !important; }

    /* --- Footer --- */
    .footer-content {
        grid-template-columns: 1fr 1fr !important;
        padding: 20px 15px !important;
        gap: 20px;
    }

    .footer-column h3 { font-size: 13px; }
    .footer-column li { font-size: 12px; }
}

/* Very small phones */
@media (max-width: 420px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .footer-content {
        grid-template-columns: 1fr !important;
    }

    .scroll-item {
        min-width: 120px !important;
        max-width: 120px !important;
    }

    .scroll-item img { height: 90px !important; }

    .product-info h1 { font-size: 18px; }

    .gallery-arrow { width: 30px; height: 30px; font-size: 20px; }
}

/* Tablet (768 – 1023px): 2-column layout, buy-box full-width */
@media (min-width: 768px) and (max-width: 1023px) {
    .product-detail-container {
        grid-template-columns: 1fr 1fr !important;
    }

    .buy-box {
        grid-column: span 2;
        display: flex !important;
        flex-direction: row;
        align-items: center;
        gap: 15px;
        background: #f9f9f9;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 15px 20px;
    }

    .buy-box .btn-add-cart,
    .buy-box .btn-buy-now {
        flex: 1;
    }
}
