/* ============================================================
   WooCommerce Product Archive Widget – style.css  v2.0
   ============================================================ */

.wpaw-wrap *,
.wpaw-wrap *::before,
.wpaw-wrap *::after { box-sizing: border-box; }
.wpaw-wrap { font-family: inherit; color: #111; }

/* ════════════════════════════════════
   TOOLBAR
════════════════════════════════════ */
.wpaw-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}

/* ── Search ── */
.wpaw-search-wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid #ccc;
    overflow: hidden;
    background: #fff;
    max-width: 420px;
    width: 100%;
}
.wpaw-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 14px;
    font-size: 14px;
    color: #333;
    background: transparent;
}
.wpaw-search-input::placeholder { color: #aaa; }
.wpaw-search-btn {
    flex-shrink: 0;
    background: #111;
    color: #fff;
    border: none;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 0.2s;
}
.wpaw-search-btn:hover { background: #333; }

/* ── Right side ── */
.wpaw-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* ── Sort dropdown ── */
.wpaw-sort-wrap { position: relative; user-select: none; }
.wpaw-sort-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #ccc;
    padding: 9px 14px;
    cursor: pointer;
    background: #fff;
    min-width: 195px;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
}
.wpaw-sort-selected:hover { border-color: #999; }
.wpaw-chevron {
    width: 10px; height: 6px;
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s;
    color: #555;
}
.wpaw-sort-wrap.open .wpaw-chevron { transform: rotate(180deg); }
.wpaw-sort-dropdown {
    display: none;
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    list-style: none;
    margin: 0; padding: 0;
    z-index: 9999;
    min-width: 100%;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.wpaw-sort-wrap.open .wpaw-sort-dropdown { display: block; }
.wpaw-sort-dropdown li {
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
}
.wpaw-sort-dropdown li:hover { background: #f5f5f5; }
.wpaw-sort-dropdown li.active { background: #1a73e8; color: #fff; }

/* ── Grid/List buttons ── */
.wpaw-view-toggle {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    overflow: hidden;
}
.wpaw-view-btn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    background: #fff;
    border: none;
    border-right: 1px solid #ccc;
    cursor: pointer;
    padding: 9px;
    transition: background 0.15s;
    color: #555;
}
.wpaw-view-btn:last-child { border-right: none; }
.wpaw-view-btn svg { width: 100%; height: 100%; fill: currentColor; }
.wpaw-view-btn.active,
.wpaw-view-btn:hover { background: #f0f0f0; color: #111; }

/* ════════════════════════════════════
   PRODUCT GRID
════════════════════════════════════ */
.wpaw-grid {
    display: grid;
    gap: 16px;
    width: 100%;
}
.wpaw-grid.wpaw-cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ════════════════════════════════════
   PRODUCT CARD – Grid
════════════════════════════════════ */
.wpaw-card { position: relative; }
.wpaw-card-link { display: block; text-decoration: none; color: inherit; }

.wpaw-card-inner {
    position: relative;
    overflow: hidden;
    aspect-ratio: var(--wpaw-ratio, 3/4);
    background: #e8e8e8;
}

/* Dark overlay */
.wpaw-card-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.wpaw-card:hover .wpaw-card-inner::after { opacity: 1; }

.wpaw-card-img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.4s ease;
}
.wpaw-card:hover .wpaw-card-img { transform: scale(1.04); }

/* Title overlay */
.wpaw-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 16px;
    pointer-events: none;
}
.wpaw-card-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.wpaw-card:hover .wpaw-card-title { opacity: 1; transform: translateY(0); }

/* Meta – hidden in grid mode */
.wpaw-card-meta { display: none; }

/* List row – hidden in grid mode */
.wpaw-list-row { display: none; }

/* ════════════════════════════════════
   LIST VIEW
════════════════════════════════════ */

/* One column, divider between rows */
.wpaw-grid[data-view="list"] {
    grid-template-columns: 1fr !important;
    gap: 0;
}

/* Each card: hide the grid link, show the list row */
.wpaw-grid[data-view="list"] .wpaw-card-link { display: none; }
.wpaw-grid[data-view="list"] .wpaw-list-row {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 36px 0;
    border-bottom: 1px solid #e8e8e8;
}
.wpaw-grid[data-view="list"] .wpaw-card:first-child .wpaw-list-row { padding-top: 0; }
.wpaw-grid[data-view="list"] .wpaw-card:last-child  .wpaw-list-row { border-bottom: none; }

/* ── Image column: left, ~38% width, portrait ── */
.wpaw-list-img-link {
    flex: 0 0 33%;
    max-width: 33%;
    display: block;
    text-decoration: none;
}
.wpaw-list-img-box {
    position: relative;
    overflow: hidden;
    aspect-ratio: var(--wpaw-ratio, 3/4);
    background: #e8e8e8;
    width: 100%;
}
.wpaw-list-img-box .wpaw-card-img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.4s ease;
}
.wpaw-list-img-link:hover .wpaw-list-img-box .wpaw-card-img {
    transform: scale(1.04);
}

/* Hover overlay on list image */
.wpaw-list-img-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.44);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    pointer-events: none;
}
.wpaw-list-img-link:hover .wpaw-list-img-overlay { opacity: 1; }
.wpaw-list-img-title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.04em;
    line-height: 1.4;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    transform: translateY(6px);
    transition: transform 0.3s ease;
}
.wpaw-list-img-link:hover .wpaw-list-img-title { transform: translateY(0); }

