:root {
    --brand-primary: #5CC2A7;
    --brand-primary-dark: #43A88E;
    --brand-dark: #3A3A3A;
    --brand-black: #1F2524;
    --brand-light: #F4FFFB;
    --brand-soft: #E8F8F3;
    --brand-border: rgba(58, 58, 58, 0.12);
    --brand-text: #2F3433;
    --brand-muted: #6F7C78;
    --brand-white: #FFFFFF;
    --brand-teal: #2E7D6D;
    --brand-shadow: rgba(31, 37, 36, 0.09);
    --brand-glow: rgba(92, 194, 167, 0.22);
}

* {
    box-sizing: border-box;
}

html,
body,
button,
input,
textarea,
select,
a,
span,
div,
p,
label,
table,
th,
td,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Cairo', sans-serif !important;
}

body {
    margin: 0;
    background: #f3f3f3;
    color: var(--brand-text);
}

.public-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.public-header {
    background: var(--brand-dark);
    color: var(--brand-white);
    padding: 16px 0;
    box-shadow: 0 4px 18px rgba(31, 37, 36, 0.16);
}

.public-header-container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 18px;
    display: grid;
    grid-template-columns: 300px minmax(240px, 1fr) 118px;
    gap: 24px;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--brand-white);
}

.header-brand:hover {
    color: var(--brand-white);
}

.logo-frame {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    background: var(--brand-white);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(92, 194, 167, 0.34);
    box-shadow: 0 8px 22px rgba(31, 37, 36, 0.12);
}

.logo-frame.logo-fallback::before {
    content: "I";
    color: var(--brand-dark);
    font-size: 28px;
    font-weight: 800;
}

.site-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.site-name {
    font-size: 22px;
    font-weight: 800;
    white-space: nowrap;
}

.header-search {
    display: flex;
    background: var(--brand-white);
    border-radius: 999px;
    overflow: hidden;
    border: 2px solid rgba(92, 194, 167, 0.35);
}

.header-search-wrapper {
    position: relative;
    width: 100%;
}

.header-search input {
    border: 0;
    outline: 0;
    flex: 1;
    padding: 13px 20px;
    font-size: 15px;
    min-width: 0;
    color: var(--brand-text);
}

.header-search input::placeholder {
    color: var(--brand-muted);
}

.header-search button {
    border: 0;
    background: var(--brand-primary);
    color: var(--brand-white);
    padding: 0 26px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s ease;
}

.header-search button:hover {
    background: var(--brand-primary-dark);
}

.public-search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    background: var(--brand-white, #fff);
    border: 1px solid rgba(92, 194, 167, 0.25);
    border-radius: 8px;
    box-shadow: 0 14px 35px rgba(58, 58, 58, 0.16);
    overflow: hidden;
    z-index: 9999;
    display: none;
    max-height: 360px;
    overflow-y: auto;
}

.public-search-results.show {
    display: block;
}

.public-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    text-decoration: none;
    color: var(--brand-dark, #3A3A3A);
    border-bottom: 1px solid rgba(58, 58, 58, 0.08);
    transition: 0.18s ease;
}

.public-search-item:last-child {
    border-bottom: none;
}

