﻿body {
}

* {
    box-sizing: border-box;
}

:root {
    --primary: #a96322;
    --primary-dark: #77451f;
    --text: #68452f;
    --muted: #888;
    --border: #dedede;
    --background: #f0efed;
    --footer: #f4f6f7;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 8px 18px;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background-color: var(--background);
    background-image: repeating-linear-gradient( 135deg, #f5f4f2 0, #f5f4f2 2px, #eeece9 2px, #eeece9 4px );
}

.page-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.main-card {
    width: 100%;
    min-height: 595px;
    background: #fff;
    border: 1px solid #d2d2d2;
    border-top: 2px solid #d9e4f5;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .10);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */

.page-header {
    position: relative;
    height: 130px;
    min-height: 130px;
    padding: 0 25px;
}

.contact-info {
    position: absolute;
    top: 9px;
    left: 15px;
    font-size: 9px;
    color: #777;
}

.header-logo {
    position: absolute;
    top: 25px;
    right: 28px;
    height: 78px;
    display: flex;
    align-items: center;
}

    .header-logo img {
        width: 270px;
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }

/* Search */

.search-section {
    width: 100%;
    max-width: 620px;
    margin: 12px auto 35px;
    padding: 0 20px;
}

    .search-section h2 {
        margin: 0 0 38px;
        color: #a65c20;
        text-align: center;
        font-family: Georgia, "Times New Roman", serif;
        font-size: 17px;
        font-weight: bold;
        line-height: 1.5;
    }

#pharmacySearchForm {
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 155px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-bottom: 17px;
}

    .form-row label {
        font-family: Georgia, "Times New Roman", serif;
        font-size: 12px;
        font-weight: bold;
        color: #995527;
    }

    .form-row input,
    .form-row select {
        width: 100%;
        max-width: 300px;
        height: 31px;
        padding: 5px 9px;
        border: 1px solid #ccc;
        border-radius: 3px;
        background: #fff;
        color: #555;
        font-family: Arial, sans-serif;
        font-size: 12px;
        outline: none;
        transition: border-color .2s, box-shadow .2s;
    }

        .form-row input:focus,
        .form-row select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 4px rgba(169, 99, 34, .22);
        }

/* Buttons */

.button-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 25px;
}

