/* ============================================================
   Pharmacy Products – Frontend Styles
   ============================================================ */

/* ── Filters Widget ───────────────────────────────────────────── */

.pp-filters-widget {
    font-family: inherit;
}

/* ── Product Type Buttons ────────────────────────────────────── */

.pp-type-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.pp-type-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 22px;
    border-radius: 999px;
    border: 2px solid #d4d4d4;
    background: #fff;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    user-select: none;
    line-height: 1.3;
}

.pp-type-btn:hover {
    border-color: #4db6ac;
    color: #4db6ac;
}

.pp-type-btn.active {
    background-color: #4db6ac;
    border-color: #4db6ac;
    color: #fff;
}

/* ── Filters Bar ─────────────────────────────────────────────── */

.pp-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 28px;
}

.pp-filter-group {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
}

.pp-filter-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #777;
    margin-bottom: 8px;
}

/* Selects – base */
.pp-select-wrapper {
    position: relative;
    display: block;
}

.pp-filter-select {
    width: 100%;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #ffffff;
    border: 1.5px solid #d4d4d4;
    border-radius: 4px;
    padding: 10px 36px 10px 14px;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    line-height: 1.4;
    transition: border-color 0.2s;
}

.pp-filter-select:focus {
    outline: none;
    border-color: #4db6ac;
}

.pp-select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #888;
    pointer-events: none;
}

/* Pill-shaped selects */
.pp-pill-select .pp-filter-select {
    border-radius: 999px;
    padding-left: 18px;
    padding-right: 42px;
}

.pp-pill-select .pp-select-arrow {
    right: 16px;
}

/* Search */
.pp-filter-search {
    flex: 1.6;
    min-width: 200px;
}

.pp-search-wrapper {
    display: flex;
    align-items: stretch;
    border: 1.5px solid #d4d4d4;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s;
}

.pp-search-wrapper:focus-within {
    border-color: #4db6ac;
}

/* Pill search bar with diagonal colored right section */
.pp-search-wrapper.pp-pill-search {
    border-radius: 999px;
    border-color: #d4d4d4;
}

.pp-search-wrapper.pp-pill-search:focus-within {
    border-color: #4db6ac;
}

.pp-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 14px;
    font-size: 15px;
    color: #333;
    background: transparent;
    min-width: 0;
}

.pp-search-input::placeholder {
    color: #aaa;
}

.pp-search-btn {
    flex-shrink: 0;
    background-color: #4db6ac;
    border: none;
    padding: 0 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    line-height: 1;
}

.pp-search-btn:hover {
    background-color: #3ea89e;
}

.pp-search-btn svg {
    fill: #ffffff;
    display: block;
}

/* Diagonal left edge on the pill search button */
.pp-pill-search .pp-search-btn {
    margin-left: -10px;
    padding: 0 20px 0 26px;
    clip-path: polygon(18px 0%, 100% 0%, 100% 100%, 0% 100%);
}

.pp-search-note {
    font-size: 11px;
    color: #999;
    margin: 6px 0 0;
    text-align: center;
    line-height: 1.5;
}

/* ── Alphabet Filter ───────────────────────────────────────────── */

.pp-alphabet-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 16px 0 24px;
}

.pp-letter-btn {
    background: none;
    border: none;
    font-size: 22px;
    font-weight: 600;
    color: #2a2a2a;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    transition: color 0.2s, transform 0.1s;
    letter-spacing: 0.02em;
    user-select: none;
}

.pp-letter-btn:hover:not(.pp-disabled) {
    color: #4db6ac;
    transform: scale(1.15);
}

.pp-letter-btn.active {
    color: #4db6ac;
    position: relative;
}

.pp-letter-btn.active::after {
    content: '';
    display: block;
    height: 2px;
    background: #4db6ac;
    border-radius: 1px;
    margin-top: 2px;
}

.pp-letter-btn.pp-disabled {
    color: #c8c8c8;
    cursor: default;
    pointer-events: none;
}

/* ── Products Loop ─────────────────────────────────────────────── */

.pp-products-widget {
    /* no outer transition – only the container fades */
}

/* Smooth fade: content fades out, then new content fades back in */
.pp-products-container {
    transition: opacity 220ms ease, transform 220ms ease;
    will-change: opacity, transform;
}

.pp-is-fading .pp-products-container {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

.pp-products-loop {
    display: grid;
    gap: 24px;
}

/* Grid columns */
.pp-layout-grid.pp-col-2 { grid-template-columns: repeat(2, 1fr); }
.pp-layout-grid.pp-col-3 { grid-template-columns: repeat(3, 1fr); }
.pp-layout-grid.pp-col-4 { grid-template-columns: repeat(4, 1fr); }

/* List */
.pp-layout-list           { grid-template-columns: 1fr; }

/* Product Card */
.pp-product-card {
    background-color: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.pp-product-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.10);
    transform: translateY(-3px);
}

.pp-product-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pp-layout-list .pp-product-link {
    flex-direction: row;
    align-items: flex-start;
}

/* Thumbnail */
.pp-product-thumbnail {
    overflow: hidden;
    background: #f8f8f8;
}

.pp-product-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.pp-product-card:hover .pp-product-thumbnail img {
    transform: scale(1.04);
}

.pp-layout-list .pp-product-thumbnail {
    flex-shrink: 0;
    width: 140px;
}

.pp-layout-list .pp-product-thumbnail img {
    height: 100%;
    min-height: 120px;
}

/* Body */
.pp-product-body {
    padding: 16px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pp-product-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #1a1a1a;
    line-height: 1.35;
    transition: color 0.2s;
}

.pp-product-card:hover .pp-product-title {
    color: #4db6ac;
}

