/* Load after the existing storefront style.css.
   Shared theme classes: product, product-picture, product-body, price,
   btn-main, btn-light-custom and catalog-tools.
   All additional rules are scoped to .spice-page. */

.spice-page {
    --spice-ink: var(--ink, #302e24);
    --spice-muted: var(--muted, #858176);
    --spice-orange: var(--orange, #ad4929);
    --spice-olive: var(--olive, #46553a);
    --spice-cream: var(--cream, #f8f5ee);
    --spice-line: var(--line, #eae4d9);
    padding: 28px 0 48px;
    color: var(--spice-ink);
}

.spice-page .spice-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0 27px;
}

.spice-page .spice-eyebrow {
    color: var(--spice-orange);
    font-size: 11px;
}

.spice-page .spice-page-heading h1 {
    font-size: 30px;
    line-height: 1.7;
    margin: 5px 0;
    letter-spacing: -0.6px;
}

.spice-page .spice-page-heading em {
    color: var(--spice-orange);
    font-style: normal;
}

.spice-page .spice-page-heading p {
    margin: 0;
    color: var(--spice-muted);
    font-size: 12px;
}

.spice-page .spice-panel {
    border: 1px solid var(--spice-line);
    border-radius: 14px;
    background: #fffefa;
    box-shadow: 0 6px 24px #302e2405;
    overflow: hidden;
}

.spice-page .spice-panel-heading {
    padding: 18px 20px;
    background: var(--spice-cream);
    color: var(--spice-olive);
    border-bottom: 1px solid var(--spice-line);
}

.spice-page .spice-panel-heading h2,
.spice-page .spice-panel-heading h6 {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
}

.spice-page .card-body {
    padding: 22px;
}

.spice-page .btn-main,
.spice-page .btn-light-custom {
    border-radius: 8px;
    line-height: 1.8;
    font-family: inherit;
}

.spice-page button.btn-main {
    border: 1px solid transparent;
}

.spice-page .btn-main:disabled,
.spice-page .btn-main[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.spice-page .form-control,
.spice-page .form-select {
    font: inherit;
    font-size: 12px;
    line-height: 1.9;
    min-height: 43px;
    border: 1px solid var(--spice-line);
    border-radius: 8px;
    background-color: #fff;
    color: var(--spice-ink);
}

.spice-page .form-control:focus,
.spice-page .form-select:focus {
    border-color: #b2bd9f;
    box-shadow: 0 0 0 3px #46553a12;
}

.spice-page a:focus-visible,
.spice-page button:focus-visible {
    outline: 3px solid #d8a449;
    outline-offset: 3px;
}

/* Category menu and search sidebar */
.spice-page .spice-category-menu {
    padding: 13px 16px;
    font-size: 12px;
}

.spice-page .spice-category-menu ul {
    list-style: none;
    padding-inline-start: 14px;
    margin: 0;
}

.spice-page .spice-category-menu > ul {
    padding-inline-start: 0;
}

.spice-page .spice-category-menu li {
    margin: 4px 0;
}

.spice-page .spice-category-menu a {
    display: block;
    border-radius: 6px;
    padding: 7px 9px;
    color: var(--spice-olive);
    text-decoration: none;
}

.spice-page .spice-category-menu a:hover {
    color: var(--spice-orange);
    background: var(--spice-cream);
}

.spice-page .spice-filter-form {
    padding: 10px;
}

.spice-page .spice-filter-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--spice-line);
    border-radius: 8px;
    padding: 12px;
}

.spice-page .spice-filter-switch h6 {
    margin: 0;
    font-size: 12px;
}

.spice-page .switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 21px;
    margin: 0;
    flex-shrink: 0;
}

.spice-page .switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    z-index: 2;
    cursor: pointer;
}

.spice-page .switch .slider {
    position: absolute;
    inset: 0;
    background: #dfdfd4;
    border-radius: 20px;
    transition: background 0.2s;
}

.spice-page .switch .slider::before {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    top: 3px;
    left: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.spice-page .switch input:checked + .slider {
    background: var(--spice-olive);
}

.spice-page .switch input:checked + .slider::before {
    transform: translateX(15px);
}

.spice-page .switch input:focus-visible + .slider {
    outline: 3px solid #d8a449;
    outline-offset: 3px;
}

.spice-page .spice-price-filter {
    border: 1px solid var(--spice-line);
    background: var(--spice-cream);
    border-radius: 8px;
    padding: 14px 12px 8px;
    font-size: 11px;
}

.spice-page .form-range::-webkit-slider-thumb { background: var(--spice-olive); }
.spice-page .form-range::-moz-range-thumb { background: var(--spice-olive); }

/* Catalog and product cards */
.spice-page .spice-sortbar {
    padding: 17px 20px;
    border: 1px solid var(--spice-line);
    border-radius: 12px;
    background: #fffefa;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    margin: 0;
}

.spice-page .spice-sort-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin: 0;
    padding: 0;
}

.spice-page .spice-sort-links li {
    color: #c7bcab;
}

.spice-page .spice-sort-links a {
    display: inline-block;
    padding: 4px 0;
    color: var(--spice-muted);
}

.spice-page .spice-sort-links a:hover {
    color: var(--spice-orange);
}

.spice-page .spice-product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.spice-page .spice-product-card .product-picture {
    min-height: 180px;
    height: auto;
    aspect-ratio: 1.1;
    padding: 22px;
    background: var(--spice-cream);
}

.spice-page .spice-product-card .product-picture img {
    width: 100%;
    height: 100%;
    max-width: 175px;
    max-height: 175px;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 12px;
    border: 0;
    box-shadow: none;
}

.spice-page .spice-product-card .product-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 17px;
}

.spice-page .spice-product-title {
    font-size: 13px;
    line-height: 1.9;
    height: auto;
    min-height: 3.8em;
    margin: 0;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.spice-page .spice-product-card .product-bottom {
    margin-top: auto !important;
    padding-top: 14px;
}

.spice-page .spice-price {
    color: var(--spice-olive);
    font-size: 13px;
    font-weight: 700;
    white-space: normal;
}

.spice-page .spice-pagination .pagination {
    flex-wrap: wrap;
    gap: 6px;
}

.spice-page .pagination a,
.spice-page .pagination .page-link {
    color: var(--spice-olive);
    background: #fffefa;
    border: 1px solid var(--spice-line);
    border-radius: 7px;
}

.spice-page .pagination .active > .page-link,
.spice-page .pagination .active > a {
    background: var(--spice-olive);
    border-color: var(--spice-olive);
    color: #fff;
}

.spice-page .spice-empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--spice-muted);
    font-size: 13px;
}

