/* ============================================================
   Single Product Page
   ============================================================ */

.icon::before {
    display: inline-block;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

/* --- General Layout --- */
.scwp-container {
    max-width: 1100px;
    margin: 2em auto;
    padding: 0 15px;
    font-family: "source-sans-pro", "PT Sans", Calibri, Roboto, Arial, sans-serif;
    color: #333;
}
.scwp-go-back {
    display: inline-block;
    margin-bottom: 2em;
    color: #000;
    text-decoration: none;
    font-family: revert;
    font-weight: bold;
    font-size: 0.9em;
}
.scwp-go-back i { color: var(--scwp-brand-color, #067D44); margin-right: 10px; }
.scwp-go-back:hover { color: var(--scwp-brand-color, #067D44); }
.scwp-product-layout { display: flex; flex-wrap: wrap; gap: 60px; }
.scwp-gallery { flex: 1; min-width: 350px; }
.scwp-details { flex: 1; min-width: 350px; }

/* --- Gallery --- */
.scwp-main-image img { border: 1px solid #eee; }
.scwp-thumbnails { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 15px; }
.scwp-thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    transition: border-color 0.2s;
    border: 1px solid #ddd;
}
.scwp-thumbnails a:hover img { border-color: var(--scwp-brand-color, #067D44); }

/* --- Details --- */
.scwp-details .entry-title {
    font-size: 25px;
    font-weight: 700;
    line-height: 1.1;
    margin-top: 0;
    margin-bottom: 1rem;
    color: #000;
    font-family: revert;
}
.scwp-details .price {
    color: var(--scwp-brand-color, #067D44);
    font-family: revert;
    font-size: 1.5rem;
    font-weight: 500;
    margin-top: 0;
}
.scwp-details .description {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
.scwp-details .description p { margin-top: 0; }
.scwp-options label {
    font-weight: normal;
    display: block;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #000;
}
.scwp-options select {
    appearance: none;
    padding: 5px 30px 5px 10px;
    background-color: #fff;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 24 24"><path fill="%23067D44" d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    border: 2px solid #979797;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
}
.scwp-qty-control {
    display: flex;
    align-items: stretch;
    border: 1px solid #979797;
    min-height: 46px;
}
.scwp-qty-btn {
    background: #fff;
    border: none;
    width: 28px;
    font-size: 1em;
    cursor: pointer;
    line-height: 1;
    color: #333;
    flex-shrink: 0;
    padding: 0;
}
.scwp-qty-btn:hover { background: #f5f5f5; }
.scwp-options input[type="number"] {
    width: 36px;
    text-align: center;
    padding: 0 4px;
    border: none;
    border-left: 1px solid #979797;
    border-right: 1px solid #979797;
    margin-bottom: 0;
    -moz-appearance: textfield;
}
.scwp-options input[type="number"]::-webkit-inner-spin-button,
.scwp-options input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.scwp-actions { display: flex; gap: 10px; margin-top: 20px; flex-grow: 1; }
.scwp-actions .button {
    padding: 5px;
    font-size: 1em;
    font-weight: lighter;
    cursor: pointer;
    border: 1px solid var(--scwp-brand-color, #067D44);
    flex-grow: 1;
    text-align: center;
    text-transform: uppercase;
    min-height: 46px;
}
#add-to-cart-btn { background: #fff; color: #000; }
#buy-now-btn { background: var(--scwp-brand-color, #067D44); color: #fff; }
#buy-now-btn:hover {
    background-color: #ffffff;
    color: var(--scwp-brand-color, #067D44);
    outline: none;
    text-decoration: none;
    cursor: pointer;
}

/* --- Features --- */
.scwp-features { margin-top: 2.5em; }
.scwp-features h3 {
    font-size: 1.5em;
    font-weight: 600;
    font-family: "Open Sans";
}
.scwp-features p {
    margin-top: 1.18750rem;
    margin-bottom: 1.18750rem;
}
.scwp-features ul { list-style: none; padding: 0; margin: 0; }
.scwp-features li { padding-left: 35px; position: relative; margin-bottom: 1em; line-height: 1.6; }
.scwp-features li::before {
    content: '\f35a';
    font-family: 'Font Awesome 6 Free';
    position: absolute;
    left: 0; top: 0;
    color: var(--scwp-brand-color, #067D44);
    font-weight: bold;
    font-size: 1em;
    padding-top: 0.1em;
}

/* --- Product Info Accordion --- */
.scwp-product-info { margin-top: 2.5em; border-top: 1px solid #eee; padding-top: 1.5em; }
.scwp-info-toggle {
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.scwp-info-toggle .arrow { transition: transform 0.3s; }
.scwp-info-toggle.active .arrow { transform: rotate(180deg); }
.scwp-info-content { display: none; margin-top: 1em; padding-top: 1em; }
.scwp-specs-table { width: 100%; text-align: left; border-collapse: collapse; }
.scwp-specs-table tr { border-bottom: 1px solid #eee; }
.scwp-specs-table th, .scwp-specs-table td { padding: 12px 8px; }
.scwp-specs-table th { width: 40%; font-weight: bold; }

/* --- Related Products Slider --- */
.scwp-related-products { margin-top: 4em; position: relative; }
.scwp-related-products h2 {
    font-size: 1.8em;
    font-weight: 600;
    font-family: "Open Sans";
    text-align: left;
    position: relative;
    padding-bottom: 30px;
    margin-bottom: 0;
}
.scwp-related-products hr {
    border-top: 2px solid #C8C8C8;
    margin-top: 0;
}
.scwp-related-slider .swiper-slide { text-align: center; }
.scwp-related-slider a { text-decoration: none; color: #333; }
.scwp-related-slider img { width: 100%; height: auto; margin-bottom: 0.5em; }
.scwp-related-slider h4 { margin: 0; font-size: 1em; font-weight: 600; }
.scwp-related-slider.swiper {
    overflow: hidden;
    padding: 0 50px;
}
.scwp-related-slider .swiper-wrapper { display: flex; }
.scwp-related-slider .swiper-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    position: relative;
}

/* --- Swiper Arrow Styles --- */
.swiper-button-next, .swiper-button-prev {
    position: absolute;
    top: 50%;
    width: 60px;
    height: 60px;
    margin-top: -30px;
    z-index: 10;
    cursor: pointer;
    background-size: 30px 30px;
    background-position: center;
    background-repeat: no-repeat;
}
.swiper-button-prev {
    left: -15px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%2317a2b8'%2F%3E%3C%2Fsvg%3E");
}
.swiper-button-next {
    right: -15px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%2317a2b8'%2F%3E%3C%2Fsvg%3E");
}

/* ============================================================
   Product Grid Block
   ============================================================ */

/* --- Product Grid Container --- */
.scwp-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: auto;
    padding-bottom: 10rem;
}

/* --- Individual Product Card --- */
.scwp-product-card {
    background-color: transparent;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.scwp-product-card:hover {
    transform: translateY(-3px);
}

.scwp-card-link {
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* --- Product Image --- */
.scwp-card-image {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px;
}

.scwp-card-image img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* --- Product Content (Title & Price) --- */
.scwp-card-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* --- Product Content (Title & Price) --- */
.scwp-card-title {
    font-size: 1em;
    margin: 0 0 8px 0;
    line-height: 1.3;
    color: var(--scwp-brand-color, #067D44);
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scwp-card-price {
    font-size: 1.1em;
    font-weight: bold;
    color: #000;
    margin: 0;
}

.scwp-card-price .price-prefix {
    font-size: 0.9em;
    font-weight: normal;
    color: #888888;
}

/* --- NEW Badge --- */
.scwp-product-card .scwp-badge-new {
    position: absolute;
    left: -5px;
    background-color: #f8d400;
    color: #333;
    padding: 8px 12px;
    font-size: 0.9em;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 10;
    clip-path: polygon(0% 0%, 100% 0%, 100% 70%, 90% 100%, 80% 70%, 70% 100%, 60% 70%, 50% 100%, 40% 70%, 30% 100%, 20% 70%, 10% 100%, 0% 70%);
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .scwp-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 576px) {
    .scwp-product-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* --- Editor-specific styles for better preview --- */
.wp-block[data-type="acf/scwp-product-grid"] .scwp-product-grid {
    border: 1px dashed #cccccc; /* Outline for the block in editor */
    padding: 15px;
}

.wp-block[data-type="acf/scwp-product-grid"] .scwp-product-grid .scwp-product-card {
    border: 1px solid #e0e0e0;
    box-shadow: none;
    transform: none;
}
.wp-block[data-type="acf/scwp-product-grid"] .scwp-card-link {
    pointer-events: none;
    cursor: default;
}

/* Placeholder for when no products are selected in editor */
.wp-block[data-type="acf/scwp-product-grid"] p {
    color: #555;
}