/* ==============================
   Bookstore Utility Page Styles
   ============================== */

/* Page Layout */
.bookstore-utility-custom .page-main {
    max-width: 1200px;
    padding: 18px 20px 56px;
    width: 100%;
    box-sizing: border-box;
}

.bookstore-info-page {
    max-width: 1120px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.bookstore-info-page *,
.bookstore-stores-page * {
    box-sizing: border-box;
}

/* Hero Section */
.bookstore-info-hero {
    margin: 0 0 22px;
}

.bookstore-info-hero p {
    margin: 0 0 8px;
    color: #0095ff;
    font-weight: 900;
}

.bookstore-info-hero h1 {
    margin: 0 0 10px;
    color: #1e293b;
    font-size: 34px;
    line-height: 1.15;
    font-weight: 950;
}

.bookstore-info-hero span {
    color: #64748b;
    font-weight: 650;
}

/* Info Grid */
.bookstore-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

/* Info Cards */
.bookstore-info-card {
    border: 2px solid #0095ff;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0, 149, 255, 0.08);
    padding: 20px;
    min-width: 0;
}

/* ÉP CẢ 3 KHỐI ĐỀU KÉO DÀI THEO CHIỀU NGANG FULL WIDTH */
.weather-card,
.rates-card,
.news-card {
    grid-column: 1 / -1;
}

/* Card Heading */
.card-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    min-width: 0;
}

.card-heading > div {
    min-width: 0;
}

.utility-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f5fbff;
    color: #0095ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 950;
    flex-shrink: 0;
}

.card-heading h2 {
    margin: 0;
    color: #1e293b;
    font-size: 22px;
    font-weight: 950;
    overflow-wrap: anywhere;
}

.card-heading p,
.utility-muted {
    margin: 4px 0 0;
    color: #64748b;
    overflow-wrap: anywhere;
}

/* Refresh Button */
.utility-refresh-btn {
    margin-left: auto;
    width: 36px;
    height: 36px;
    border: 2px solid #d7ecff;
    border-radius: 10px;
    background: #f8fafc;
    color: #0095ff;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.utility-refresh-btn:hover {
    background: #0095ff;
    color: #fff;
    border-color: #0095ff;
}

.utility-refresh-btn:active {
    transform: rotate(180deg);
}

/* ==============================
   Weather Widget (DÀN HÀNG NGANG CHUYÊN NGHIỆP)
   ============================== */
#utility-weather-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0; /* Reset margin để bằng vai phải lứa với chỉ số */
    flex-shrink: 0;
}

.weather-icon-wrap {
    flex-shrink: 0;
}

.weather-icon-img {
    width: 80px;
    height: 80px;
}

.weather-temp-block {
    display: flex;
    flex-direction: column;
}

.weather-temp-value {
    color: #1e293b;
    font-size: 42px;
    font-weight: 950;
    line-height: 1;
}

.weather-desc {
    color: #64748b;
    font-size: 15px;
    font-weight: 700;
    text-transform: capitalize;
    margin-top: 4px;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)); /* 5 chỉ số dàn đều 5 cột ngang */
    gap: 10px;
    flex: 1;
    min-width: 300px;
}

.weather-detail-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 14px;
}

.wd-label {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.wd-value {
    display: block;
    color: #1e293b;
    font-size: 15px;
    font-weight: 900;
}

/* ==============================
   Currency Rates Widget
   ============================== */
.utility-rates-scroll {
    max-height: 520px;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid #d7ecff;
    -webkit-overflow-scrolling: touch;
}

.utility-rate-table {
    width: 100%;
    min-width: 620px;
    border-collapse: separate;
    border-spacing: 0;
}

.utility-rate-table th {
    padding: 12px;
    background: #f5fbff;
    color: #64748b;
    text-align: left;
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.utility-rate-table td {
    padding: 13px 12px;
    border-bottom: 1px solid #e8f0fe;
    font-size: 14px;
}

.utility-rate-table tr:hover td {
    background: #f8fafc;
}

.utility-rate-table td strong {
    color: #1e293b;
    font-weight: 950;
}

.utility-rate-table td span {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
}

/* ==============================
   News Widget
   ============================== */
.utility-news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.news-item {
    display: flex;
    flex-direction: column;
    padding: 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e8f0fe;
    transition: all 0.2s ease;
    min-width: 0;
}

.news-item:hover {
    border-color: #0095ff;
    box-shadow: 0 4px 12px rgba(0, 149, 255, 0.1);
    transform: translateY(-2px);
}

.news-thumb {
    margin-bottom: 10px;
    border-radius: 10px;
    overflow: hidden;
}

.news-thumb img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.news-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-title {
    color: #1e293b;
    font-weight: 900;
    font-size: 15px;
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}

.news-title:hover {
    color: #0095ff;
}

.news-desc {
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 8px;
    flex: 1;
    overflow-wrap: anywhere;
}

.news-date {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
}

/* ==============================
   Loading Animation
   ============================== */
.utility-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 40px 0;
}

.utility-loading span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #0095ff;
    animation: utility-bounce 1.2s ease-in-out infinite;
}