.spice-page .spice-empty-state img {
    width: min(240px, 80%);
    height: auto;
    max-height: 240px;
    object-fit: contain;
    margin-bottom: 20px;
}

/* Basket: keep the original .price, .count, .total and summary JS hooks. */
.spice-page .spice-basket-table-wrap {
    border: 1px solid var(--spice-line);
    border-radius: 10px;
    overflow-x: auto;
}

.spice-page .spice-basket-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--spice-ink);
    --bs-table-border-color: var(--spice-line);
    font-size: 12px;
    margin: 0;
    vertical-align: middle;
    min-width: 600px;
}

.spice-page .spice-basket-table th {
    background: var(--spice-cream);
    color: var(--spice-olive);
    font-size: 11px;
    padding: 15px 10px;
    white-space: nowrap;
    border-bottom: 1px solid var(--spice-line);
}

.spice-page .spice-basket-table td {
    padding: 17px 10px;
    border-bottom: 1px solid var(--spice-line);
}

.spice-page .spice-basket-table tr:last-child td {
    border-bottom: 0;
}

.spice-page .spice-basket-title {
    min-width: 170px;
    font-weight: 700;
    line-height: 2;
}

.spice-page .spice-money-input {
    width: 100px;
    min-width: 80px;
    max-width: 115px;
    padding: 4px 0;
    border: 0;
    outline: 0;
    border-radius: 0;
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    text-align: center;
    color: var(--spice-olive);
    -webkit-text-fill-color: var(--spice-olive);
    opacity: 1;
}

.spice-page .spice-quantity {
    width: 80px;
    min-width: 70px;
    text-align: center;
    direction: ltr;
    padding: 5px;
    min-height: 38px;
}