.public-search-item:hover {
    background: var(--brand-soft, #E8F8F3);
}

.public-search-thumb-wrap {
    width: 46px;
    height: 62px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--brand-soft, #E8F8F3);
    flex-shrink: 0;
    border: 1px solid rgba(92, 194, 167, 0.20);
}

.public-search-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.public-search-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, var(--brand-soft, #E8F8F3), #ffffff);
    font-size: 22px;
}

.public-search-text {
    flex: 1;
    min-width: 0;
}

.public-search-book-title {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: var(--brand-dark, #3A3A3A);
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.public-search-author-name {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-muted, #6F7C78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.public-search-empty,
.public-search-loading {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--brand-muted, #6F7C78);
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.user-panel-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 22px;
    transition: 0.2s ease;
    flex: 0 0 auto;
}

.user-panel-link:hover {
    transform: translateY(-2px);
    background: var(--brand-primary);
    color: var(--brand-white);
}

.public-cart-btn {
    position: relative;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--brand-soft, #E8F8F3);
    color: var(--brand-dark, #3A3A3A);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s ease;
    flex: 0 0 auto;
}

.public-cart-btn:hover {
    background: var(--brand-primary, #5CC2A7);
    color: #fff;
    transform: translateY(-2px);
}

.cart-icon {
    font-size: 21px;
    line-height: 1;
}

.cart-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    min-width: 21px;
    height: 21px;
    border-radius: 999px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid #fff;
}

.public-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(31, 37, 36, 0.48);
    z-index: 9997;
    opacity: 0;
    pointer-events: none;
    transition: 0.25s ease;
}

.public-cart-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.public-cart-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: min(460px, 94vw);
    height: 100vh;
    background: #fff;
    z-index: 9998;
    transform: translateX(-105%);
    transition: 0.28s ease;
    box-shadow: 18px 0 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    font-family: 'Cairo', sans-serif;
}

.public-cart-drawer.show {
    transform: translateX(0);
}

.cart-drawer-header {
    padding: 20px;
    border-bottom: 1px solid rgba(58, 58, 58, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.cart-small-badge {
    display: inline-block;
    background: rgba(92, 194, 167, 0.16);
    color: var(--brand-primary-dark, #43A88E);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 7px;
}

.cart-drawer-header h3 {
    margin: 0;
    color: var(--brand-dark, #3A3A3A);
    font-size: 24px;
    font-weight: 900;
}

.cart-close-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 12px;
    background: var(--brand-soft, #E8F8F3);
    color: var(--brand-dark, #3A3A3A);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}

.cart-close-btn:hover {
    background: var(--brand-primary, #5CC2A7);
    color: #fff;
}

.cart-drawer-body {
    padding: 18px;
    overflow-y: auto;
    flex: 1;
}

.cart-items-container {
    display: grid;
    gap: 12px;
}

.cart-item {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 12px;
    border: 1px solid rgba(92, 194, 167, 0.18);
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(58, 58, 58, 0.06);
}

.cart-item-img-wrap {
    width: 64px;
    height: 86px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--brand-soft, #E8F8F3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.cart-item-placeholder {
    font-size: 26px;
}

.cart-item-info h4 {
    margin: 0 0 6px;
    color: var(--brand-dark, #3A3A3A);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.5;
}

.cart-item-price {
    color: var(--brand-primary-dark, #43A88E);
    font-size: 14px;
    font-weight: 900;
    margin-bottom: 8px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.cart-qty-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand-soft, #E8F8F3);
    border-radius: 999px;
    padding: 4px 8px;
}

.cart-qty-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: var(--brand-dark, #3A3A3A);
    font-weight: 900;
    cursor: pointer;
}

.cart-qty-value {
    min-width: 20px;
    text-align: center;
    font-weight: 900;
    color: var(--brand-dark, #3A3A3A);
}

.cart-remove-btn {
    border: none;
    background: rgba(231, 76, 60, 0.10);
    color: #c0392b;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.cart-summary-box {
    margin-top: 16px;
    background: var(--brand-soft, #E8F8F3);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid rgba(92, 194, 167, 0.20);
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    color: var(--brand-dark, #3A3A3A);
    font-weight: 800;
}

.cart-total-row strong {
    color: var(--brand-primary-dark, #43A88E);
    font-size: 18px;
    font-weight: 900;
    white-space: nowrap;
}

.cart-proceed-btn,
.cart-save-btn {
    width: 100%;
    border: none;
    background: var(--brand-primary, #5CC2A7);
    color: #fff;
    border-radius: 8px;
    padding: 13px 18px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.2s ease;
}

.cart-proceed-btn:hover,
.cart-save-btn:hover {
    background: var(--brand-primary-dark, #43A88E);
    transform: translateY(-1px);
}

.cart-empty-state {
    text-align: center;
    padding: 46px 16px;
    color: var(--brand-muted, #6F7C78);
}

.cart-empty-icon {
    font-size: 54px;
    margin-bottom: 12px;
}

.cart-empty-state h4 {
    color: var(--brand-dark, #3A3A3A);
    font-weight: 900;
    margin-bottom: 8px;
}

.cart-checkout-form {
    margin-top: 16px;
    border-top: 1px solid rgba(58, 58, 58, 0.08);
    padding-top: 18px;
}

.cart-checkout-form h4 {
    color: var(--brand-dark, #3A3A3A);
    font-weight: 900;
    margin-bottom: 16px;
}

.cart-form-group {
    margin-bottom: 13px;
}

.cart-form-group label {
    display: block;
    color: var(--brand-dark, #3A3A3A);
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 6px;
}

.cart-form-group input,
.cart-form-group textarea {
    width: 100%;
    border: 1px solid rgba(92, 194, 167, 0.24);
    border-radius: 8px;
    padding: 11px 12px;
    outline: none;
    font-family: 'Cairo', sans-serif;
}

.cart-form-group input:focus,
.cart-form-group textarea:focus {
    border-color: var(--brand-primary, #5CC2A7);
    box-shadow: 0 0 0 4px rgba(92, 194, 167, 0.12);
}

.cart-field-error {
    display: block;
    color: #c0392b;
    font-size: 12px;
    font-weight: 800;
    margin-top: 5px;
}

.cart-checkout-actions {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 10px;
    margin-top: 14px;
}

.cart-back-btn {
    border: none;
    background: var(--brand-soft, #E8F8F3);
    color: var(--brand-dark, #3A3A3A);
    border-radius: 8px;
    padding: 13px 18px;
    font-weight: 900;
    cursor: pointer;
}

.cart-success-message {
    text-align: center;
    background: #F9FFFC;
    border: 1px solid rgba(92, 194, 167, 0.22);
    border-radius: 8px;
    padding: 30px 18px;
    margin-top: 16px;
}

.cart-success-message .success-icon {
    width: 54px;
    height: 54px;
    background: var(--brand-primary, #5CC2A7);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
    font-weight: 900;
}

.cart-success-message h4 {
    color: var(--brand-dark, #3A3A3A);
    font-weight: 900;
}

.cart-success-message p {
    color: var(--brand-muted, #6F7C78);
}

.public-cart-toast {
    position: fixed;
    top: 110px;
    left: 24px;
    background: var(--brand-dark, #3A3A3A);
    color: #fff;
    padding: 13px 20px;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    font-weight: 900;
    z-index: 10000;
    opacity: 0;
    transform: translateY(-12px);
    pointer-events: none;
    transition: 0.25s ease;
}

.public-cart-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.pages-bar {
    background: var(--brand-soft);
    border-bottom: 1px solid var(--brand-border);
    padding: 0;
    overflow-x: auto;
}

.public-nav-container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 18px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.pages-bar a {
    color: var(--brand-dark);
    text-decoration: none;
    padding: 15px 18px;
    font-weight: 700;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: 0.2s ease;
}

.pages-bar a:hover {
    color: var(--brand-primary-dark);
    border-bottom-color: var(--brand-primary);
    background: rgba(255, 255, 255, 0.62);
}

.public-main {
    flex: 1;
    width: 100%;
    background: #f3f3f3;
}

.public-page-container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 18px;
}

.public-white-page {
    background: #ffffff !important;
    margin-inline: -18px;
    padding-inline: 18px !important;
}

.hero-section {
    margin: 34px 0 0;
    padding: 54px 42px;
    background:
        radial-gradient(circle at top left, rgba(92, 194, 167, 0.22), transparent 35%),
        linear-gradient(135deg, var(--brand-light) 0%, var(--brand-soft) 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
    gap: 48px;
    align-items: center;
    overflow: hidden;
}

.hero-badge {
    display: inline-block;
    background: rgba(92, 194, 167, 0.18);
    color: var(--brand-primary-dark);
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 800;
    margin-bottom: 18px;
}

.hero-content h1 {
    font-size: 46px;
    line-height: 1.35;
    color: var(--brand-dark);
    font-weight: 800;
    margin: 0 0 20px;
    max-width: 760px;
}

.hero-content p {
    font-size: 18px;
    color: var(--brand-muted);
    line-height: 1.9;
    max-width: 700px;
    margin: 0;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.btn-main,
.btn-secondary {
    padding: 13px 24px;
    border-radius: 8px;
    font-weight: 800;
    text-decoration: none;
    transition: 0.2s ease;
}

.btn-main {
    background: var(--brand-primary);
    color: var(--brand-white);
    box-shadow: 0 10px 24px rgba(92, 194, 167, 0.3);
}

.btn-main:hover {
    background: var(--brand-primary-dark);
    color: var(--brand-white);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--brand-white);
    color: var(--brand-dark);
    border: 1px solid rgba(92, 194, 167, 0.35);
}

.btn-secondary:hover {
    color: var(--brand-dark);
    border-color: var(--brand-primary);
    box-shadow: 0 10px 22px var(--brand-glow);
    transform: translateY(-2px);
}

.hero-visual {
    min-height: 380px;
    position: relative;
}

.book-stack {
    position: relative;
    width: min(100%, 440px);
    height: 380px;
    margin-inline: auto;
}

.book-card {
    position: absolute;
    width: 170px;
    height: 230px;
    border-radius: 8px 18px 18px 8px;
    color: var(--brand-white);
    font-weight: 800;
    font-size: 22px;
    display: flex;
    align-items: flex-end;
    padding: 22px;
    box-shadow: 0 18px 40px rgba(31, 37, 36, 0.22);
    overflow: hidden;
}

.book-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 18px;
    width: 10px;
    background: rgba(255, 255, 255, 0.18);
}

.book-card span {
    position: relative;
    z-index: 1;
}

.book-card-1 {
    background: var(--brand-dark);
    top: 34px;
    right: 62px;
    transform: rotate(7deg);
}

.book-card-2 {
    background: var(--brand-primary);
    top: 92px;
    right: 220px;
    transform: rotate(-8deg);
}

.book-card-3 {
    background: var(--brand-teal);
    top: 156px;
    right: 130px;
    transform: rotate(3deg);
}

.home-section {
    padding: 56px 48px;
}

.section-warm {
    background: var(--brand-light);
}

.section-heading {
    margin-bottom: 24px;
}

.section-heading span {
    color: var(--brand-primary-dark);
    font-weight: 800;
}

.section-heading h2 {
    color: var(--brand-dark);
    font-weight: 800;
    margin: 6px 0 0;
}

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

.placeholder-card,
.why-item {
    background: var(--brand-white);
    border: 1px solid rgba(92, 194, 167, 0.22);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 8px 22px var(--brand-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.placeholder-card:hover,
.why-item:hover {
    transform: translateY(-4px);
    border-color: rgba(92, 194, 167, 0.45);
    box-shadow: 0 14px 34px var(--brand-glow);
}

.placeholder-card {
    min-height: 168px;
}

.card-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--brand-soft);
    color: var(--brand-primary-dark);
    font-weight: 800;
    margin-bottom: 14px;
}

.placeholder-card h3,
.why-item h3 {
    color: var(--brand-dark);
    font-weight: 800;
    margin-bottom: 10px;
}

.placeholder-card p,
.why-item p {
    color: var(--brand-muted);
    line-height: 1.8;
    margin: 0;
}

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

.public-footer {
    background: var(--brand-dark);
    color: var(--brand-white);
    padding: 44px 48px 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
}

.public-footer h3,
.public-footer h4 {
    font-weight: 800;
    color: var(--brand-white);
}

.public-footer p {
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.9;
}

.public-footer a {
    display: block;
    color: rgba(255, 255, 255, 0.76);
    text-decoration: none;
    margin: 8px 0;
    transition: 0.2s ease;
}

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

.social-links {
    display: flex;
    flex-direction: column;
}

.footer-bottom {
    margin-top: 34px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

@media (max-width: 1300px) {
    .public-page-container,
    .public-header-container,
    .public-nav-container {
        max-width: 1140px;
    }
}

@media (max-width: 992px) {
    .public-header {
        padding: 18px 0;
    }

    .public-page-container,
    .public-header-container,
    .public-nav-container {
        max-width: 100%;
        padding: 0 16px;
    }

    .public-white-page {
        margin-inline: -16px;
        padding-inline: 16px !important;
    }

    .public-header-container {
        grid-template-columns: 1fr;
    }

    .header-search-wrapper {
        width: 100%;
    }

    .public-search-results {
        top: calc(100% + 6px);
    }

    .header-brand {
        justify-content: center;
    }

    .user-panel-link {
        justify-self: center;
    }

    .header-actions {
        justify-content: center;
    }

    .hero-section {
        grid-template-columns: 1fr;
        padding: 42px 24px;
    }

    .hero-content h1 {
        font-size: 34px;
    }

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

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

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .public-page-container,
    .public-header-container,
    .public-nav-container {
        padding: 0 12px;
    }

    .public-white-page {
        margin-inline: -12px;
        padding-inline: 12px !important;
    }

    .public-cart-drawer {
        width: 96vw;
    }

    .cart-drawer-header h3 {
        font-size: 21px;
    }

    .cart-checkout-actions {
        grid-template-columns: 1fr;
    }

    .public-search-thumb-wrap {
        width: 40px;
        height: 56px;
    }

    .public-search-book-title {
        font-size: 14px;
    }

    .public-search-author-name {
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    .site-name {
        font-size: 20px;
    }

    .header-search {
        border-radius: 8px;
        flex-direction: column;
    }

    .header-search button {
        padding: 12px;
    }

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

    .btn-main,
    .btn-secondary {
        text-align: center;
    }

    .hero-visual {
        min-height: 300px;
    }

    .book-stack {
        width: 320px;
        height: 300px;
        transform: scale(0.82);
        transform-origin: top center;
    }

    .book-card-1 {
        right: 24px;
    }

    .book-card-2 {
        right: 150px;
    }

    .book-card-3 {
        right: 84px;
    }

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

    .home-section {
        padding: 36px 20px;
    }

    .public-footer {
        padding: 36px 20px 18px;
    }
}



@media (max-width: 768px) {
    .public-footer .footer-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 18px;
        row-gap: 24px;
        align-items: start;
    }


    .public-footer .footer-about {
        grid-column: 1 / -1;
    }


    .public-footer .footer-important-links,
    .public-footer .footer-contact-links {
        grid-column: auto;
        min-width: 0;
    }

        .public-footer .footer-important-links h4,
        .public-footer .footer-contact-links h4 {
            font-size: 15px;
            margin-bottom: 12px;
        }

        .public-footer .footer-important-links > a,
        .public-footer .social-links a {
            display: block;
            width: fit-content;
            max-width: 100%;
            margin-bottom: 8px;
            font-size: 12px;
            line-height: 1.6;
            overflow-wrap: anywhere;
        }

    .public-footer .social-links {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .public-footer .footer-bottom {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        text-align: center;
    }
}
@media (max-width: 380px) {
    .public-footer .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 10px;
        row-gap: 20px;
    }

    .public-footer .footer-important-links h4,
    .public-footer .footer-contact-links h4 {
        font-size: 13px;
    }

    .public-footer .footer-important-links > a,
    .public-footer .social-links a {
        font-size: 11px;
    }
}
@media (max-width: 768px) {
    .public-header {
        padding: 8px 0;
    }

    .public-header-container {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .header-brand {
        min-width: 0;
        gap: 5px;
    }

    .logo-frame {
        width: 38px;
        height: 38px;
        flex-shrink: 0;
    }

    .site-logo {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .site-name {
        display: none;
    }

    .header-search-wrapper {
        width: 100%;
        min-width: 0;
        position: relative;
    }

    .header-search {
        width: 100%;
        height: 38px;
        display: flex;
        align-items: stretch;
        border-radius: 7px;
        overflow: hidden;
    }

        .header-search input {
            width: 100%;
            min-width: 0;
            height: 38px;
            padding: 6px 9px;
            border-radius: 0 7px 7px 0;
            font-size: 11px;
        }

            .header-search input::placeholder {
                font-size: 10px;
            }

        .header-search button {
            width: 52px;
            min-width: 52px;
            height: 38px;
            padding: 0 7px;
            border-radius: 7px 0 0 7px;
            font-size: 11px;
            font-weight: 800;
        }

    .header-actions {
        flex-shrink: 0;
    }

    .public-cart-btn {
        width: 38px;
        height: 38px;
        padding: 0;
    }

    .cart-icon {
        font-size: 18px;
    }

    .cart-badge {
        min-width: 16px;
        height: 16px;
        font-size: 9px;
    }

    .public-search-results {
        top: calc(100% + 5px);
        right: 0;
        left: 0;
        width: 100%;
        max-height: 280px;
        overflow-y: auto;
        border-radius: 7px;
        z-index: 9999;
    }

    .public-search-item {
        padding: 7px;
        gap: 8px;
    }

    .public-search-thumb-wrap {
        width: 38px;
        height: 50px;
        flex: 0 0 38px;
    }

    .public-search-thumb {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .public-search-book-title {
        font-size: 11px;
        line-height: 1.5;
    }

    .public-search-author-name {
        font-size: 9px;
    }

    .public-search-loading,
    .public-search-empty {
        padding: 12px 8px;
        font-size: 11px;
    }
}

@media (max-width: 400px) {
    .public-header-container {
        grid-template-columns: 34px minmax(0, 1fr) 34px;
        gap: 6px;
        padding-left: 6px;
        padding-right: 6px;
    }

    .logo-frame {
        width: 34px;
        height: 34px;
    }

    .header-search,
    .header-search input,
    .header-search button {
        height: 34px;
    }

        .header-search input {
            padding: 5px 7px;
            font-size: 10px;
        }

            .header-search input::placeholder {
                font-size: 9px;
            }

        .header-search button {
            width: 44px;
            min-width: 44px;
            padding: 0 5px;
            font-size: 10px;
        }

    .public-cart-btn {
        width: 34px;
        height: 34px;
    }

    .cart-icon {
        font-size: 16px;
    }
}
/* القائمة العليا على شاشات الهاتف */
@media (max-width: 768px) {
    .pages-bar {
        width: 100%;
        padding: 0;
        overflow: hidden;
        background: #fff;
        border-top: 1px solid rgba(92, 194, 167, 0.12);
        border-bottom: 1px solid rgba(92, 194, 167, 0.18);
    }

    .public-nav-container {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        padding: 7px 8px;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        direction: rtl;
        scrollbar-width: none;
    }

        .public-nav-container::-webkit-scrollbar {
            display: none;
        }

        .public-nav-container a {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex: 0 0 auto;
            min-height: 34px;
            padding: 7px 12px;
            border-radius: 7px;
            background: var(--brand-soft, #E8F8F3);
            color: var(--brand-dark, #3A3A3A);
            font-size: 11px;
            font-weight: 800;
            line-height: 1;
            text-decoration: none;
            transition: 0.2s ease;
        }

            .public-nav-container a:hover,
            .public-nav-container a:focus {
                background: var(--brand-primary, #5CC2A7);
                color: #fff;
            }
}
@media (max-width: 400px) {
    .public-nav-container {
        gap: 5px;
        padding: 6px;
    }

        .public-nav-container a {
            min-height: 31px;
            padding: 6px 9px;
            border-radius: 6px;
            font-size: 10px;
        }
}