.utility-loading span:nth-child(2) {
    animation-delay: 0.2s;
}

.utility-loading span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes utility-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==============================
   Muted Text
   ============================== */
.utility-muted {
    color: #94a3b8;
    font-size: 14px;
    padding: 20px 0;
    text-align: center;
}

/* ==============================
   Store Network Page
   ============================== */
.bookstore-stores-page {
    max-width: 1180px;
    margin: 0 auto;
}

.bookstore-stores-page .bookstore-cms-hero {
    position: relative;
    overflow: hidden;
    margin: 0 0 22px;
    padding: 34px;
    border: 2px solid #d7ecff;
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(0, 149, 255, 0.1), rgba(255, 255, 255, 0.92)),
        #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.bookstore-stores-page .bookstore-cms-hero::after {
    content: "";
    position: absolute;
    right: 34px;
    bottom: 24px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 149, 255, 0.18), rgba(0, 149, 255, 0));
    pointer-events: none;
}

.bookstore-stores-page .bookstore-cms-hero p {
    position: relative;
    z-index: 1;
    margin: 0 0 10px;
    color: #0095ff;
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
}

.bookstore-stores-page .bookstore-cms-hero h1 {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 0 14px;
    color: #1e293b;
    font-size: 42px;
    line-height: 1.12;
    font-weight: 950;
}

.bookstore-stores-page .bookstore-cms-hero span {
    position: relative;
    z-index: 1;
    display: block;
    max-width: 620px;
    color: #64748b;
    font-size: 16px;
    line-height: 1.65;
    font-weight: 650;
}

.store-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 22px;
    padding: 16px 18px;
    border: 1px solid #d7ecff;
    border-radius: 16px;
    background: #f8fafc;
}

.store-toolbar div {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.store-toolbar strong {
    color: #1e293b;
    font-size: 17px;
    font-weight: 950;
}

.store-toolbar span {
    color: #64748b;
    font-weight: 700;
}

.store-toolbar button {
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    background: #0095ff;
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(0, 149, 255, 0.2);
}

.store-toolbar button:hover {
    background: #0076cc;
}

.store-feature {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
    gap: 22px;
    margin: 0 0 24px;
}

.store-map {
    min-height: 285px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    padding: 24px;
    border-radius: 18px;
    border: 2px solid #0095ff;
    background:
        linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.9)),
        repeating-linear-gradient(0deg, transparent 0 34px, rgba(0, 149, 255, 0.1) 35px),
        repeating-linear-gradient(90deg, transparent 0 34px, rgba(0, 149, 255, 0.1) 35px),
        #f5fbff;
    box-shadow: 0 12px 26px rgba(0, 149, 255, 0.1);
}

.store-map span {
    color: #64748b;
    font-weight: 800;
}

.store-map strong {
    color: #1e293b;
    font-size: 28px;
    line-height: 1.15;
    font-weight: 950;
}

.store-feature-copy {
    padding: 26px;
    border-radius: 18px;
    border: 1px solid #e8f0fe;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.store-feature-copy h2 {
    margin: 0 0 12px;
    color: #1e293b;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 950;
}

.store-feature-copy p {
    margin: 0 0 18px;
    color: #64748b;
    line-height: 1.7;
    font-weight: 650;
}