.spice-page .spice-remove-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #faeee7;
    color: var(--spice-orange);
    text-decoration: none;
}

.spice-page .spice-remove-item .text-danger {
    color: var(--spice-orange) !important;
}

.spice-page .spice-order-summary {
    --bs-table-bg: transparent;
    --bs-table-color: var(--spice-muted);
    --bs-table-border-color: var(--spice-line);
    margin-bottom: 12px;
    font-size: 12px;
}

.spice-page .spice-order-summary td {
    padding: 16px 0;
    vertical-align: middle;
}

.spice-page .spice-order-summary td:last-child {
    padding-inline-start: 10px;
    color: var(--spice-olive);
    font-weight: 700;
}

.spice-page .spice-order-summary tr:last-child td {
    border-bottom: 0;
    color: var(--spice-olive);
    font-weight: 700;
}

.spice-page .spice-delivery {
    margin-top: 10px;
    width: 100%;
    min-width: 145px;
    font-size: 11px;
}

/* Product details */
.spice-page .spice-breadcrumb-panel {
    padding: 15px 20px;
}

.spice-page .spice-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
    font-size: 11px;
    line-height: 2;
    color: var(--spice-muted);
}

.spice-page .spice-breadcrumb h1 {
    font-size: 12px;
    letter-spacing: 0;
    margin: 0;
    line-height: 2;
}

.spice-page .spice-breadcrumb a {
    color: var(--spice-olive);
}

.spice-page .spice-gallery {
    border: 1px solid var(--spice-line);
    background: var(--spice-cream);
    border-radius: 12px;
    overflow: hidden;
}

.spice-page .spice-detail-image {
    aspect-ratio: 1;
    object-fit: contain;
    padding: 22px;
    max-height: 440px;
    border: 0;
}

.spice-page .spice-gallery .carousel-control-prev,
.spice-page .spice-gallery .carousel-control-next {
    width: 38px;
    height: 38px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    margin-inline: 10px;
    border-radius: 50%;
    background: var(--spice-olive);
    opacity: 0.85;
}

.spice-page .spice-gallery .carousel-control-prev-icon,
.spice-page .spice-gallery .carousel-control-next-icon {
    width: 15px;
    height: 15px;
}

.spice-page .spice-product-facts {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 12px;
    line-height: 2.1;
}

.spice-page .spice-product-facts li {
    padding: 11px 0 !important;
    border-bottom: 1px solid var(--spice-line);
    color: var(--spice-muted);
}

.spice-page .spice-product-facts b {
    color: var(--spice-olive);
}

.spice-page .spice-detail-intro > p {
    font-size: 13px;
    line-height: 2.2;
    color: var(--spice-muted);
}

.spice-page .spice-detail-intro > hr {
    display: none;
}

.spice-page .spice-purchase-panel {
    background: var(--spice-cream);
    border: 1px solid var(--spice-line);
    border-radius: 12px;
    padding: 20px 17px;
    font-size: 11px;
    line-height: 2.1;
}

.spice-page .spice-purchase-panel p {
    margin-bottom: 12px;
}

.spice-page .spice-purchase-panel i.fa-check {
    color: var(--spice-olive);
    margin-inline-end: 4px;
}

.spice-page .spice-purchase-panel .btn-main {
    width: 100%;
    margin-top: 18px;
    font-size: 13px;
}

.spice-page .spice-cart-message,
.spice-page .spice-comment-item {
    background: #eff2e8;
    border: 1px solid #dbe3ce;
    border-radius: 10px;
    color: var(--spice-olive);
}

.spice-page .spice-cart-message {
    padding: 13px;
    margin-top: 14px;
    font-size: 11px;
}

