/* =========================================================
   VJoraShop - Professional E-Commerce Design
   ========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --navy: #071a33;
    --navy-2: #0d2a4d;
    --yellow: #ffd21f;
    --yellow-dark: #e7b900;
    --white: #ffffff;
    --bg: #f6f8fb;
    --text: #101828;
    --muted: #667085;
    --border: #e4e7ec;
    --success: #027a48;
    --danger: #b42318;
    --shadow: 0 10px 30px rgba(7, 26, 51, 0.08);
    --radius: 14px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;

    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}


/* =========================================================
   COMMON
   ========================================================= */

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

.primary {
    border: 0;
    background: var(--yellow);
    color: var(--navy);
    font-weight: 800;
    padding: 12px 18px;
    border-radius: 9px;
    transition: 0.2s ease;
}

.primary:hover {
    background: var(--yellow-dark);
    transform: translateY(-1px);
}

.full {
    width: 100%;
}


/* =========================================================
   HEADER
   ========================================================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;

    min-height: 72px;
    padding: 12px 5%;

    display: flex;
    align-items: center;
    gap: 25px;

    background: var(--navy);
    color: var(--white);

    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.12);
}


/* LOGO */

.brand {
    min-width: 155px;

    font-size: 27px;
    font-weight: 900;
    letter-spacing: -0.7px;

    color: var(--white);
}

.brand span {
    color: var(--yellow);
}


/* SEARCH */

.search {
    flex: 1;

    max-width: 650px;

    display: flex;
    align-items: center;
}

.search input {
    width: 100%;
    height: 44px;

    border: 0;
    outline: 0;

    padding: 0 15px;

    background: var(--white);
    color: var(--text);

    border-radius: 9px 0 0 9px;
}

.search button {
    height: 44px;

    padding: 0 20px;

    border: 0;

    background: var(--yellow);
    color: var(--navy);

    font-weight: 800;

    border-radius: 0 9px 9px 0;
}

.search button:hover {
    background: var(--yellow-dark);
}


/* HEADER ACTIONS */

.top-actions {
    margin-left: auto;

    display: flex;
    align-items: center;
    gap: 8px;
}

.top-actions button {
    min-height: 42px;

    padding: 9px 13px;

    border: 1px solid rgba(255,255,255,0.18);

    background: rgba(255,255,255,0.08);
    color: var(--white);

    border-radius: 9px;

    font-weight: 700;

    transition: 0.2s ease;
}

.top-actions button:hover {
    background: var(--white);
    color: var(--navy);
}

#cartBtn {
    position: relative;
}

#cartCount {
    display: inline-grid;
    place-items: center;

    min-width: 21px;
    height: 21px;

    padding: 0 5px;

    margin-left: 4px;

    background: var(--yellow);
    color: var(--navy);

    border-radius: 999px;

    font-size: 11px;
    font-weight: 900;
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.nav {
    min-height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 6px 5%;

    background: var(--white);

    border-bottom: 1px solid var(--border);

    overflow-x: auto;
}

.nav-link {
    border: 0;
    background: transparent;

    color: #344054;

    padding: 9px 16px;

    border-radius: 8px;

    font-size: 14px;
    font-weight: 700;

    white-space: nowrap;

    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: var(--navy);
    color: var(--yellow);
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
    min-height: 410px;

    margin: 25px auto;

    width: 90%;
    max-width: 1400px;

    padding: 65px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    border-radius: 22px;

    background:
        linear-gradient(
            115deg,
            var(--navy),
            var(--navy-2)
        );

    color: var(--white);

    position: relative;
    overflow: hidden;

    box-shadow: var(--shadow);
}

.hero::after {
    content: "";

    position: absolute;

    width: 380px;
    height: 380px;

    right: -100px;
    bottom: -160px;

    border-radius: 50%;

    background: rgba(255, 210, 31, 0.12);
}

.hero h1 {
    position: relative;
    z-index: 1;

    max-width: 720px;

    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.05;

    margin-bottom: 18px;
}

.hero p {
    position: relative;
    z-index: 1;

    max-width: 650px;

    color: #d0d5dd;

    font-size: 17px;

    margin-bottom: 28px;
}

#shopNowBtn {
    position: relative;
    z-index: 2;

    width: max-content;
}


/* =========================================================
   SECTIONS
   ========================================================= */

.section {
    width: 90%;
    max-width: 1400px;

    margin: 45px auto;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 22px;
}

.section-head h2 {
    font-size: 28px;
    color: var(--navy);
}

#resultText {
    color: var(--muted);
    font-size: 14px;
}


/* =========================================================
   CATEGORY CARDS
   ========================================================= */

.category-list {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 16px;
}