.pp-product-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

/* Meta */
.pp-product-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.pp-meta-item {
    display: flex;
    gap: 4px;
    font-size: 13px;
    flex-wrap: wrap;
    line-height: 1.4;
}

.pp-meta-item dt {
    font-weight: 600;
    color: #444;
    flex-shrink: 0;
}

.pp-meta-item dd {
    color: #666;
    margin: 0;
}

/* ── Loader (shown while fading if needed as fallback) ──────────── */

.pp-loader {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pp-loader::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top-color: #4db6ac;
    border-radius: 50%;
    animation: pp-spin 0.65s linear infinite;
    flex-shrink: 0;
}

@keyframes pp-spin {
    to { transform: rotate(360deg); }
}

/* Skeleton cards shown during load */
.pp-skeleton-grid {
    display: grid;
    gap: 24px;
}

.pp-skeleton-grid.pp-col-2 { grid-template-columns: repeat(2, 1fr); }
.pp-skeleton-grid.pp-col-3 { grid-template-columns: repeat(3, 1fr); }
.pp-skeleton-grid.pp-col-4 { grid-template-columns: repeat(4, 1fr); }

.pp-skeleton-card {
    background: #f0f0f0;
    border-radius: 8px;
    height: 260px;
    animation: pp-shimmer 1.4s ease-in-out infinite;
}

@keyframes pp-shimmer {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

/* ── No results ────────────────────────────────────────────────── */

.pp-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 16px;
    grid-column: 1 / -1;
}

/* ── Pagination ────────────────────────────────────────────────── */

.pp-pagination-container {
    margin-top: 32px;
}

.pp-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.pp-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1.5px solid #d4d4d4;
    background-color: #fff;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    line-height: 1;
}

.pp-page-btn:hover,
.pp-page-btn.active {
    background-color: #4db6ac;
    border-color: #4db6ac;
    color: #fff;
}

/* ── Single Product Template ───────────────────────────────────── */

.pp-single-product {
    padding: 40px 0 60px;
}

.pp-single-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.pp-single-header {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.pp-single-image {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f8f8;
    padding: 16px;
}

.pp-single-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.pp-single-info {
    flex: 1;
    min-width: 280px;
}

.pp-single-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px;
    line-height: 1.25;
}

.pp-single-meta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.pp-single-meta-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.pp-single-meta-table th,
.pp-single-meta-table td {
    padding: 10px 4px;
    text-align: left;
    vertical-align: top;
}

.pp-single-meta-table th {
    font-weight: 600;
    color: #444;
    width: 40%;
    padding-right: 16px;
}

.pp-single-meta-table td {
    color: #666;
}

.pp-single-media {
    flex: 0 0 340px;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Gallery thumbnails strip */
.pp-single-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pp-gallery-thumb {
    display: block;
    width: 72px;
    height: 72px;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}

.pp-gallery-thumb:hover {
    border-color: #4db6ac;
    transform: scale(1.05);
}

.pp-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Video section */
.pp-single-video {
    margin-bottom: 40px;
}

.pp-embed-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.pp-embed-wrapper iframe,
.pp-embed-wrapper embed,
.pp-embed-wrapper object {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.pp-single-description {
    margin-bottom: 40px;
}

.pp-single-description h2,
.pp-single-documents h2,
.pp-single-video h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 16px;
    color: #1a1a1a;
}

.pp-documents-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pp-document-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.pp-document-link:hover {
    background: #e8f5f4;
    border-color: #4db6ac;
    color: #4db6ac;
}

.pp-document-link svg {
    flex-shrink: 0;
    fill: currentColor;
}

.pp-download-icon {
    margin-left: auto;
    font-size: 16px;
}

/* ── PDF Documents Widget ──────────────────────────────────────── */

.pp-pdf-widget {
    font-family: inherit;
}

.pp-pdf-heading {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 16px;
}

.pp-pdf-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pp-pdf-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    background-color: #f7f8f9;
    border: 1px solid #e4e8ec;
    border-radius: 6px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.pp-pdf-row:hover {
    background-color: #eef6f5;
    border-color: #b2dfdb;
}

.pp-pdf-row.pp-pdf-demo {
    opacity: 0.6;
    pointer-events: none;
}

.pp-pdf-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.pp-pdf-icon {
    flex-shrink: 0;
    color: #e53935;
    display: flex;
    align-items: center;
    width: 22px;
    height: 22px;
    font-size: 22px;
}

.pp-pdf-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.pp-pdf-name {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pp-pdf-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #4db6ac;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
    line-height: 1;
}

.pp-pdf-btn:hover {
    background-color: #3ea89e;
    color: #fff;
    transform: translateY(-1px);
}

.pp-btn-arrow {
    font-size: 13px;
    line-height: 1;
}

.pp-pdf-empty {
    color: #888;
    font-size: 15px;
    text-align: center;
    padding: 24px 0;
}

/* ── Responsive ────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .pp-layout-grid.pp-col-4,
    .pp-layout-grid.pp-col-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .pp-type-filter {
        gap: 8px;
    }
    .pp-type-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    .pp-filters-bar {
        flex-direction: column;
        gap: 12px;
    }
    .pp-filter-group {
        width: 100%;
        min-width: 0;
    }
    .pp-layout-grid.pp-col-2,
    .pp-layout-grid.pp-col-3,
    .pp-layout-grid.pp-col-4 {
        grid-template-columns: 1fr;
    }
    .pp-letter-btn {
        font-size: 17px;
        padding: 4px 4px;
    }
    .pp-single-header {
        flex-direction: column;
    }
    .pp-single-image {
        flex: none;
        max-width: 100%;
        width: 100%;
    }
}