.search-button,
.reset-button {
    min-width: 150px;
    min-height: 37px;
    padding: 9px 18px;
    border: 1px solid #c47b28;
    border-radius: 9px;
    background: #fff;
    color: var(--primary-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 9px rgba(0, 0, 0, .16);
    transition: background .2s, color .2s, transform .2s;
}

    .search-button:hover,
    .reset-button:hover {
        background: var(--primary);
        color: #fff;
    }

    .search-button:active,
    .reset-button:active {
        transform: translateY(1px);
    }

/* Results */

.results-section {
    width: calc(100% - 40px);
    margin: 0 auto 35px;
    padding: 18px;
    border: 1px solid #e4e4e4;
    border-radius: 5px;
    background: #fff;
}

.results-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

    .results-heading h3 {
        margin: 0;
        font-size: 17px;
        color: var(--primary);
    }

.results-count {
    padding: 6px 10px;
    border-radius: 4px;
    background: #f8eee4;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: bold;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}
.results-table {
    width: 100%;
    min-width: 1500px;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 12px;
    color: #555;
}

    /*.results-table th,
    .results-table td {
        padding: 12px 14px;
        overflow-wrap: anywhere;
        vertical-align: top;
    }*/


    .results-table th,
    .results-table td {
        padding: 12px 14px;
        overflow-wrap: anywhere;
        text-align: center;
        vertical-align: middle;
    }


    .results-table th {
        white-space: normal;
        text-align: left;
    }

    .results-table td {
        white-space: normal;
    }

/*.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: #555;
}*/

    .results-table th {
        padding: 12px 10px;
        background: var(--primary);
        color: #fff;
        text-align: center;
        font-weight: bold;
        white-space: nowrap;
    }

    .results-table td {
        padding: 10px;
        border-bottom: 1px solid #e8e8e8;
        /*text-align: left;
        vertical-align: top;*/

        text-align: center;
        vertical-align: middle;
    }

    .results-table tbody tr:nth-child(even) {
        background: #f8f8f8;
    }

    .results-table tbody tr:hover {
        background: #fff0e2;
    }

    .results-table tbody tr:last-child td {
        border-bottom: none;
    }

.no-results {
    padding: 35px 15px;
    text-align: center;
    background: #fafafa;
    border: 1px dashed #ddd;
    border-radius: 4px;
}

.no-results-icon {
    font-size: 28px;
}

.no-results p {
    margin: 12px 0 6px;
    font-weight: bold;
    color: #555;
}

.no-results small {
    color: #888;
    font-size: 12px;
}

/* Footer */

.page-footer {
    margin-top: auto;
    min-height: 157px;
    padding: 28px 7%;
    background: var(--footer);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.5fr;
    gap: 20px;
    align-items: start;
}

.footer-links h4 {
    margin: 4px 0 14px;
    color: #65462f;
    font-size: 11px;
}

.footer-links a {
    display: block;
    margin-bottom: 9px;
    color: #888;
    font-size: 10px;
    text-decoration: none;
}

    .footer-links a:hover {
        color: var(--primary);
    }

.footer-about {
    text-align: center;
}

    .footer-about img {
        width: 145px;
        max-width: 100%;
        height: auto;
    }

    .footer-about p {
        margin: 7px 0;
        color: #888;
        font-size: 10px;
        line-height: 1.7;
    }

/* Responsive */

@media (max-width: 760px) {
    body {
        padding: 8px;
    }

    .header-logo {
        right: 15px;
    }

        .header-logo img {
            width: 220px;
        }

    .search-section {
        padding: 0 18px;
        margin-bottom: 35px;
    }

        .search-section h2 {
            font-size: 15px;
            margin-bottom: 28px;
        }

    .form-row {
        grid-template-columns: 1fr;
        gap: 7px;
        margin-bottom: 15px;
    }

        .form-row input,
        .form-row select {
            max-width: 100%;
            height: 36px;
        }

    .results-section {
        width: calc(100% - 20px);
        padding: 12px;
    }

    .page-footer {
        grid-template-columns: 1fr 1fr;
        padding: 24px 18px;
        gap: 22px;
    }

    .footer-about {
        grid-column: 1 / -1;
    }
}

@media (max-width: 420px) {
    .header-logo img {
        width: 185px;
    }

    .button-row {
        flex-direction: column;
    }

    .search-button,
    .reset-button {
        width: 100%;
    }

    .page-footer {
        grid-template-columns: 1fr 1fr;
    }
}



/* ============================
   Pagination Toolbar
============================ */

.pagination-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 18px;
    padding: 15px 0 2px;
    border-top: 1px solid #e8e0d8;
}

.pagination-info {
    color: #68452f;
    font-size: 12px;
}

.page-size-control {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #77451f;
    font-size: 12px;
    font-weight: bold;
}

    .page-size-control select {
        min-width: 65px;
        height: 32px;
        padding: 5px 8px;
        border: 1px solid #d7b99c;
        border-radius: 5px;
        background: #fff;
        color: #68452f;
        font-size: 12px;
        cursor: pointer;
        outline: none;
    }

        .page-size-control select:focus {
            border-color: #a96322;
            box-shadow: 0 0 4px rgba(169, 99, 34, 0.2);
        }

/* ============================
   Pagination Buttons
============================ */

.pagination-nav {
    max-width: 100%;
}

.pagination-list {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.page-item {
    margin: 0;
    padding: 0;
}

.page-link {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid #dfc4a9;
    border-radius: 6px;
    background: #fff;
    color: #77451f;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

    .page-link:hover:not(:disabled) {
        border-color: #a96322;
        background: #f8eee4;
        color: #77451f;
    }

.page-item.active .page-link {
    border-color: #a96322;
    background: #a96322;
    color: #fff;
    box-shadow: 0 2px 5px rgba(169, 99, 34, 0.2);
}

.page-item.disabled .page-link,
.page-link:disabled {
    border-color: #e8e3de;
    background: #f7f5f3;
    color: #b8aaa0;
    cursor: not-allowed;
    box-shadow: none;
}

/* ============================
   Responsive Pagination
============================ */

@media (max-width: 760px) {
    .pagination-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .pagination-info {
        text-align: center;
    }

    .page-size-control {
        justify-content: center;
    }

    .pagination-list {
        gap: 4px;
    }

    .page-link {
        min-width: 32px;
        height: 32px;
        padding: 0 7px;
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .pagination-list {
        gap: 3px;
    }

    .page-link {
        min-width: 28px;
        height: 30px;
        padding: 0 5px;
    }
}

.search-message {
    color: #b42318;
    background-color: #fef3f2;
    border: 1px solid #fecdca;
    padding: 12px;
    margin-top: 12px;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}