
/* ==========================================
   TINY WONDERS - PREMIUM WEBSITE THEME
   Midnight Navy + Royal Purple + Warm Gold
========================================== */

/* ---------- COLOUR VARIABLES ---------- */

:root {
    --bg: #101827;
    --panel: #1B263B;
    --card: #211A38;
    --border: #35415A;
    --text: #F8FAFC;
    --muted: #B8C4D9;
    --gold: #F5B942;
    --green: #22C55E;
    --purple: #8B5CF6;
    --navy: #0B1220;
    --white: #FFFFFF;
    --danger: #EF4444;
}

/* ---------- GLOBAL ---------- */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
    line-height: 1.6;
}

img {
    max-width: 100%;
}

a {
    transition: color 0.2s ease, background 0.2s ease;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

::selection {
    background: var(--purple);
    color: white;
}

/* ---------- NAVBAR ---------- */

.site-nav {
    min-height: 100px;
    padding: 0 4%;
    display: flex;
    align-items: center;
    gap: 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(110deg, #0B1220, #211A38);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    min-width: 180px;
}

.brand-book {
    font-size: 42px;
    color: var(--gold);
}

.brand b {
    font-size: 28px;
}

.brand i {
    color: var(--gold);
    font-style: normal;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.brand-logo {
    width: 150px;
    height: auto;
    max-height: 80px;
    display: block;
    object-fit: contain;
}

/* ---------- NAVIGATION LINKS ---------- */

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

.site-nav nav a,
.footer a {
    color: #E2E8F0;
    text-decoration: none;
}

.site-nav nav a:hover,
.footer a:hover {
    color: var(--gold);
}

/* ---------- SEARCH BAR ---------- */

.search {
    flex: 1;
    display: flex;
    background: #202B40;
    border: 1px solid #414D65;
    border-radius: 30px;
    overflow: hidden;
    max-width: 520px;
}

.search input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: 0;
    color: white;
    padding: 14px 18px;
    font-size: 16px;
}

.search input::placeholder {
    color: #A9B5C9;
}

.search button {
    border: 0;
    background: transparent;
    color: var(--gold);
    font-size: 25px;
    padding: 0 18px;
}

.search button:hover {
    color: white;
}

/* ---------- NAVBAR ICONS ---------- */

.wa,
.nav-user {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    text-decoration: none;
}

.wa {
    color: var(--green);
    font-size: 29px;
}

.nav-user {
    color: white;
    font-size: 31px;
}

.nav-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
    transition: transform 0.2s ease;
}

.whatsapp-icon {
    width: 27px;
    height: 27px;
}

.profile-icon {
    width: 29px;
    height: 29px;
}

.wa:hover .whatsapp-icon,
.nav-user:hover .profile-icon {
    transform: scale(1.1);
}

/* ---------- CART ICON ---------- */

.nav-cart {
    position: relative;
    color: white;
    text-decoration: none;
    font-size: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
}

.nav-cart:hover {
    color: var(--gold);
}

.cart-count {
    position: absolute;
    right: -4px;
    top: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--gold);
    color: #171323;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
}

/* ---------- HAMBURGER / MOBILE MENU ---------- */

.menu {
    background: transparent;
    border: 0;
    color: white;
    font-size: 30px;
}

.mobile-nav {
    display: none;
    background: #172235;
    padding: 15px;
    gap: 10px;
    flex-direction: column;
    border-bottom: 1px solid var(--border);
}

.mobile-nav.show,
.mobile-nav.open {
    display: flex;
}

.mobile-nav a {
    color: white;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
}

.mobile-nav a:hover {
    background: #30264D;
    color: var(--gold);
}

/* ---------- MAIN CONTAINER ---------- */

.container {
    width: min(1400px, calc(100% - 60px));
    margin: 30px auto;
}

/* ---------- ALERT MESSAGES ---------- */

.alert {
    position: fixed;
    right: 20px;
    top: 115px;
    padding: 15px 20px;
    border-radius: 10px;
    z-index: 30;
    box-shadow: 0 8px 25px #00000040;
}

.success {
    background: #14532D;
    color: #DCFCE7;
    border: 1px solid #22C55E;
}

.error {
    background: #7F1D1D;
    color: #FEE2E2;
    border: 1px solid #EF4444;
}

/* ---------- DASHBOARD ---------- */

.dashboard {
    display: grid;
    grid-template-columns: 330px 1fr;
    gap: 25px;
}

/* ---------- PANELS ---------- */