.spice-page .spice-cart-message a,
.spice-page .spice-login-message a {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.spice-page .spice-section-heading {
    font-size: 16px;
    color: var(--spice-orange);
    margin: 24px 0 14px;
    font-weight: 700;
    line-height: 1.9;
}

.spice-page .spice-richtext {
    font-size: 13px;
    line-height: 2.3;
    color: var(--spice-muted);
    overflow-wrap: anywhere;
}

.spice-page .spice-more-link {
    margin-top: 10px;
}

.spice-page .spice-specifications .table {
    --bs-table-striped-bg: var(--spice-cream);
    --bs-table-border-color: var(--spice-line);
    --bs-table-color: var(--spice-ink);
    font-size: 12px;
    margin: 12px 0 0;
}

/* These classes are emitted by the existing PHP; keep the PHP unchanged. */
.spice-page .spice-specifications .bg-primary {
    background-color: var(--spice-olive) !important;
    padding: 14px;
}

.spice-page .spice-specifications td {
    padding: 12px;
}

.spice-page .spice-section-divider {
    padding-block: 30px 20px;
    color: var(--spice-olive);
}

.spice-page .spice-section-divider h6 {
    margin: 0;
    font-size: 15px;
}

.spice-page hr {
    border-color: var(--spice-line);
    opacity: 1;
}

.spice-page .spice-related {
    padding: 0;
}

.spice-page .spice-related-item {
    padding: 5px 2px 14px;
    height: 100%;
}

.spice-page .spice-related .owl-stage {
    display: flex;
}

.spice-page .spice-related .owl-item {
    display: flex;
    flex-shrink: 0;
    height: auto;
}

.spice-page .spice-related .owl-item > .spice-related-item {
    width: 100%;
}

.spice-page .spice-related .owl-carousel:not(.owl-loaded) {
    display: flex;
    gap: 16px;
    overflow-x: auto;
}

.spice-page .spice-related .owl-carousel:not(.owl-loaded) > .spice-related-item {
    flex: 0 0 210px;
}

.spice-page .spice-related-discount {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spice-page .spice-related-price .old {
    font-size: 10px;
    color: var(--spice-muted);
    line-height: 1.8;
    height: auto;
}

.spice-page .spice-comment-body {
    padding: 25px;
}

.spice-page .spice-comment-body > h6 {
    margin-top: 0;
}

.spice-page .spice-comment-body > p {
    font-size: 12px;
    color: var(--spice-muted);
    line-height: 2.1;
}

.spice-page .spice-comment-body > p i {
    color: var(--spice-olive);
    margin-inline-end: 5px;
}

.spice-page .spice-comment-item {
    padding: 18px;
    margin: 0 0 12px;
    font-size: 12px;
}

.spice-page .spice-comment-item h6 {
    font-size: 13px;
    margin-bottom: 12px;
}

.spice-page .spice-comment-item p {
    line-height: 2.1;
    overflow-wrap: anywhere;
}

.spice-page .spice-comment-item span {
    display: block;
    float: none !important;
    font-size: 10px;
    color: var(--spice-muted);
    text-align: end;
}

.spice-page .spice-comment-input {
    max-width: 100%;
    width: 100%;
    resize: vertical;
    padding: 15px;
}

.spice-page .spice-login-message {
    border: 1px solid #eadfcd;
    border-radius: 9px;
    background: #f8f0e5;
    color: #86633e;
    font-size: 12px;
}

@media (max-width: 767px) {
    .spice-page { padding-top: 18px; }
    .spice-page .spice-page-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
    .spice-page .spice-page-heading h1 { font-size: 26px; }
    .spice-page .spice-page-heading p { font-size: 11px; }
    .spice-page .card-body { padding: 16px; }
    .spice-page .spice-sortbar { padding: 14px; font-size: 10px; }
    .spice-page .spice-sort-links { gap: 5px 9px; }
    .spice-page .spice-product-card .product-picture { min-height: 135px; padding: 15px; }
    .spice-page .spice-product-card .product-body { padding: 13px; }
    .spice-page .spice-product-title { font-size: 12px; }
    .spice-page .spice-price { font-size: 12px; }
    .spice-page .spice-breadcrumb-panel { padding: 12px; }
    .spice-page .spice-detail-image { max-height: 350px; }
    .spice-page .spice-purchase-panel { padding: 20px; font-size: 12px; }
    .spice-page .spice-section-divider { padding-top: 25px; }
    .spice-page .spice-comment-body { padding: 18px; }
    .spice-page .spice-empty-state { padding: 25px 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .spice-page *, .spice-page *::before, .spice-page *::after {
        transition: none !important;
    }
}
