/* =============================================
   YSFCart — Core Styles
   ============================================= */

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

/* ---------- Root Variables ---------- */
:root {
    --primary: rgb(92, 156, 205);
    --primary-dark: rgb(60, 120, 170);
    --secondary: rgba(15, 10, 29, 0.849);
    --light: #2f3640;
    --text-muted: gray;
    --white: #ffffff;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --transition: 0.3s ease-in-out;
}

/* ---------- Base ---------- */
body {
    font-family: "Roboto", sans-serif;
    font-weight: 300;
    font-style: normal;
    color: #222;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* =============================================
   HEADER
   ============================================= */
header {
    width: 100%;
}

/* ---------- NAV 1 — Topbar ---------- */
.nav1 {
    width: 100%;
    height: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    background: #fff;
    z-index: 10;
    position: relative;
}

.nav1 .left {
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 1.5px;
    font-size: 0.85rem;
}

.nav1 .left a {
    color: var(--primary);
    font-weight: 600;
    transition: color var(--transition);
}

.nav1 .left a:hover {
    color: var(--primary-dark);
}

.nav1 .right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav1 .right i {
    font-size: 16px;
    background-color: var(--primary);
    color: var(--white);
    padding: 7px;
    cursor: pointer;
    border-radius: 3px;
    transition: transform 0.5s ease-out, background-color var(--transition);
}

.nav1 .right i:hover {
    transform: rotate(360deg);
    background-color: var(--primary-dark);
}

/* ---------- NAV 2 — Brand bar ---------- */
.nav2 {
    width: 100%;
    height: 90px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    border-bottom: 1px solid #f0f0f0;
}

.nav2 .nav2-left,
.nav2 .nav2-center,
.nav2 .nav2-right {
    flex: 1;
    text-align: center;
    cursor: pointer;
}

.nav2 .nav2-left {
    text-align: left;
    font-size: 0.9rem;
}

.nav2 .nav2-left i {
    margin-right: 8px;
    color: var(--primary);
}

.nav2 .nav2-center h1 {
    color: var(--primary);
    font-size: 2rem;
    letter-spacing: 5px;
    font-weight: 800;
    line-height: 1.1;
}

.nav2 .nav2-center h1 span {
    color: var(--secondary);
}

.nav2 .nav2-center p {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 4px;
    letter-spacing: 1px;
}

.nav2 .nav2-right {
    text-align: right;
    font-size: 0.9rem;
}

.nav2 .nav2-right i {
    margin-right: 6px;
    color: var(--primary);
}

/* ---------- NAV 3 — Main navigation ---------- */
.nav3 {
    width: 100%;
    height: 52px;
    background: #fff;
    border-bottom: 2px solid var(--primary);
    position: relative;
}

.nav3 ul {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    gap: 0;
}

.nav3 ul > li {
    position: relative;
    height: 52px;
    display: flex;
    align-items: center;
}

.nav3 ul > li > a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 18px;
    height: 100%;
    font-weight: 500;
    font-size: 0.9rem;
    color: #333;
    transition: color var(--transition), background var(--transition);
}

.nav3 ul > li > a:hover,
.nav3 ul > li > a.active {
    color: var(--primary);
    background: rgba(92, 156, 205, 0.06);
}

.nav3 ul > li > a i {
    color: var(--primary);
    font-size: 0.85rem;
}

/* Dropdown */
.nav3 ul > li > ul {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    min-width: 150px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-top: 2px solid var(--primary);
    z-index: 100;
}

.nav3 ul > li > ul li {
    border-bottom: 1px solid #f0f0f0;
}

.nav3 ul > li > ul li a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 0.88rem;
    color: #444;
    transition: color var(--transition), background var(--transition);
}

.nav3 ul > li > ul li a:hover {
    color: var(--primary);
    background: #f8f8f8;
}

.nav3 ul > li:hover > ul {
    display: block;
}

/* ---------- Mobile Sidenav ---------- */
#sidenav {
    display: none;
    width: 0;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    background-color: var(--light);
    padding-top: 70px;
    overflow: hidden;
    transition: width 0.4s ease-in-out;
}

#sidenav.open {
    width: 260px;
}

#sidenav ul li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

#sidenav ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    color: #ddd;
    font-size: 0.95rem;
    font-weight: 400;
    transition: color var(--transition), background var(--transition);
}

#sidenav ul li a:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

#sidenav ul li a i {
    color: var(--primary);
    width: 18px;
    text-align: center;
}

/* Sidenav sub-menu */
#sidenav .sub-menu {
    display: none;
    background: rgba(0, 0, 0, 0.2);
}

#sidenav .sub-menu li a {
    padding-left: 52px;
    font-size: 0.88rem;
}

#sidenav li.has-sub > a .caret {
    margin-left: auto;
    transition: transform var(--transition);
}

#sidenav li.has-sub.open > a .caret {
    transform: rotate(180deg);
}

#sidenav li.has-sub.open > .sub-menu {
    display: block;
}

/* Close overlay */
#sidenav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(0, 0, 0, 0.4);
}

#sidenav-overlay.active {
    display: block;
}

/* Hamburger */
#menubar {
    display: none;
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 300;
    background-color: var(--primary);
    color: var(--white);
    font-size: 1.4rem;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: var(--card-shadow);
    transition: background-color var(--transition);
}

#menubar:hover {
    background-color: var(--primary-dark);
}

/* =============================================
   HERO / FEATURED SECTION
   ============================================= */