.panel {
    background: linear-gradient(145deg, #1B263B, #151D30);
    border: 1px solid var(--border);
    border-radius: 17px;
    padding: 25px;
}

/* ---------- CATEGORIES ---------- */

.categories a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.categories a.active,
.categories a:hover {
    background: #30264D;
    border-left: 5px solid var(--gold);
    color: #FFD978;
}

/* ---------- CUSTOMIZED / REGULAR BOOK CHOICES ---------- */

.choice {
    display: grid;
    gap: 22px;
}

.choice-card {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 35px;
    padding: 20px;
    border: 1px solid #493A70;
    border-radius: 18px;
    background: linear-gradient(115deg, #211A38, #172235);
    align-items: center;
}

.choice-card > img,
.book-img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 13px;
    background: #25334A;
}

/* Homepage promotional artwork keeps its original layout and proportions. */
.hero-img,
.choice-card .book-img img,
.index-feature-image {
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
}

.choice-card h2 {
    font-size: 32px;
    line-height: 1.3;
}

.choice-card p,
.muted {
    color: var(--muted);
    line-height: 1.7;
}

/* ---------- BUTTONS ---------- */

.btn {
    display: inline-block;
    padding: 13px 23px;
    border-radius: 28px;
    background: linear-gradient(100deg, #F5B942, #FFD978);
    color: #171323;
    text-decoration: none;
    border: 1px solid var(--gold);
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px #F5B94235;
}

.btn.outline {
    background: transparent;
    color: var(--gold);
    border-color: var(--gold);
}

.btn.outline:hover {
    background: var(--gold);
    color: #171323;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--purple);
    outline-offset: 3px;
}

/* ---------- PRODUCT GRID ---------- */

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

/* ---------- PRODUCT CARDS ---------- */

.book-card {
    background: #1B263B;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.book-card:hover {
    transform: translateY(-5px);
    border-color: var(--purple);
}

.book-card .body {
    padding: 17px;
}

.book-card h3 {
    margin: 8px 0;
    color: #F8FAFC;
}

.book-card p {
    color: var(--muted);
}

.book-image-link {
    display: block;
    text-decoration: none;
}

.book-img {
    display: block;
    aspect-ratio: 3 / 4;
    height: auto;
    object-fit: cover;
}

.book-placeholder {
    display: grid !important;
    place-items: center;
    font-size: 65px;
    background: #25334A;
}

/* ---------- BOOK ACTIONS ---------- */

.book-actions {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-cart {
    margin: 0;
}

/* ---------- PRODUCT PRICES ---------- */

.price {
    color: #FFD166;
    font-size: 21px;
    font-weight: 800;
}

.old {
    text-decoration: line-through;
    color: #94A3B8;
    margin-left: 7px;
    font-size: 14px;
}

/* ---------- PRODUCT TAGS ---------- */

.tag {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    background: #30264D;
    color: #D8C7FF;
    border: 1px solid #493A70;
    font-size: 12px;
}

.pill {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 20px;
    background: #30264D;
    color: #FFD166;
    border: 1px solid #493A70;
}

/* ---------- FORMS ---------- */

.form-card {
    max-width: 700px;
    margin: auto;
    background: linear-gradient(145deg, #1B263B, #151D30);
    border: 1px solid var(--border);
    border-radius: 17px;
    padding: 28px;
}

.form-card label {
    display: block;
    margin: 14px 0 7px;
    color: #E2E8F0;
    font-weight: 600;
}

.form-card input,
.form-card textarea,
.form-card select {
    width: 100%;
    padding: 13px;
    border: 1px solid #414D65;
    border-radius: 9px;
    background: #101827;
    color: white;
    transition: border-color 0.2s ease;
}

.form-card input::placeholder,
.form-card textarea::placeholder {
    color: #94A3B8;
}

.form-card input:focus,
.form-card textarea:focus,
.form-card select:focus {
    outline: 2px solid var(--purple);
    border-color: var(--purple);
}

.form-card select option {
    background: #172235;
    color: white;
}

.form-card textarea {
    min-height: 120px;
    resize: vertical;
}

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

/* ---------- TABLES ---------- */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #172235;
}

.table th,
.table td {
    padding: 13px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.table th {
    background: #30264D;
    color: #FFD978;
    font-weight: 700;
}

.table td {
    color: #E2E8F0;
}

.table tr:hover td {
    background: #202B40;
}

/* ---------- CART ITEMS ---------- */

.cart-item {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 18px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.cart-item img {
    width: 90px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    background: #25334A;
}

.summary {
    background: linear-gradient(145deg, #1B263B, #151D30);
    border: 1px solid var(--border);
    padding: 22px;
    border-radius: 15px;
}

.two {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 25px;
}

/* ---------- BOOK DETAILS ---------- */

.book-detail-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 13px;
    background: #25334A;
    display: block;
}

.book-detail-placeholder {
    height: 500px !important;
    display: grid !important;
    place-items: center;
    font-size: 120px;
    background: #25334A;
}

/* ---------- FOOTER ---------- */

.footer {
    margin-top: 50px;
    padding: 30px 5%;
    display: flex;
    justify-content: space-between;
    gap: 30px;
    background: #0B1220;
    border-top: 1px solid var(--border);
    color: #CBD5E1;
}

.footer span {
    color: var(--gold);
}

.footer a {
    margin-right: 16px;
}

.footer img {
    max-width: 150px;
    height: auto;
    object-fit: contain;
}

/* ---------- EMPTY STATES ---------- */

.empty {
    text-align: center;
    padding: 50px;
    color: var(--muted);
}

/* ---------- HERO SECTION ---------- */

.hero {
    padding: 35px;
    background: linear-gradient(120deg, #211A38, #172235, #101827);
    border: 1px solid #493A70;
    border-radius: 18px;
    margin-bottom: 25px;
}

.hero h1 {
    font-size: 42px;
    line-height: 1.2;
    margin: 5px 0 15px;
}

.hero p {
    color: var(--muted);
}

/* ---------- SECTION TITLES ---------- */

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

h1,
h2,
h3,
h4 {
    color: #F8FAFC;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
}

/* ---------- MARQUEE ---------- */

.site-marquee {
    width: 100%;
    background: linear-gradient(90deg, #211A38, #101827, #211A38);
    border-bottom: 1px solid #493A70;
    color: #FFD166;
    font-weight: 700;
    font-size: 15px;
    line-height: 42px;
    height: 42px;
    overflow: hidden;
}

.site-marquee marquee {
    display: block;
    width: 100%;
    height: 42px;
    line-height: 42px;
    padding: 0 12px;
}

.site-marquee:hover {
    background: #30264D;
}

/* ---------- SCROLLBARS ---------- */

* {
    scrollbar-color: #493A70 #101827;
    scrollbar-width: thin;
}

/* ==========================================
   RESPONSIVE TABLET DESIGN
========================================== */

@media (max-width: 1000px) {

    .site-nav nav {
        display: none;
    }

    .dashboard,
    .two {
        grid-template-columns: 1fr;
    }

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

    .choice-card {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .brand {
        min-width: 0;
    }

    .search {
        max-width: none;
    }
}

/* ==========================================
   RESPONSIVE MOBILE DESIGN
========================================== */

@media (max-width: 800px) {

    .site-nav {
        gap: 12px;
    }

    .brand {
        min-width: 0;
    }

    .site-nav nav,
    .search {
        display: none;
    }

    .nav-cart {
        font-size: 25px;
    }

    .book-actions .btn {
        text-align: center;
    }

    .book-detail-image {
        height: 360px;
    }
}

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

@media (max-width: 650px) {

    .site-nav {
        min-height: 75px;
        height: auto;
        padding: 10px 15px;
        gap: 10px;
    }

    .brand b {
        font-size: 21px;
    }

    .brand-book {
        font-size: 34px;
    }

    .brand-logo {
        width: 125px;
        max-height: 60px;
    }

    .brand small {
        display: none;
    }

    .wa {
        display: none;
    }

    .nav-icon {
        width: 25px;
        height: 25px;
    }

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

    .profile-icon {
        width: 26px;
        height: 26px;
    }

    .container {
        width: calc(100% - 20px);
        margin: 18px auto;
    }

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

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

    .footer {
        flex-direction: column;
        padding: 25px 20px;
    }

    .choice-card {
        padding: 15px;
    }

    .choice-card h2 {
        font-size: 25px;
    }

    .hero {
        padding: 22px;
    }

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

    .panel,
    .form-card {
        padding: 18px;
    }

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

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

    .book-detail-image {
        height: 280px;
    }

    .book-detail-placeholder {
        height: 280px !important;
        font-size: 80px;
    }

    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-marquee {
        height: 38px;
        line-height: 38px;
        font-size: 13px;
    }

    .site-marquee marquee {
        height: 38px;
        line-height: 38px;
    }

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


/* Product covers use the requested 960 × 1280 (3:4) portrait ratio. */
img.book-img,
.book-card img.book-img,
.book-image-link img,
.cart-item img {
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

/* Keep homepage hero/feature artwork independent of product sizing. */
.hero-img,
body.home-page .index-feature-image {
    aspect-ratio: auto;
    height: auto;
    object-fit: contain;
}

@media (max-width: 650px) {
    .wa {
        display: flex !important;
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
    }
    .whatsapp-icon {
        width: 23px;
        height: 23px;
    }
}

/* Index page promotional images are not product covers. */
body.home-page .book-img { aspect-ratio: auto; height: auto; }
body.home-page .book-img img { width: 100%; height: auto; object-fit: contain; }

/* Enforce portrait product display (3:4), equivalent to 960 × 1280. */
.book-detail-image { height: auto !important; aspect-ratio: 3 / 4; object-fit: cover; }
.cart-item img { height: auto; aspect-ratio: 3 / 4; }
body.home-page .book-img { aspect-ratio: auto; height: auto; }
