/* =========================
   AMAZON CONTROL BAR
   ========================= */

.amazon-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* 🔥 strict 50/50 */
    gap: 6px;

    margin-bottom: 16px;

    width: 100%;
    box-sizing: border-box;

    /* FIX mobile theme padding issues */
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* optional theme padding override */
.entry-content .amazon-controls,
.wp-block-group .amazon-controls {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* =========================
   EACH BLOCK
   ========================= */

.amazon-control {
    min-width: 0; /* 🔥 critical for Firefox */

    background: #eee;
    border: 2px solid #008000;
    border-radius: 1px;

    height: 42px;

    display: flex;
    align-items: center;

    overflow: hidden; /* FIX border clipping on mobile */
    box-sizing: border-box;

    transition: all 0.2s ease;
}

/* hover */
.amazon-control:hover {
    border-color: #111;
}

/* =========================
   SELECT (both identical)
   ========================= */

.amazon-select {
    width: 100%;
    height: 42px;

    font-size: 14px;
    font-weight: 600;
    color: #111;

    border: none;
    background: transparent;

    padding: 0 10px;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    box-sizing: border-box;

    /* 🔥 prevent overflow issues */
    min-width: 0;

    /* prevent Firefox mobile stretching */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* focus */
.amazon-select:focus {
    outline: none;
}

/* =========================
   ICON (optional if used)
   ========================= */

.amazon-sort-icon {
    display: none; /* keep clean if still in HTML */
}

/* =========================
   ARROW FIX (if used wrapper)
   ========================= */

.amazon-select-wrap {
    position: relative;
    width: 100%;
}

.amazon-select-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);

    width: 0;
    height: 0;

    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #111;

    pointer-events: none;
}

/* =========================
   MOBILE FIXES
   ========================= */

@media (max-width: 768px) {

    .amazon-controls {
        gap: 6px;
        margin-bottom: 12px;
    }

    .amazon-control {
        height: 40px;
    }

    .amazon-select {
        font-size: 14px;
    }
}
    box-sizing: border-box; /* 🔥 критично */
}

/* убираем баги мобилок */
.amazon-select:focus {
    outline: none;
    border-color: #111;
}

/* СУПЕР-ФИКС: запрет переноса */
.amazon-controls,
.amazon-control {
    overflow: hidden;
}
    outline: none;
    border-color: #111;
}

/* мобильный — чуть плотнее */
@media (max-width: 768px) {
    .amazon-control select {
        height: 40px;
        font-size: 14px;
    }
}
.amazon-control-btn {
    font-size: 13px;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
}

/* === RIGHT CONTENT === */
.amazon-control-inner {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* icon */
.amazon-sort-icon {
    font-size: 14px;
    color: #111;
}

/* select wrapper */
.amazon-select-wrap {
    position: relative;
}

/* select */
.amazon-sort {
    font-size: 13px;
    font-weight: 600;

    border: none;
    background: transparent;

    appearance: none;
    cursor: pointer;

    padding-right: 16px;
}

/* arrow */
.amazon-select-arrow {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);

    width: 0;
    height: 0;

    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #111;

    pointer-events: none;
}

/* mobile tweak */
@media (max-width: 768px) {
    .amazon-control {
        height: 40px;
    }

    .amazon-control-btn {
        font-size: 12px;
    }

    .amazon-sort {
        font-size: 13px;
    }
}

    transition: all 0.2s ease;
}

.amazon-category-btn:hover {
    border-color: #111;
}

/* RIGHT */
.amazon-control-right {
    display: flex;
    align-items: center;
}

/* SORT GROUP */
.amazon-sort-group {
    display: flex;
    align-items: center;
    gap: 6px;

    background: #eee;
    border: 2px solid #008000;
    border-radius: 1px;

    

    transition: all 0.2s ease;
}

/* hover = важно */
.amazon-sort-group:hover {
    border-color: #111;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* icon */
.amazon-sort-icon {
    font-size: 14px;
    color: #111;
}

/* select wrapper */
.amazon-select-wrap {
    position: relative;
}

/* select */
.amazon-sort {
    font-size: 13px;
    font-weight: 600;
    color: #111;

    padding: 4px 20px 4px 4px;

    border: none;
    background: transparent;

    appearance: none;
    cursor: pointer;
}

/* arrow */
.amazon-select-arrow {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);

    width: 0;
    height: 0;

    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #111;

    pointer-events: none;
}

/* MOBILE */
@media (max-width: 768px) {

    .amazon-controls {
    }

    .amazon-category-btn {
        font-size: 12px;
        padding: 5px 8px;
    }

    .amazon-sort {
        font-size: 13px;
    }
}

    transition: all 0.2s ease;
}

.amazon-category-btn:hover {
    border-color: #111;
}

/* RIGHT */
.amazon-control-right {
    display: flex;
    align-items: center;
}

/* SORT GROUP */
.amazon-sort-group {
    display: flex;
    align-items: center;
    gap: 6px;

    background: #eee;
    border: 2px solid #008000;
    border-radius: 8px;


    transition: all 0.2s ease;
}

/* hover = важно */
.amazon-sort-group:hover {
    border-color: #111;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* icon */
.amazon-sort-icon {
    font-size: 14px;
    color: #111;
}

/* select wrapper */
.amazon-select-wrap {
    position: relative;
}

/* select */
.amazon-sort {
    font-size: 13px;
    font-weight: 600;
    color: #111;

    padding: 4px 20px 4px 4px;

    border: none;
    background: transparent;

    appearance: none;
    cursor: pointer;
}

/* arrow */
.amazon-select-arrow {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);

    width: 0;
    height: 0;

    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #111;

    pointer-events: none;
}

/* MOBILE */
@media (max-width: 768px) {

    .amazon-controls {
    }

    .amazon-category-btn {
        font-size: 12px;
    }

    .amazon-sort {
        font-size: 13px;
    }
}
    color: #111;

    padding: 4px 26px 4px 4px;

    border: none;
    background: transparent;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    cursor: pointer;

    /* стрелка */
    background-image: linear-gradient(45deg, transparent 50%, #111 50%),
                      linear-gradient(135deg, #111 50%, transparent 50%);
    background-position: calc(100% - 12px) calc(50% - 2px),
                         calc(100% - 7px) calc(50% - 2px);
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
}

/* hover = ощущение важности */
.amazon-sort-group:hover {
    border-color: #111;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

/* focus */
.amazon-sort:focus {
    outline: none;
}

/* mobile */
@media (max-width: 768px) {
    .amazon-sort-group {
    }

    .amazon-sort {
        font-size: 13px;
    }
}