/* =========================================================
   MYSHOP - RESPONSIVE CSS
   Mobile + Tablet Responsive Fix
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

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

/* =========================
   CONTAINER
   ========================= */

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* =========================
   HEADER
   ========================= */

.site-header {
    width: 100%;
}

.header-inner {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    flex-shrink: 0;
}

.logo img {
    max-width: 180px;
    height: auto;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 25px;
}

.main-nav a {
    white-space: nowrap;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* =========================
   SEARCH
   ========================= */

.search-overlay {
    width: 100%;
}

.search-box {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

/* =========================
   HERO
   ========================= */

.hero {
    width: 100%;
    min-height: 500px;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.hero-content {
    width: 100%;
    max-width: 650px;
    padding: 60px 20px;
}

/* =========================
   CATEGORY GRID
   ========================= */

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.category-card {
    width: 100%;
    min-width: 0;
}

.category-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* =========================
   PRODUCT GRID
   ========================= */

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.product-card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.product-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* =========================
   PRODUCT CONTENT
   ========================= */

.product-card h3,
.product-card h2,
.product-card p {
    overflow-wrap: anywhere;
}

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

/* =========================
   PROMO BANNER
   ========================= */

.promo-banner {
    width: 100%;
    overflow: hidden;
}

.promo-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* =========================
   PROMISE / FEATURES
   ========================= */

.promise-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.promise-item {
    min-width: 0;
}

/* =========================
   NEWSLETTER
   ========================= */

.newsletter {
    width: 100%;
}

.newsletter-form {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
}

.newsletter-form input {
    min-width: 0;
    flex: 1;
}

/* =========================
   FOOTER
   ========================= */

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.footer-column {
    min-width: 0;
}

.footer-column a {
    overflow-wrap: anywhere;
}

/* =========================================================
   PRODUCT DETAIL PAGE
   ========================================================= */

.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 50px;
}

.product-gallery {
    min-width: 0;
}

.product-main-image {
    width: 100%;
}

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

.thumbnail-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.thumbnail-list img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
}

.product-info {
    min-width: 0;
}

.product-info h1 {
    overflow-wrap: anywhere;
}

.variant-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quantity-control {
    display: flex;
    align-items: center;
    max-width: 160px;
}

.product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.product-actions button,
.product-actions a {
    min-height: 46px;
}

/* =========================================================
   CATEGORY / SHOP PAGE
   ========================================================= */

.category-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 30px;
}

.category-sidebar {
    min-width: 0;
}

.category-products {
    min-width: 0;
}

.filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

/* =========================================================
   CART
   ========================================================= */

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 30px;
}

.cart-items {
    min-width: 0;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
}

.cart-item-image img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.cart-item-info {
    min-width: 0;
}

.cart-item-info h3 {
    overflow-wrap: anywhere;
}

.cart-summary {
    min-width: 0;
}

/* =========================================================
   CHECKOUT
   ========================================================= */

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 30px;
}

.checkout-form,
.checkout-summary {
    min-width: 0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.form-group {
    min-width: 0;
}

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

.checkout-summary {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.coupon-form {
    display: flex;
    gap: 10px;
}

.coupon-form input {
    min-width: 0;
    flex: 1;
}

.coupon-btn {
    flex-shrink: 0;
}

/* =========================================================
   LOGIN / ACCOUNT
   ========================================================= */

.auth-container {
    width: 100%;
    max-width: 500px;
    margin: 40px auto;
    padding: 0 20px;
}

.auth-box {
    width: 100%;
}

.auth-box input,
.auth-box select,
.auth-box textarea {
    width: 100%;
    max-width: 100%;
}

.account-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 30px;
}

.account-sidebar,
.account-content {
    min-width: 0;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1024px) {

    .header-inner {
        gap: 12px;
    }

    .main-nav {
        gap: 15px;
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .promise-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-detail {
        gap: 30px;
    }

    .category-layout {
        grid-template-columns: 200px minmax(0, 1fr);
    }

    .cart-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
    }

    .checkout-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* HEADER */

    .header-inner {
        padding: 12px 15px;
        gap: 10px;
    }

    .logo img {
        max-width: 130px;
    }

    .main-nav {
        width: 100%;
        order: 3;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
        gap: 18px;
        padding: 10px 0 5px;
        scrollbar-width: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .header-inner {
        flex-wrap: wrap;
    }

    .header-icons {
        gap: 9px;
    }

    /* HERO */

    .hero {
        min-height: 400px;
        background-position: center center;
    }

    .hero-content {
        padding: 45px 20px;
        max-width: 100%;
    }

    .hero h1 {
        font-size: 32px;
        line-height: 1.15;
    }

    .hero p {
        font-size: 15px;
    }

    /* CATEGORY */

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

    /* PRODUCTS */

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

    .product-card img {
        aspect-ratio: 1 / 1;
    }

    /* PROMISE */

    .promise-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    /* FOOTER */

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    /* NEWSLETTER */

    .newsletter-form {
        flex-direction: column;
        gap: 10px;
    }

    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
        min-height: 45px;
    }

    /* PRODUCT DETAIL */

    .product-detail {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .product-main-image img {
        max-height: 500px;
        object-fit: contain;
    }

    .thumbnail-list img {
        width: 65px;
        height: 65px;
    }

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

    .product-actions button,
    .product-actions a {
        width: 100%;
        text-align: center;
    }

    /* CATEGORY */

    .category-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .category-sidebar {
        width: 100%;
    }

    /* CART */

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

    .cart-item {
        grid-template-columns: 75px minmax(0, 1fr);
        gap: 12px;
        padding: 12px 0;
    }

    .cart-item-image img {
        width: 75px;
        height: 75px;
    }

    .cart-item-actions {
        grid-column: 2;
    }

    /* CHECKOUT */

    .checkout-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .checkout-summary {
        position: static;
    }

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

    .coupon-form {
        flex-direction: column;
    }

    .coupon-btn {
        width: 100%;
    }

    /* ACCOUNT */

    .account-layout {
        grid-template-columns: 1fr;
    }

    /* TABLE */

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }
}

/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .header-inner {
        padding: 10px 12px;
    }

    .logo img {
        max-width: 110px;
    }

    .header-icons {
        gap: 7px;
    }

    .hero {
        min-height: 330px;
    }

    .hero-content {
        padding: 30px 15px;
    }

    .hero h1 {
        font-size: 27px;
    }

    .hero p {
        font-size: 14px;
    }

    .category-grid {
        gap: 8px;
    }

    .product-grid {
        gap: 8px;
    }

    .promise-grid {
        gap: 8px;
    }

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

    .product-card h3 {
        font-size: 14px;
        line-height: 1.35;
    }

    .product-card p {
        font-size: 13px;
    }

    .product-detail {
        gap: 20px;
    }

    .thumbnail-list img {
        width: 58px;
        height: 58px;
    }

    .cart-item {
        grid-template-columns: 65px minmax(0, 1fr);
    }

    .cart-item-image img {
        width: 65px;
        height: 65px;
    }
}

/* =========================================================
   IMPORTANT - IMAGE AUTO FIT
   ========================================================= */

/*
   Product/category/banner images automatically fit
   their container without stretching.
*/

.product-card img,
.category-card img,
.product-main-image img,
.thumbnail-list img,
.promo-banner img,
.hero img {
    max-width: 100%;
}

/*
   Mobile uploaded product image:
   original aspect ratio maintained.
*/

@media (max-width: 768px) {

    .product-card img,
    .category-card img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .promo-banner img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}