/* Product families and purchase controls */
.perfume-purchase-panel {
    border: 1px solid #e2e1dc;
    border-radius: 14px;
    padding: clamp(16px, 2.2vw, 34px);
    background: #fff;
}
.product-detail-page .perfume-purchase-panel .pdp-pricing {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}
.perfume-purchase-panel .pdp-price { margin: 0; }
.product-detail-page #product-actions .action-row { display: flex; }
.product-detail-page #product-actions #whatsapp-order-button {
    width: 100%;
    background: #171717 !important;
    border-color: #171717 !important;
    color: #fff !important;
}
.product-detail-page #product-actions .primary-purchase-row .primary-add-cart[data-add],
.product-detail-page #product-actions .primary-purchase-row .primary-add-cart[data-add]:hover:not(:disabled),
.product-card .quick-add[data-add]:not(:disabled),
.product-card .quick-add[data-add]:hover:not(:disabled) {
    background: #C6F535 !important;
    color: #000 !important;
    border-color: #C6F535 !important;
    box-shadow: none !important;
}
.product-card.home-perfume-card .product-name { display: block; text-align: center !important; }
.perfume-swatches {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: 10px 0 16px;
}
.perfume-swatches a {
    box-sizing: border-box;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    padding: 3px;
    background: white;
    border: 1px solid #dcdcd7;
    border-radius: 50%;
    overflow: hidden;
}
.perfume-swatches a[aria-current], .perfume-swatches a:hover { border: 2px solid #242424; padding: 2px; }
.perfume-swatches img { width: 100%; height: 100%; min-height: 0; object-fit: contain; border-radius: 50%; }
.home-perfume-card .perfume-swatches { justify-content: center; margin: 4px 10px 12px; gap: 4px; }
.home-perfume-card .perfume-swatches a { width: 34px; height: 34px; }
.perfume-swatches a:focus-visible, #perfume-cart :focus-visible { outline: 2px solid #3062ab; outline-offset: 2px; }

/* Native modal keeps keyboard focus and background interaction inside the cart. */
html.perfume-cart-open { overflow: hidden; }
#perfume-cart {
    position: fixed; inset: 0 0 0 auto; box-sizing: border-box;
    width: min(480px, 92vw); height: 100%; height: 100dvh;
    max-width: 100vw; max-height: none; margin: 0 0 0 auto;
    border: 0; border-radius: 0; padding: 0; background: #fff; color: #171717;
}
#perfume-cart:not([open]), #perfume-cart [hidden] { display: none !important; }
#perfume-cart[open] { animation: perfume-bag-in .24s ease-out; }
#perfume-cart::backdrop { background: rgb(15 15 15 / 46%); }
@keyframes perfume-bag-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { #perfume-cart[open] { animation: none; } }
.bag-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.bag-head, .bag-foot { padding: 18px clamp(14px, 4vw, 26px); background: #fff; }
#perfume-cart .bag-head { position: static; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e6e6e2; }
.bag-head h2 { margin: 0; font-size: 24px; }
.bag-head button, .bag-controls button { border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; }
.bag-head button { font-size: 27px; width: 44px; height: 44px; }
.bag-list { overflow: auto; overscroll-behavior: contain; padding: 0 clamp(12px, 3vw, 24px); }
.bag-line { display: grid; grid-template-columns: 56px minmax(0,1fr) auto; gap: 12px; padding: 18px 0; border-bottom: 1px solid #eee; }
.bag-thumb { width: 56px; height: 72px; object-fit: contain; }
.bag-name, .bag-info small { display: block; overflow-wrap: anywhere; }
.bag-info small { color: #62625d; margin-top: 4px; }
.bag-line-total, .bag-name { font-size: 14px; }
.bag-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.bag-controls button { min-width: 32px; min-height: 36px; border: 1px solid #deded9; border-radius: 9px; }
.bag-controls button:disabled { opacity: .4; }
.bag-controls button:last-child { border: none; font-size: 12px; text-decoration: underline; }
.bag-controls span { min-width: 16px; text-align: center; }
.bag-foot { border-top: 1px solid #deded9; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.bag-total { display: flex; justify-content: space-between; gap: 14px; }
.bag-foot p { font-size: 13px; margin: 6px 0 14px; }
.bag-foot [role=status]:empty { display: none; }
.bag-checkout { display: block; padding: 14px; text-align: center; background: #171717; color: #fff !important; border-radius: 10px; }
.bag-empty { margin: 20px 0; }
@media (max-width: 460px) {
    .perfume-purchase-panel { padding: 14px; }
    .product-detail-page #product-actions .primary-purchase-row { grid-template-columns: minmax(98px, 34%) minmax(0,1fr) !important; }
    .bag-line { grid-template-columns: 42px minmax(0,1fr) auto; gap: 7px; }
    .bag-thumb { width: 42px; }
    .bag-line-total { font-size: 12px; }
}

/* Visible catalogue actions and the homepage collection link. */
.standalone-search .btn-dark-pill,
.standalone-search .btn-dark-pill:hover,
.view-all-wrap .btn-dark-pill,
.view-all-wrap .btn-dark-pill:hover {
    background: #171717 !important;
    border-color: #171717 !important;
    color: #fff !important;
}
.bag-recovery {
    display: inline-block;
    margin: 24px 0;
    text-decoration: underline;
}

/* Keep a grouped homepage card to one compact row at either viewport size. */
.home-perfume-card .home-swatches {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    width: auto;
    --home-swatch-size: min(34px, calc(16.666% - 4px));
}
.home-perfume-card .home-swatches a,
.home-perfume-card .home-swatches .home-more {
    box-sizing: border-box;
    flex: 0 0 var(--home-swatch-size);
    width: var(--home-swatch-size);
    height: auto;
    aspect-ratio: 1;
    align-self: center;
    min-width: 0;
    min-height: 0;
    border-radius: 50%;
}
.home-perfume-card .home-swatches img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
}
.home-swatches .home-more {
    display: grid;
    place-items: center;
    padding: 0;
    background: #fff;
    border: 1px solid #e1e3e6;
    box-shadow: 0 3px 9px rgb(18 20 25 / 12%);
    color: #171717;
    font-family: inherit;
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
}
.home-swatches .home-more:hover { border-color: #171717; }
.home-swatches .mobile-more { display: none; }
.perfume-group-popover:not(:popover-open) { display: none !important; }
.perfume-group-popover:popover-open {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    display: block;
    width: min(680px, calc(100vw - 24px));
    max-width: none;
    max-height: min(620px, 85dvh);
    margin: auto;
    padding: 20px;
    overflow: auto;
    border: 1px solid #e4e4e2;
    border-radius: 20px;
    background: #fff;
    color: #171717;
    box-shadow: 0 22px 60px rgb(0 0 0 / 19%);
}
.perfume-group-popover::backdrop { background: rgb(15 15 15 / 44%); }
.perfume-group-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.perfume-group-popover-head strong { font-size: 19px; }
.perfume-group-popover-head button { width: 36px; height: 36px; border: 0; background: transparent; color: #171717; font-size: 26px; cursor: pointer; }
.perfume-group-popover-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.perfume-group-popover-grid a {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    padding: 9px;
    border: 1px solid #e6e6e3;
    border-radius: 12px;
    color: #171717;
    text-align: center;
    text-decoration: none;
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.perfume-group-popover-grid a[aria-current="page"],
.perfume-group-popover-grid a:hover { border-color: #171717; }
.perfume-group-popover-grid img { width: 58px; height: 58px; object-fit: contain; }
.home-swatches .home-more:focus-visible,
.perfume-group-popover :focus-visible { outline: 2px solid #3062ab; outline-offset: 2px; }
@media (max-width: 767px) {
    .home-perfume-card .home-swatches {
        gap: 3px;
        --home-swatch-size: min(31px, calc(25% - 3px));
    }
    .home-perfume-card .home-swatches .home-hide-mobile,
    .home-swatches .desktop-more { display: none; }
    .home-swatches .mobile-more { display: grid; }
    .perfume-group-popover:popover-open { padding: 14px; }
    .perfume-group-popover-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
