/* ============================================================
   Box Selector – Shared styles for Macaron & Cookie Boxes
   ============================================================ */

#jadore-macaron-selector,
#jadore-cookie-selector {
    margin: 20px 0;
    padding: 25px;
    background: #faf9f7;
    border: 1px solid #e8e4de;
    border-radius: 10px;
}

.jadore-macaron-info,
.jadore-box-info {
    font-size: 1.05em;
    font-weight: 600;
    margin-bottom: 18px;
    color: #2c2c2c;
}

.jadore-macaron-grid,
.jadore-box-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    margin-bottom: 20px;
}

/* Higher specificity fallback */
#jadore-macaron-selector .jadore-box-grid,
#jadore-cookie-selector .jadore-box-grid,
.woocommerce div.product form.cart .jadore-box-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
}

.jadore-macaron-item,
.jadore-box-item {
    border: 2px solid #e8e4de;
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    background: #fff;
    cursor: pointer;
}

.jadore-macaron-item:hover,
.jadore-box-item:hover {
    border-color: #c9a96e;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}

.jadore-macaron-item.selected,
.jadore-box-item.selected {
    border-color: #c9a96e;
    box-shadow: 0 0 0 1px #c9a96e, 0 3px 10px rgba(201,169,110,0.15);
    background: #fdf8f0;
}

.jadore-macaron-item img,
.jadore-box-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 10px;
}

.jadore-macaron-placeholder,
.jadore-box-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5e6d3, #e8d5c4);
    margin: 0 auto 10px;
}

.jadore-macaron-name,
.jadore-box-name {
    font-weight: 600;
    font-size: 0.88em;
    margin-bottom: 4px;
    min-height: 2.4em;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2c2c2c;
    line-height: 1.3;
}

.jadore-macaron-price,
.jadore-box-price {
    color: #b08d4f;
    font-size: 0.85em;
    font-weight: 500;
    margin-bottom: 10px;
}

/* Quantity controls */
.jadore-macaron-qty,
.jadore-box-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.jadore-qty-minus,
.jadore-qty-plus {
	background-color: #f1e1ce;
    width: 28px;
    height: 28px;
    background: #fff;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    display: inherit;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    user-select: none;

}

.jadore-qty-minus {
    border-radius: 6px 0 0 6px;
}

.jadore-qty-plus {
    border-radius: 0 6px 6px 0;
}

.jadore-qty-minus:hover,
.jadore-qty-plus:hover {
  background: #0e0d67 !important;
  border-color: #fff !important;
  color: #fff !important;
}

.jadore-qty-minus:active,
.jadore-qty-plus:active {
    background: #b08d4f;
    border-color: #b08d4f;
    color: #fff;
}

.jadore-qty-minus:disabled,
.jadore-qty-plus:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
}

.jadore-qty-input {
    width: 44px;
    height: 28px;
	padding: 1rem 1rem!important;
    text-align: center;
    border: 1.5px solid #e8e4de!important;
    border-left: none;
    border-right: none;
    font-size: 0.9em;
    font-weight: 600;
    -moz-appearance: textfield;
    appearance: textfield;
    background: #fff;
    color: #2c2c2c;
}

.jadore-qty-input::-webkit-outer-spin-button,
.jadore-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Hide default WooCommerce quantity input when box selector is present */
.jadore-box-selector ~ .quantity,
.jadore-box-selector ~ .cart .quantity {
    display: none !important;
}

/* Summary bar */
.jadore-macaron-summary,
.jadore-box-summary {
    padding: 14px 18px;
    background: #fff;
    border-radius: 8px;
    font-size: 0.95em;
    text-align: center;
    margin-bottom: 15px;
    border: 1.5px solid #e8e4de;
    color: #444;
}

.jadore-selected-count {
    font-weight: 700;
    font-size: 1.15em;
    color: #c9a96e;
}

.jadore-macaron-summary.complete,
.jadore-box-summary.complete {
    background: #f0f8e8;
    border-color: #8bc34a;
}

.jadore-macaron-summary.over,
.jadore-box-summary.over {
    background: #fde8e8;
    border-color: #f44336;
}

.jadore-total-price {
    font-weight: 700;
    color: #b08d4f;
}

/* Macaron boxes: wider grid when space allows (16 flavors) */
@media (min-width: 601px) {
    #jadore-macaron-selector .jadore-macaron-grid,
    #jadore-macaron-selector .jadore-box-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    }
}

@media (max-width: 600px) {
    .jadore-macaron-grid,
    .jadore-box-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .jadore-macaron-item,
    .jadore-box-item {
        padding: 10px 8px;
    }

    .jadore-macaron-item img,
    .jadore-box-item img,
    .jadore-macaron-placeholder,
    .jadore-box-placeholder {
        width: 60px;
        height: 60px;
    }

    #jadore-macaron-selector,
    #jadore-cookie-selector {
        padding: 15px;
    }

    /* Larger touch targets on mobile (min 44px recommended) */
    .jadore-qty-minus,
    .jadore-qty-plus {
        width: 36px;
        height: 36px;
        font-size: 1.2em;
    }

    .jadore-qty-input {
        height: 36px;
        width: 44px;
    }
}

/* ============================================================
   Box Selector – Shared styles for Macaron & Cookie Boxes
   ============================================================ */

#jadore-macaron-selector,
#jadore-cookie-selector {
    margin: 20px 0;
    padding: 25px;
    background: #faf9f7;
    border: 1px solid #e8e4de;
    border-radius: 10px;
}

/* Neue Button-Stile */
[type="button"], [type="submit"], button {
  background-color: #ecdbc9!important;
  color: black !important;
  border: none!important;
  border-radius: 3px!important;
  display: inherit!important;
  font-size: 1rem;
  font-weight: 700!important;
  padding: 1rem 1rem!important;
  text-align: center;
  transition: all .3s;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  white-space: nowrap;
}