.category-card {
    min-height: 150px;

    padding: 22px;

    display: flex;
    flex-direction: column;
    justify-content: end;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--white);

    box-shadow: 0 5px 20px rgba(0,0,0,0.04);

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.category-card:hover {
    transform: translateY(-4px);

    border-color: var(--yellow);

    box-shadow: var(--shadow);
}

.category-card h3 {
    color: var(--navy);
    font-size: 19px;

    margin-bottom: 5px;
}

.category-card p {
    color: var(--muted);
    font-size: 13px;
}


/* =========================================================
   PRODUCTS
   ========================================================= */

.products-grid,
.product-list {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 20px;
}


/* PRODUCT CARD */

.product-card {
    position: relative;

    overflow: hidden;

    background: var(--white);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow:
        0 5px 18px rgba(7, 26, 51, 0.045);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-5px);

    box-shadow:
        0 14px 35px rgba(7, 26, 51, 0.11);
}


/* PRODUCT IMAGE */

.product-img,
.product-image {
    position: relative;

    width: 100%;
    height: 255px;

    background: #f2f4f7;

    overflow: hidden;
}

.product-img img,
.product-image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition:
        transform 0.3s ease;
}

.product-card:hover .product-img img {
    transform: scale(1.04);
}


/* BADGE */

.product-badge {
    position: absolute;
    z-index: 2;

    top: 12px;
    left: 12px;

    padding: 5px 9px;

    background: var(--yellow);
    color: var(--navy);

    border-radius: 6px;

    font-size: 11px;
    font-weight: 900;
}


/* WISHLIST */

.wishlist-product-btn {
    position: absolute;
    z-index: 3;

    top: 10px;
    right: 10px;

    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);

    background: rgba(255,255,255,0.95);

    color: var(--navy);

    border-radius: 50%;

    font-size: 21px;

    transition: 0.2s ease;
}

.wishlist-product-btn:hover,
.wishlist-product-btn.active {
    background: var(--navy);
    color: var(--yellow);
}


/* PRODUCT BODY */

.product-body {
    padding: 17px;
}

.product-category {
    display: inline-block;

    color: #667085;

    font-size: 11px;

    text-transform: uppercase;

    letter-spacing: 0.08em;

    font-weight: 800;

    margin-bottom: 5px;
}

.product-body h3 {
    color: var(--navy);

    font-size: 17px;

    line-height: 1.35;

    min-height: 46px;

    margin-bottom: 10px;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 9px;

    margin-bottom: 5px;
}

.product-price strong {
    color: var(--navy);

    font-size: 20px;
}

.product-price del {
    color: #98a2b3;

    font-size: 13px;
}

.discount {
    display: inline-block;

    color: var(--success);

    font-size: 12px;
    font-weight: 800;
}

.stock-text,
.stock-detail {
    color: var(--muted);

    font-size: 12px;

    margin-top: 7px;
}


/* CARD BUTTONS */

.card-actions {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 8px;

    margin-top: 15px;
}

.card-actions button,
.buy-now-btn {
    min-height: 40px;

    border-radius: 8px;

    font-size: 12px;

    font-weight: 800;
}

.view-btn {
    border: 1px solid var(--border);

    background: var(--white);

    color: var(--navy);
}

.view-btn:hover {
    border-color: var(--navy);
}

.add-cart-btn {
    border: 0;

    background: var(--navy);

    color: var(--yellow);
}

.add-cart-btn:hover {
    background: var(--navy-2);
}

.buy-now-btn {
    width: 100%;

    margin-top: 8px;

    border: 1px solid var(--navy);

    background: var(--yellow);

    color: var(--navy);
}

.buy-now-btn:hover {
    background: var(--yellow-dark);
}


/* =========================================================
   MODALS
   ========================================================= */

