/* =============================================
   Perfume ML WooCommerce — Стилі фронтенду
   ============================================= */

.pml-selector-wrap {
    margin: 20px 0 24px;
    padding: 20px;
    background: #fdfaf6;
    border: 1px solid #e8ddd0;
    border-radius: 12px;
    font-family: inherit;
}

/* Залишок */
.pml-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff8f0;
    border: 1px solid #f0d9b5;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 14px;
    color: #7a5c2e;
    margin-bottom: 18px;
}

.pml-stock-badge strong {
    color: #c8612a;
}

/* Лейбл */
.pml-label {
    font-size: 14px;
    font-weight: 600;
    color: #444;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Кнопки вибору мл */
.pml-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.pml-option {
    padding: 8px 20px;
    border: 2px solid #d9c8b0;
    border-radius: 30px;
    background: #fff;
    color: #555;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pml-option:hover {
    border-color: #c8612a;
    color: #c8612a;
    background: #fff8f4;
}

.pml-option.active {
    border-color: #c8612a;
    background: #c8612a;
    color: #fff;
    box-shadow: 0 3px 10px rgba(200, 97, 42, 0.3);
}

.pml-option:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #ddd;
}

/* Бейдж знижки */
.pml-discount-badge {
    display: inline-flex;
    align-items: center;
    background: #e74c3c;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
    letter-spacing: 0.3px;
}

/* Стара/нова ціна */
.pml-old-price {
    font-size: 18px;
    font-weight: 400;
    color: #aaa;
    text-decoration: line-through;
    margin-right: 8px;
}

.pml-new-price {
    text-decoration: none;
    font-size: 28px;
    font-weight: 700;
    color: #e74c3c;
}

/* Ціна */
.pml-price-display {
    font-size: 26px;
    font-weight: 700;
    color: #c8612a;
    margin-bottom: 18px;
    min-height: 36px;
}

.pml-price-display .pml-ml-label {
    font-size: 15px;
    font-weight: 400;
    color: #999;
    margin-left: 6px;
}

/* Кнопка "Весь флакон" */
.pml-buy-whole {
    display: block;
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #7b68ee, #6a5acd);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
    text-align: center;
}

.pml-buy-whole:hover {
    background: linear-gradient(135deg, #6a5acd, #5b4abf);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(106, 90, 205, 0.35);
}

/* Кнопка "В кошик" — стандартна WC */
.single_add_to_cart_button {
    margin-top: 4px;
}

/* Повідомлення якщо не обрано */
.pml-notice {
    display: none;
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 12px;
}

.pml-notice.show {
    display: block;
}

/* Адаптив */
@media (max-width: 480px) {
    .pml-options {
        gap: 8px;
    }
    .pml-option {
        padding: 7px 15px;
        font-size: 14px;
    }
}

/* =============================================
   КАТАЛОГ — картка товару
   ============================================= */

/* Ховаємо стандартну кнопку WC для pml-товарів */
.pml-hidden-btn {
    display: none !important;
}

.pml-card-wrap {
    overflow: visible !important;
    padding: 10px 0 8px;
    position: relative;
}

.pml-card-discount-badge {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 7px;
}

.pml-card-ml-row {
    display: flex;
    overflow: visible;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.pml-card-btn {
    padding: 5px 12px;
    border: 1.5px solid #d9c8b0;
    border-radius: 20px;
    background: #fff;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
    line-height: 1.3;
}

.pml-card-btn:hover {
    border-color: #c8612a;
    color: #c8612a;
}

.pml-card-btn.active {
    border-color: #c8612a;
    background: #c8612a;
    color: #fff;
}

.pml-card-btn.hover-preview:not(.active) {
    border-color: #c8612a;
    color: #c8612a;
    background: #fff8f4;
}

.pml-card-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pml-card-price {
    font-size: 15px;
    min-height: 20px;
    margin-bottom: 5px;
    color: #333;
}

.pml-card-price del {
    color: #aaa;
    font-size: 13px;
    margin-right: 4px;
}

.pml-card-price strong {
    color: #c8612a;
}

.pml-card-feedback {
    font-size: 13px;
    min-height: 18px;
}

/* Плаваючий popup "Додати в кошик" */
.pml-card-atc-popup {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: #fff;
    border: 1.5px solid #e8ddd0;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    white-space: nowrap;
    text-align: center;
    min-width: 180px;
    animation: pml-popup-in 0.18s ease;
}

.pml-card-atc-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: #fff;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.08));
}

.pml-card-atc-popup::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #e8ddd0;
    margin-top: 1px;
}