/* ── Content column: right, title + description only ── */
.wpaw-list-content {
    flex: 0 0 67%;
    max-width: 67%;
    padding: 8px 0 0 5%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.wpaw-list-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #111;
    margin: 0;
    line-height: 1.3;
}
.wpaw-list-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}
.wpaw-list-title a:hover { color: #555; }

.wpaw-list-desc {
    font-size: 15px;
    color: #555;
    line-height: 1.9;
    margin: 0;
    font-weight: 400;
}

/* ════════════════════════════════════
   PAGINATION  (right-aligned, smart style)
════════════════════════════════════ */
.wpaw-pagination {
    display: flex;
    justify-content: flex-end;   /* ← right aligned */
    flex-wrap: wrap;
    gap: 0;                      /* no gap – buttons share borders */
    margin-top: 40px;
}
.wpaw-page-btn {
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #ccc;
    margin-left: -1px;           /* collapse borders */
    background: #fff;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.wpaw-pagination .wpaw-page-btn:first-child { margin-left: 0; }
.wpaw-page-btn:hover:not(:disabled) {
    border-color: #111;
    color: #111;
    z-index: 1;
}
.wpaw-page-btn.active {
    background: #111;
    border-color: #111;
    color: #fff;
    z-index: 2;
    cursor: default;
}
.wpaw-page-btn.wpaw-ellipsis {
    cursor: default;
    pointer-events: none;
    color: #888;
    background: #fff;
}
.wpaw-page-btn.wpaw-page-next {
    background: #111;
    border-color: #111;
    color: #fff;
    font-size: 14px;
}
.wpaw-page-btn.wpaw-page-next:hover { background: #333; border-color: #333; }

/* ── No products ── */
.wpaw-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: #888;
    font-size: 15px;
}

/* ── Loading ── */
.wpaw-grid.wpaw-loading { opacity: 0.4; pointer-events: none; transition: opacity 0.2s; }



/* ════════════════════════════════════
   RESPONSIVE – list view
════════════════════════════════════ */
@media (max-width: 768px) {
    .wpaw-toolbar { flex-direction: column; align-items: flex-start; }
    .wpaw-search-wrap { max-width: 100%; }
    .wpaw-toolbar-right { margin-left: 0; flex-wrap: wrap; }
    .wpaw-grid.wpaw-cols-3 { grid-template-columns: repeat(2, 1fr); }
    .wpaw-pagination { justify-content: center; }
    .wpaw-list-img-link { flex: 0 0 44%; max-width: 44%; }
    .wpaw-list-content  { padding-left: 5%; gap: 12px; }
    .wpaw-list-title    { font-size: 14px; }
    .wpaw-list-desc     { font-size: 13px; line-height: 1.7; }
}
@media (max-width: 480px) {
    .wpaw-grid.wpaw-cols-3 { grid-template-columns: 1fr; }
    .wpaw-grid[data-view="list"] .wpaw-list-row { flex-direction: column; padding: 24px 0; }
    .wpaw-list-img-link { flex: none; max-width: 100%; width: 100%; }
    .wpaw-list-img-box  { aspect-ratio: 4/3 !important; }
    .wpaw-list-content  { padding: 16px 0 0 0; }
}