.modal {
    position: fixed;
    inset: 0;

    z-index: 5000;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(7, 26, 51, 0.62);

    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-box {
    position: relative;

    width: min(550px, 100%);

    max-height: 90vh;

    overflow-y: auto;

    padding: 30px;

    background: var(--white);

    border-radius: 18px;

    box-shadow:
        0 25px 70px rgba(0,0,0,0.25);

    animation:
        modalIn 0.18s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close {
    position: absolute;

    top: 12px;
    right: 15px;

    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    border: 0;

    background: #f2f4f7;

    color: var(--navy);

    border-radius: 50%;

    font-size: 23px;

    z-index: 5;
}

.close:hover {
    background: var(--navy);
    color: var(--yellow);
}


/* =========================================================
   AUTH
   ========================================================= */

.auth-box {
    width: min(470px, 100%);
}

.auth-box h2 {
    color: var(--navy);

    font-size: 28px;

    margin-bottom: 8px;
}

.auth-box p {
    color: var(--muted);

    margin-bottom: 20px;
}

.auth-box form {
    display: grid;
    gap: 13px;
}

.auth-box input {
    width: 100%;

    height: 47px;

    padding: 0 14px;

    border: 1px solid #d0d5dd;

    border-radius: 9px;

    outline: none;
}

.auth-box input:focus {
    border-color: var(--navy);

    box-shadow:
        0 0 0 3px rgba(7,26,51,0.08);
}

.auth-box button[type="submit"] {
    margin-top: 4px;
}


/* =========================================================
   CART
   ========================================================= */

.cart-box {
    width: min(650px, 100%);
}

.cart-box h2 {
    color: var(--navy);

    font-size: 26px;

    margin-bottom: 20px;
}

#cartItems {
    max-height: 53vh;

    overflow-y: auto;
}

.cart-item {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 13px 0;

    border-bottom:
        1px solid var(--border);
}

.cart-item img {
    width: 70px;
    height: 70px;

    flex-shrink: 0;

    object-fit: cover;

    border-radius: 9px;

    background: #f2f4f7;
}

.cart-item-info {
    flex: 1;

    display: grid;

    gap: 2px;
}

.cart-item-info b {
    color: var(--navy);

    font-size: 14px;
}

.cart-item-info small {
    color: var(--muted);

    font-size: 11px;
}

.cart-item-info strong {
    color: var(--navy);

    font-size: 14px;
}

.cart-qty {
    display: flex;

    align-items: center;

    gap: 5px;
}

.cart-qty button {
    min-width: 28px;
    height: 28px;

    border: 1px solid var(--border);

    background: var(--white);

    border-radius: 6px;

    font-size: 13px;
}

.cart-qty button:hover {
    border-color: var(--navy);
}

.cart-qty .remove-cart {
    margin-left: 5px;

    border: 0;

    color: var(--danger);

    font-size: 11px;
}

#cartTotal {
    color: var(--navy);

    font-size: 24px;
    font-weight: 900;

    margin: 20px 0 15px;

    display: block;
}

#checkoutBtn {
    width: 100%;
}


/* =========================================================
   CHECKOUT
   ========================================================= */

.checkout-box {
    width: min(720px, 100%);
}

.checkout-box h2 {
    color: var(--navy);

    font-size: 27px;

    margin-bottom: 18px;
}

.form-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 14px;
}

.form-grid label {
    display: grid;

    gap: 6px;

    color: #344054;

    font-size: 13px;

    font-weight: 700;
}

.form-grid label:first-child {
    grid-column: 1 / -1;
}

.form-grid input,
.form-grid textarea {
    width: 100%;

    padding: 12px 13px;

    border: 1px solid #d0d5dd;

    border-radius: 9px;

    outline: none;

    background: var(--white);
}

.form-grid textarea {
    min-height: 90px;

    resize: vertical;
}

.form-grid input:focus,
.form-grid textarea:focus {
    border-color: var(--navy);

    box-shadow:
        0 0 0 3px rgba(7,26,51,0.07);
}


/* PAYMENT */

.payment {
    margin-top: 18px;
}

.payment > strong {
    display: block;

    color: var(--navy);

    margin-bottom: 9px;
}

.payment-option {
    display: flex;

    align-items: center;

    gap: 9px;

    padding: 12px;

    margin-bottom: 8px;

    border: 1px solid var(--border);

    border-radius: 9px;

    cursor: pointer;
}

.payment-option:hover {
    border-color: var(--navy);
}

.payment-option input {
    accent-color: var(--navy);
}


/* SUMMARY */

.summary {
    margin: 20px 0;
}


/* =========================================================
   ORDERS
   ========================================================= */

.orders-box {
    width: min(750px, 100%);
}

.orders-box h2 {
    color: var(--navy);

    font-size: 27px;

    margin-bottom: 18px;
}

#ordersList {
    max-height: 65vh;

    overflow-y: auto;
}

.order-card {
    border: 1px solid var(--border);

    background: var(--white);

    border-radius: 14px;

    padding: 16px;

    margin-bottom: 12px;
}

.order-id {
    display: block;

    color: var(--navy);

    font-size: 13px;

    font-weight: 900;

    word-break: break-all;
}

.order-top {
    display: flex;

    justify-content: space-between;

    gap: 15px;
}

.order-status {
    white-space: nowrap;

    height: max-content;

    padding: 5px 10px;

    border-radius: 999px;

    background: #ecfdf3;

    color: var(--success);

    font-size: 11px;

    font-weight: 800;
}


/* =========================================================
   DETAILS
   ========================================================= */

.details-box {
    width: min(900px, 100%);
}

.details-box h2 {
    color: var(--navy);
}

.details-image img {
    width: 100%;

    max-height: 440px;

    object-fit: contain;

    border-radius: 12px;

    background: #f2f4f7;
}

