/* UI Components - Ashu Pads Design System v2 */

/* Global Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #0f1111;
}

/* Unified Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1.5px solid #e7e9ec;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin: 0;
    position: relative;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -13.5px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--amazon-orange, #e47911);
    border-radius: 2px;
}

.section-header a {
    font-size: 13px;
    color: #007185;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.section-header a:hover {
    color: #c45500;
    text-decoration: underline;
}

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-sm, 6px);
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-align: center;
    transition: all 0.2s ease-in-out;
    font-size: 13.5px;
}

.btn-primary {
    background: var(--gradient-accent, linear-gradient(135deg, #ff9900, #ffb700));
    border: 1px solid #a88734;
    color: #111;
    box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ffb700 0%, #ffc429 100%);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #fff;
    border: 1px solid #adb1b8;
    color: #111;
    box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
}

.btn-secondary:hover {
    background-color: #f7fafa;
}

.btn-accent {
    background-color: var(--amazon-orange, #ff9900);
    color: white;
    border: 1px solid #c45500;
}

/* ===================== PRODUCT GRID ===================== */
.amz-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}
@media (min-width: 769px) {
    .amz-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}
@media (min-width: 1200px) {
    .amz-product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
}

/* ===================== PRODUCT CARD ===================== */
.product-card {
    background: #fff;
    padding: 15px;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 12px;
    border: 1px solid #e7e9ec;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    min-width: 0;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: var(--amazon-orange, #e47911);
}

/* ===== PRODUCT IMAGE BOX — THE KEY FIX ===== */
.product-image-box {
    width: 100%;
    height: 180px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #f1f2f4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
    margin-bottom: 12px;
    padding: 10px;
    box-sizing: border-box;
}
.product-image-box img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.product-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #0f1111;
    margin-bottom: 8px;
    line-height: 1.35;
    height: 2.7em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
}
.product-title:hover { color: var(--amazon-orange, #e47911); }

.product-rating {
    color: var(--amazon-orange, #ff9900);
    font-size: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.price-symbol { font-size: 12px; font-weight: 600; }

/* ===================== CATEGORY HIGHLIGHT CARDS ===================== */
.cat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}
@media (min-width: 769px) {
    .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
}

.cat-grid-card {
    background: #fff;
    border: 1px solid #e7e9ec;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
.cat-grid-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 15px 0;
    line-height: 1.25;
}

/* ===== 2x2 CATEGORY IMAGE GRID — THE KEY FIX ===== */
.cat-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 10px;
    flex: 1;
}

.cat-2x2-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.cat-2x2-image-box {
    width: 100%;
    height: 110px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #f1f2f4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
    margin-bottom: 8px;
    padding: 8px;
    box-sizing: border-box;
}
.cat-2x2-item:hover .cat-2x2-image-box {
    border-color: var(--amazon-orange, #e47911);
    box-shadow: 0 4px 8px rgba(0,0,0,0.04);
}

/* CRITICAL: Constrain images inside 2x2 boxes */
.cat-2x2-image-box img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.cat-2x2-label {
    font-size: 12px;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
    height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== H-CARD SLIDER IMAGE BOX ===== */
.h-card-image-box {
    width: 100%;
    height: 120px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #f1f2f4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
    padding: 6px;
    box-sizing: border-box;
    margin-bottom: 8px;
}
.h-card-image-box img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* ===================== SPINNER ===================== */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    border-top-color: var(--amazon-orange, #febd69);
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 5px;
}
@keyframes spin { to { transform: rotate(360deg); } }