.featured {
    width: 100%;
    height: 65vh;
    min-height: 380px;
    background:
        linear-gradient(to right, rgba(0, 0, 0, 0.85) 25%, rgba(0, 0, 0, 0.1)),
        url('../images/g1.jpg') center/cover no-repeat;
    position: relative;
    display: flex;
    align-items: center;
}

.featured-text {
    max-width: 480px;
    margin-left: 8%;
    color: var(--white);
    padding: 20px;
    font-family: "Akaya Kanadaka", system-ui;
}

.featured-text h2 {
    font-size: 2.4rem;
    letter-spacing: 4px;
    margin-bottom: 16px;
    line-height: 1.2;
}

.featured-text button {
    padding: 12px 28px;
    border: none;
    outline: none;
    background-color: var(--primary);
    color: var(--white);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 2px;
    border-radius: 3px;
    transition: background-color var(--transition), transform var(--transition);
    display: block;
    margin-bottom: 16px;
}

.featured-text button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* =============================================
   PRODUCTS SECTION
   ============================================= */
.latest {
    padding: 60px 50px;
}

.product-intro {
    text-align: center;
    margin-bottom: 10px;
}

.product-intro h1 {
    color: var(--primary);
    letter-spacing: 0.2rem;
    font-size: 2rem;
    font-weight: 800;
}

.product-intro h1 span {
    color: var(--secondary);
}

.product-intro p {
    color: var(--text-muted);
    margin: 12px 0 0;
    font-size: 0.95rem;
    max-width: 600px;
    margin-inline: auto;
    line-height: 1.6;
}

/* ---------- Card Grid ---------- */
.card-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 24px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.card-container .card {
    flex: 0 1 220px;
    padding: 16px;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    text-align: center;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.13);
}

.card .card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 12px;
}

.card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease-in-out;
}

.card:hover .card-img img {
    transform: scale(1.07);
}

.card h2 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    transition: color var(--transition);
}

.card:hover h2 {
    color: var(--primary);
}

.card .card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.card .card-stars i {
    color: goldenrod;
    font-size: 0.8rem;
}

.card .card-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 8px 0;
}

.card .btn-cart {
    display: inline-block;
    width: 100%;
    padding: 8px 0;
    background-color: var(--secondary);
    color: var(--white);
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 4px;
    transition: background-color var(--transition), transform var(--transition);
    letter-spacing: 0.5px;
}

.card .btn-cart:hover {
    background-color: var(--primary);
    transform: scale(1.02);
}

/* Discount badge */
.card .badge {
    position: absolute;
    top: 10px;
    left: -6px;
    background-color: #e74c3c;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    transform: rotate(-20deg);
    transform-origin: left center;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
    border-radius: 2px;
}

/* =============================================
   TRENDS / SWIPER SECTION
   ============================================= */
.trends {
    padding: 60px 80px;
    background-color: rgba(0, 0, 0, 0.02);
}

.trends .swiper {
    width: 100%;
    padding: 40px 10px;
}

.trends .swiper-slide {
    background-position: center;
    background-size: cover;
    width: 380px;
    height: 380px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.trends .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =============================================
   FOOTER
   ============================================= */
footer {
    background-color: var(--secondary);
    color: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    flex-wrap: wrap;
    text-align: center;
    padding: 3rem 2rem;
    gap: 20px;
}

footer .footer-col {
    flex: 1;
    min-width: 180px;
}

footer h2 {
    letter-spacing: 0.4rem;
    font-size: 1.4rem;
    margin-bottom: 10px;
}

footer h2 span {
    color: var(--primary);
}

footer p {
    font-size: 0.88rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
}

footer .social-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

footer .social-icons i {
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

footer .social-icons i:hover {
    background: var(--primary);
    color: white;
}

footer .footer-links a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.88rem;
    margin: 5px 0;
    transition: color var(--transition);
}

footer .footer-links a:hover {
    color: var(--primary);
}

footer .footer-bottom {
    width: 100%;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* =============================================
   INNER PAGE STYLES (used by pages/*.html)
   ============================================= */
.page-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--light) 100%);
    color: white;
    text-align: center;
    padding: 60px 20px 40px;
}

.page-hero h1 {
    font-size: 2.2rem;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.page-hero p {
    font-size: 1rem;
    opacity: 0.85;
}

.page-content {
    padding: 60px 40px;
    max-width: 1100px;
    margin: 0 auto;
}

/* Auth Forms (login / register) */
.auth-wrapper {
    min-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f5f7fa;
    padding: 40px 20px;
}

.auth-card {
    background: #fff;
    padding: 40px 36px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
}

.auth-card h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 6px;
    text-align: center;
}

.auth-card .auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 28px;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(92, 156, 205, 0.15);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 1px;
    transition: background var(--transition), transform var(--transition);
    margin-top: 8px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.auth-switch {
    text-align: center;
    margin-top: 18px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--primary);
    font-weight: 600;
}

/* Cart page */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.cart-table th {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.cart-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    vertical-align: middle;
}

.cart-table tr:hover td {
    background: #fafafa;
}

.cart-table img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.cart-summary {
    text-align: right;
    padding: 20px 0;
    border-top: 2px solid var(--primary);
}

.cart-summary .total {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 16px;
}

/* Contact page */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.contact-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 16px;
}

.contact-info .info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #555;
}

.contact-info .info-item i {
    color: var(--primary);
    font-size: 1rem;
    margin-top: 2px;
}

.contact-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: border-color var(--transition);
    outline: none;
}

.contact-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(92, 156, 205, 0.15);
}