.pml-card-atc-popup.visible {
    display: block;
}

@keyframes pml-popup-in {
    from { opacity: 0; transform: translateX(-50%) translateY(6px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.pml-card-atc-btn {
    display: inline-block;
    padding: 8px 18px;
    background: #1e140a;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}

.pml-card-atc-btn:hover:not(:disabled) {
    background: #c8612a;
    transform: translateY(-1px);
}

.pml-card-atc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pml-added   { color: #27ae60; }
.pml-error   { color: #e74c3c; }
.pml-adding  { color: #888; }

.pml-cart-link {
    color: #c8612a;
    text-decoration: underline;
    font-weight: 500;
}

/* Ціна / мл у каталозі (якщо залишилась стандартна) */
.pml-price-per-ml-label small {
    font-size: 12px;
    color: #999;
}

/* Підсвітка блоку при кліку на стандартну кнопку */
.pml-card-wrap.pml-highlight {
    outline: 2px solid #c8612a;
    border-radius: 8px;
    animation: pml-pulse 0.4s ease;
}
@keyframes pml-pulse {
    0%   { outline-color: transparent; }
    50%  { outline-color: #c8612a; }
    100% { outline-color: #c8612a; }
}

.pml-sale-total { color: #e74c3c; }

.pml-out-of-stock {
    font-size: 13px;
    color: #aaa;
    font-style: italic;
}

.pml-go-cart {
    color: #c8612a;
    font-weight: 600;
    text-decoration: underline;
}

.pml-per-ml-label {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

.pml-card-old-price {
    font-size: 13px;
    color: #bbb;
    text-decoration: line-through;
    margin-right: 4px;
}

.pml-card-price--default {
    font-size: 16px;
    margin-bottom: 8px;
    line-height: 1.4;
    transition: opacity 0.15s ease;
}

.pml-card-price--selected {
    font-size: 15px;
    margin-bottom: 6px;
    transition: opacity 0.15s ease;
}

/* Скидаємо overflow батьківських елементів WoodMart що обрізають кнопки */
.wd-product .product-wrapper,
.wd-product .product-element-top,
.product-grid-item .product-wrapper {
    overflow: visible !important;
}

/* =============================================
   Кнопка "Переглянути" — оверлей поверх фото
   ============================================= */

.product-element-top {
    position: relative;
}

.pml-hover-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 20, 10, 0.72);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none !important;
    padding: 12px 0;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.28s ease, transform 0.28s ease;
    z-index: 10;
    pointer-events: none;
}

.pml-hover-btn span {
    position: relative;
}

/* Лінія-підкреслення що виїжджає */
.pml-hover-btn span::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    right: 50%;
    height: 1px;
    background: rgba(255,255,255,0.6);
    transition: left 0.25s ease, right 0.25s ease;
}

.wd-product:hover .pml-hover-btn {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.wd-product:hover .pml-hover-btn span::after {
    left: 0;
    right: 0;
}

/* =============================================
   Атрибути товару на картці (при ховері)
   ============================================= */

.pml-card-attrs {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    transition:
        max-height 0.35s ease,
        opacity    0.3s ease 0.05s,
        transform  0.3s ease 0.05s;
    margin-top: 0;
}

.wd-product:hover .pml-card-attrs {
    max-height: 200px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 10px;
}

.pml-card-attrs table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.pml-card-attrs td {
    padding: 2px 0;
    font-size: 12px;
    line-height: 1.6;
    vertical-align: top;
    border: none;
    background: none;
}

.pml-attr-name {
    color: #aaa;
    white-space: nowrap;
    padding-right: 8px !important;
    font-weight: 400;
    width: 1%;
}

.pml-attr-value {
    color: #333;
    font-weight: 500;
}

/* =============================================
   Сторінка товару — дропдауни
   ============================================= */

.pml-field-group {
    margin-bottom: 16px;
}

.pml-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.pml-select-wrap {
    position: relative;
}

.pml-select-wrap::after {
    content: '▾';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #888;
    font-size: 14px;
}

.pml-volume-select,
.pml-flacon-select {
    width: 100%;
    padding: 11px 40px 11px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    color: #333;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
    outline: none;
}

.pml-volume-select:focus,
.pml-flacon-select:focus {
    border-color: #c8612a;
}

.pml-flacon-group {
    margin-top: 4px;
}

#pml_price_display {
    font-size: 20px;
    margin: 4px 0 18px;
    min-height: 28px;
    line-height: 1.3;
}

#pml_price_display .pml-old-price {
    color: #bbb;
    font-size: 15px;
    text-decoration: line-through;
    margin-right: 6px;
}

#pml_price_display .pml-new-price {
    color: #c8612a;
    font-weight: 700;
    font-style: normal;
    text-decoration: none;
}

.pml-add-to-cart-btn {
    width: 100%;
    padding: 15px 24px;
    background: #1e140a;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    margin-bottom: 10px;
}

.pml-add-to-cart-btn:hover:not(:disabled) {
    background: #c8612a;
    transform: translateY(-1px);
}

.pml-add-to-cart-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

#pml_product_feedback {
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.5;
}

#pml_product_feedback .pml-go-cart {
    display: inline-block;
    margin-left: 6px;
    color: #c8612a;
    text-decoration: underline;
    font-weight: 600;
}

.pml-buy-whole {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 1.5px solid #d9c8b0;
    border-radius: 8px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, color 0.2s;
    margin-top: 8px;
}

.pml-buy-whole:hover {
    border-color: #c8612a;
    color: #c8612a;
}

.pml-out-of-stock-msg {
    color: #aaa;
    font-style: italic;
    font-size: 14px;
}

/* =============================================
   Кастомний дропдаун флаконів з фото
   ============================================= */

.pml-flacon-dropdown {
    position: relative;
    user-select: none;
}

.pml-flacon-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 40px 10px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
    min-height: 48px;
    position: relative;
}

.pml-flacon-selected::after {
    content: '▾';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 14px;
    transition: transform 0.2s;
}

.pml-flacon-dropdown.open .pml-flacon-selected {
    border-color: #c8612a;
    border-radius: 8px 8px 0 0;
}

.pml-flacon-dropdown.open .pml-flacon-selected::after {
    transform: translateY(-50%) rotate(180deg);
}

.pml-flacon-sel-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.pml-flacon-sel-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pml-flacon-sel-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.pml-flacon-sel-price {
    font-size: 12px;
    color: #888;
}

.pml-flacon-placeholder {
    font-size: 14px;
    color: #aaa;
}

.pml-flacon-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid #c8612a;
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 100;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    max-height: 280px;
    overflow-y: auto;
}

.pml-flacon-dropdown.open .pml-flacon-options {
    display: block;
}

.pml-flacon-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.pml-flacon-option:hover {
    background: #fdf6f2;
}

.pml-flacon-option img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.pml-flacon-opt-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pml-flacon-opt-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.pml-flacon-opt-price {
    font-size: 12px;
    color: #888;
}

.pml-flacon-none {
    padding: 10px 14px;
    font-size: 13px;
    color: #aaa;
    font-style: italic;
}
