/**
 * And Addons — Frontend Styles
 * Widget: Category Showcase
 *
 * Uses custom properties set via Elementor selectors so values
 * are always in sync with the control panel.
 */

/* ── Wrapper ───────────────────────────────────────────────────────────────── */
.and-cat-showcase {
    width: 100%;
}

/* ── Section heading ───────────────────────────────────────────────────────── */
.and-cat-section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 1.25rem 0;
    color: #111;
    line-height: 1.3;
}

/* ── Grid ──────────────────────────────────────────────────────────────────── */
.and-cat-grid {
    display: grid;
    grid-template-columns: repeat( 7, minmax(0, 1fr) );
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Responsive defaults — overridden by Elementor when user changes Columns control */
@media (max-width: 1024px) {
    .and-cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .and-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Card ──────────────────────────────────────────────────────────────────── */
.and-cat-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    will-change: transform;
}

.and-cat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

/* ── Link ──────────────────────────────────────────────────────────────────── */
.and-cat-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-decoration: none;
    color: inherit;
}

.and-cat-link:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 3px;
    border-radius: 8px;
}

/* ── Image wrapper ─────────────────────────────────────────────────────────── */
.and-cat-img-wrap {
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background-color: #f5f5f5;
    flex-shrink: 0;
    margin: 0 auto;
}

.and-cat-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.and-cat-card:hover .and-cat-img {
    transform: scale(1.05);
}

/* ── Category name ─────────────────────────────────────────────────────────── */
.and-cat-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #111;
    margin-top: 10px;
    line-height: 1.3;
    word-break: break-word;
    transition: color 0.18s ease;
}

/* ── Product count ─────────────────────────────────────────────────────────── */
.and-cat-count {
    display: block;
    font-size: 0.78rem;
    color: #888;
    margin-top: 3px;
    line-height: 1.2;
}

/* ── Editor placeholder ────────────────────────────────────────────────────── */
.and-no-results {
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #856404;
    font-size: 0.875rem;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Widget: Product Showcase
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.and-ps-wrap {
    width: 100%;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.and-ps-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.and-ps-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.and-ps-view-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 18px;
    background: #f3f4f6;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
    border: 1px solid #e5e7eb;
}
.and-ps-view-all:hover { background: #e5e7eb; color: #111827; }
.and-ps-arrow { font-size: 1.1em; line-height: 1; }

/* ── Grid ─────────────────────────────────────────────────────────────────── */
.and-ps-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 1024px) { .and-ps-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px)  { .and-ps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px)  { .and-ps-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); } }

/* ── Card ─────────────────────────────────────────────────────────────────── */
.and-ps-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    will-change: transform;
}
.and-ps-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.11);
}

/* ── Image wrap ───────────────────────────────────────────────────────────── */
.and-ps-img-wrap {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #f9fafb;
    flex-shrink: 0;
}
.and-ps-img-wrap a { display: block; width: 100%; height: 100%; }
.and-ps-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.and-ps-card:hover .and-ps-img { transform: scale(1.04); }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.and-ps-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 2;
}
.and-ps-badge {
    display: inline-block;
    padding: 3px 9px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    border-radius: 20px;
    line-height: 1.4;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.and-ps-badge--hot  { background: #dc2626; }
.and-ps-badge--sale { background: #2563eb; }
.and-ps-badge--new  { background: #16a34a; }

/* ── Info block ───────────────────────────────────────────────────────────── */
.and-ps-info {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

/* ── Category ─────────────────────────────────────────────────────────────── */
.and-ps-cat {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.3;
}

/* ── Title ────────────────────────────────────────────────────────────────── */
.and-ps-title-link { text-decoration: none; }
.and-ps-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.35;
    transition: color 0.18s;
}
.and-ps-title:hover { color: #2563eb; }

/* ── Rating ───────────────────────────────────────────────────────────────── */
.and-ps-rating {
    display: flex;
    gap: 1px;
    margin: 1px 0;
}
.and-ps-star {
    font-size: 0.95rem;
    color: #d1d5db;
    line-height: 1;
}
.and-ps-star--filled { color: #f59e0b; }

/* ── Stock ────────────────────────────────────────────────────────────────── */
.and-ps-stock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}
.and-ps-stock--in  { color: #16a34a; }
.and-ps-stock--out { color: #dc2626; }

/* ── Price ────────────────────────────────────────────────────────────────── */
.and-ps-price {
    margin: 2px 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}
.and-ps-price .woocommerce-Price-amount { font-size: 1.05rem; font-weight: 700; }
.and-ps-price ins { text-decoration: none; }
.and-ps-price ins .woocommerce-Price-amount { color: #2563eb; }
.and-ps-price del { opacity: 0.7; }
.and-ps-price del .woocommerce-Price-amount { font-size: 0.85rem; font-weight: 400; color: #9ca3af; }
.and-ps-price > .woocommerce-Price-amount { color: #2563eb; }

/* ── Swatches ─────────────────────────────────────────────────────────────── */
.and-ps-swatches {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin: 2px 0;
    align-items: center;
}
.and-ps-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ccc;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #d1d5db;
    transition: transform 0.15s;
    cursor: pointer;
}
.and-ps-swatch:hover { transform: scale(1.2); }

/* ── Button ───────────────────────────────────────────────────────────────── */
.and-ps-btn {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: #2563eb;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.18s, transform 0.15s;
    margin-top: auto;
    line-height: 1.4;
}
.and-ps-btn:hover {
    background: #1d4ed8;
    color: #fff;
    transform: translateY(-1px);
}
.and-ps-btn--disabled {
    background: #9ca3af;
    cursor: not-allowed;
}
.and-ps-btn--disabled:hover { background: #9ca3af; transform: none; }

/* ── SKU ──────────────────────────────────────────────────────────────────── */
.and-ps-sku {
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 4px;
}

/* ── Notice (editor) ──────────────────────────────────────────────────────── */
.and-notice {
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #856404;
    font-size: 0.875rem;
}