.details-info h2 {
    margin: 10px 0;
}

.details-info p {
    color: var(--muted);

    line-height: 1.7;
}

.details-price {
    color: var(--navy);

    font-size: 30px;

    font-weight: 900;

    margin: 15px 0;
}

.details-price del {
    color: #98a2b3;

    font-size: 14px;

    margin-left: 8px;
}

.details-actions {
    display: flex;

    gap: 10px;

    margin-top: 20px;
}

.details-actions button {
    flex: 1;
}


/* =========================================================
   TOAST
   ========================================================= */

#toast {
    position: fixed;

    z-index: 10000;

    left: 50%;
    bottom: 25px;

    transform:
        translate(-50%, 30px);

    opacity: 0;

    pointer-events: none;

    padding: 12px 18px;

    border-radius: 9px;

    background: var(--navy);

    color: var(--white);

    box-shadow:
        0 12px 30px rgba(0,0,0,0.2);

    font-size: 13px;

    font-weight: 700;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

#toast.show {
    opacity: 1;

    transform:
        translate(-50%, 0);
}


/* =========================================================
   EMPTY STATES
   ========================================================= */

.empty-products,
.empty-cart,
.loading-orders {
    grid-column: 1 / -1;

    text-align: center;

    padding: 45px 20px;

    border:
        1px dashed #d0d5dd;

    border-radius: 14px;

    background: var(--white);
}

.empty-products h3,
.empty-cart h3 {
    color: var(--navy);

    margin-bottom: 7px;
}

.empty-products p,
.empty-cart p {
    color: var(--muted);

    margin-bottom: 18px;
}


/* =========================================================
   FOOTER
   ========================================================= */

footer {
    margin-top: 70px;

    padding: 40px 5%;

    background: var(--navy);

    color: #d0d5dd;

    text-align: center;
}

footer h2 {
    color: var(--white);

    margin-bottom: 8px;
}

footer span,
footer strong {
    color: var(--yellow);
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #eef1f5;
}

::-webkit-scrollbar-thumb {
    background: #b8c0cc;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--navy);
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1000px) {

    .topbar {
        flex-wrap: wrap;

        gap: 12px;
    }

    .brand {
        min-width: auto;
    }

    .search {
        order: 3;

        flex-basis: 100%;

        max-width: none;
    }

    .top-actions {
        margin-left: auto;
    }

    .products-grid,
    .product-list {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .category-list {
        grid-template-columns:
            repeat(2, 1fr);
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .topbar {
        padding: 12px 4%;
    }

    .brand {
        font-size: 23px;
    }

    .top-actions {
        gap: 5px;
    }

    .top-actions button {
        padding: 8px 9px;

        font-size: 12px;
    }

    .nav {
        justify-content: flex-start;

        padding-left: 4%;
        padding-right: 4%;
    }

    .hero {
        width: 92%;

        min-height: 350px;

        padding: 38px 25px;

        border-radius: 17px;
    }

    .hero h1 {
        font-size: 39px;
    }

    .hero p {
        font-size: 15px;
    }

    .section {
        width: 92%;

        margin: 35px auto;
    }

    .section-head {
        align-items: flex-start;

        flex-direction: column;
    }

    .products-grid,
    .product-list {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 12px;
    }

    .product-img,
    .product-image {
        height: 210px;
    }

    .product-body {
        padding: 13px;
    }

    .product-body h3 {
        font-size: 15px;
    }

    .product-price strong {
        font-size: 17px;
    }

    .card-actions {
        grid-template-columns: 1fr;

        gap: 6px;
    }

    .buy-now-btn {
        margin-top: 6px;
    }

    .modal {
        padding: 10px;
    }

    .modal-box {
        padding: 24px 18px;

        border-radius: 15px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid label:first-child {
        grid-column: auto;
    }

    .details-actions {
        flex-direction: column;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 450px) {

    .top-actions button {
        font-size: 0;

        min-width: 40px;

        padding: 8px;
    }

    #accountBtn::before {
        content: "👤";

        font-size: 16px;
    }

    #ordersBtn::before {
        content: "📦";

        font-size: 16px;
    }

    #cartBtn {
        font-size: 0;
    }

    #cartBtn::first-letter {
        font-size: 17px;
    }

    .category-list {
        grid-template-columns: 1fr;
    }

    .products-grid,
    .product-list {
        grid-template-columns: 1fr;
    }

    .product-img,
    .product-image {
        height: 260px;
    }

    .hero h1 {
        font-size: 34px;
    }

    .hero {
        min-height: 330px;

        padding: 30px 21px;
    }

    .cart-item {
        align-items: flex-start;

        flex-wrap: wrap;
    }

    .cart-qty {
        width: 100%;

        justify-content: flex-end;
    }

}