.store-services {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.store-services span {
    padding: 9px 12px;
    border-radius: 999px;
    background: #eef7ff;
    color: #0076cc;
    font-size: 13px;
    font-weight: 900;
}

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

.store-grid article {
    display: flex;
    flex-direction: column;
    min-height: 170px;
    padding: 20px;
    border: 1px solid #d7ecff;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.store-grid article:hover {
    transform: translateY(-4px);
    border-color: #0095ff;
    box-shadow: 0 14px 28px rgba(0, 149, 255, 0.1);
}

.store-grid article strong {
    margin: 0 0 8px;
    color: #1e293b;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 950;
}

.store-grid article p {
    flex: 1 1 auto;
    margin: 0 0 14px;
    color: #64748b;
    line-height: 1.55;
}

.store-grid article span,
.store-grid article small {
    display: block;
    color: #1e293b;
    font-weight: 850;
}

.store-grid article small {
    margin-top: 4px;
    color: #0095ff;
    font-size: 13px;
}

/* ==============================
   Responsive (TỰ ĐỘNG THU GỌN TRÊN MOBILE)
   ============================== */
@media (max-width: 1024px) {
    .bookstore-utility-custom .page-main {
        padding: 16px 18px 44px;
    }

    .bookstore-info-card {
        padding: 18px;
    }

    .weather-details {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        min-width: 0;
        width: 100%;
    }

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

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

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

@media (max-width: 800px) {
    .bookstore-info-page {
        overflow-x: visible;
    }

    #utility-weather-content {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .weather-main {
        margin-bottom: 12px;
        justify-content: center;
    }

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

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

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

    .bookstore-info-hero h1 {
        font-size: 26px;
    }

    .bookstore-info-hero span {
        display: block;
        line-height: 1.55;
    }

    .bookstore-stores-page .bookstore-cms-hero {
        padding: 26px 22px;
    }

    .bookstore-stores-page .bookstore-cms-hero::after {
        display: none;
    }

    .bookstore-stores-page .bookstore-cms-hero h1 {
        font-size: 30px;
    }

    .store-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .store-feature {
        display: grid;
        grid-template-columns: 1fr;
    }

    .store-toolbar button {
        width: 100%;
    }

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

@media (max-width: 640px) {
    .bookstore-info-card {
        border-radius: 12px;
        padding: 16px;
    }

    .card-heading {
        align-items: flex-start;
        gap: 10px;
    }

    .utility-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .utility-refresh-btn {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .card-heading h2 {
        font-size: 19px;
        line-height: 1.25;
    }

    .card-heading p {
        font-size: 13px;
        line-height: 1.45;
    }

    .utility-rate-table {
        min-width: 560px;
    }

    .news-thumb img {
        height: 170px;
    }

    .store-map,
    .store-feature-copy,
    .store-grid article {
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .weather-main {
        flex-direction: column;
        text-align: center;
        gap: 4px;
        margin-bottom: 4px;
    }

    .weather-temp-value {
        font-size: 34px;
    }

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

    .bookstore-utility-custom .page-main {
        padding-left: 14px;
        padding-right: 14px;
    }

    .bookstore-info-hero {
        margin-bottom: 16px;
    }

    .bookstore-info-hero p {
        font-size: 12px;
        line-height: 1.35;
    }

    .bookstore-info-hero h1 {
        font-size: 24px;
    }

    .weather-detail-item {
        padding: 11px 12px;
    }

    .utility-news-grid {
        gap: 12px;
    }

    .news-item {
        padding: 12px;
    }

    .bookstore-stores-page .bookstore-cms-hero {
        padding: 22px 16px;
        border-radius: 12px;
    }

    .bookstore-stores-page .bookstore-cms-hero h1 {
        font-size: 26px;
    }

    .bookstore-stores-page .bookstore-cms-hero span,
    .store-feature-copy p,
    .store-grid article p {
        font-size: 14px;
        line-height: 1.6;
    }

    .store-toolbar div,
    .store-services {
        align-items: stretch;
        flex-direction: column;
    }

    .store-toolbar button {
        width: 100%;
    }
}

@media (max-width: 380px) {
    .bookstore-utility-custom .page-main {
        padding-left: 10px;
        padding-right: 10px;
    }

    .bookstore-info-card {
        padding: 14px;
    }

    .card-heading {
        flex-wrap: wrap;
    }

    .utility-refresh-btn {
        margin-left: 0;
    }

    .weather-icon-img {
        width: 66px;
        height: 66px;
    }

    .weather-temp-value {
        font-size: 30px;
    }

    .news-thumb img {
        height: 145px;
    }
}
