/*
Theme Name: Kandyz Child Theme
Description: Child theme for Kandyz Marketing with custom WooCommerce checkout
Template: twentytwentyfive
Version: 1.0.0
*/

/* Import parent theme styles */
@import url("../twentytwentyfive/style.css");

/* ========================================
   WOOCOMMERCE CHECKOUT CUSTOMIZATION
   ======================================== */

/* Hide shipping and additional fields on classic checkout */
.woocommerce-checkout .woocommerce-shipping-fields,
.woocommerce-checkout .woocommerce-additional-fields {
    display: none !important;
}

/* Hide payment method radio buttons on block checkout */
.wc-block-components-radio-control.wc-block-components-radio-control--highlight-checked.wc-block-components-radio-control--highlight-checked--first-selected.wc-block-components-radio-control--highlight-checked--last-selected.disable-radio-control {
    display: none;
}

/* Hide email input field on block checkout */
.wc-block-components-text-input.wc-block-components-address-form__email.is-active {
    display: none;
}

/* ========================================
   CHECKOUT LAYOUT ADJUSTMENTS
   ======================================== */

/* Make checkout form and order summary equal width (50/50 split) */
.wc-block-components-sidebar-layout .wc-block-components-main {
    width: 50%;
}

.wc-block-components-sidebar-layout .wc-block-components-sidebar {
    width: 50%;
}

/* ========================================
   PRODUCT GRID ALIGNMENT
   ======================================== */

/* Equal height product cards using CSS Grid - for WooCommerce blocks */
.wc-block-product-template {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    align-items: stretch !important;
    justify-items: start !important;
}

.wc-block-product {
    display: grid !important;
    grid-template-rows: auto auto auto auto !important;
    height: 100% !important;
    width: 100% !important;
    max-width: 250px !important;
}

.wc-block-product > * {
    margin: 0 !important;
}

.wc-block-components-product-image {
    grid-row: 1 !important;
    align-self: start !important;
}

.wc-block-product .wp-block-post-title {
    grid-row: 2 !important;
    align-self: end !important;
}

.wc-block-product .wp-block-woocommerce-product-price {
    grid-row: 3 !important;
    align-self: end !important;
}

.wc-block-product .wp-block-woocommerce-product-button {
    grid-row: 4 !important;
    align-self: end !important;
}

/* ========================================
   SINGLE PRODUCT PAGE - IMAGE SIZE LIMIT
   ======================================== */

/* Limit the image gallery width */
.single-product .wp-block-woocommerce-product-image-gallery {
    max-width: 300px !important;
    width: 300px !important;
}

.single-product .wp-block-woocommerce-product-image-gallery img,
.single-product .woocommerce-product-gallery img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Shrink the image column to fit its content */
.single-product .wp-block-woocommerce-product-image-gallery,
.single-product .wp-block-column:first-child {
    flex-shrink: 1 !important;
    flex-grow: 0 !important;
}

/* Make the column fit its content width */
.single-product .wp-block-columns.is-layout-flex > .wp-block-column:first-child {
    flex-basis: fit-content !important;
    width: fit-content !important;
    max-width: 320px !important;
}

/* Mobile: Let image take full width */
@media (max-width: 781px) {
    .single-product .wp-block-woocommerce-product-image-gallery {
        max-width: 100% !important;
        width: 100% !important;
    }

    .single-product .wp-block-columns.is-layout-flex > .wp-block-column:first-child {
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Disable image zoom on hover */
.single-product .woocommerce-product-gallery .zoomImg,
.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image img.zoomImg {
    display: none !important;
}

.single-product .woocommerce-product-gallery__image {
    pointer-events: none !important;
}

.single-product .woocommerce-product-gallery__image a {
    pointer-events: auto !important;
    cursor: default !important;
}

.single-product .woocommerce-product-gallery--with-images .woocommerce-product-gallery__wrapper {
    cursor: default !important;
}

/* ========================================
   PRODUCT DESCRIPTION FORMATTING
   ======================================== */

/* Add proper spacing between paragraphs in product descriptions */
.wp-block-post-excerpt__excerpt p,
.woocommerce-product-details__short-description p,
.woocommerce-Tabs-panel--description p,
.product .entry-content p {
    margin-bottom: 1em;
}

/* ========================================
   ACCORDION MENU STYLING
   ======================================== */

/* Bold accordion headings, never wrap */
.clean_accordion_wrapper > ul > li > a {
    font-weight: 700;
    white-space: nowrap;
    padding-right: 55px !important;
    background-color: rgb(214 214 214 / 80%);
    border-radius: 0;
}

/* Same background for active/hover/focus states */
.clean_accordion_wrapper > ul > li > a:hover,
.clean_accordion_wrapper > ul > li > a:focus,
.clean_accordion_wrapper > ul > li > a:active,
.clean_accordion_wrapper > ul > li.current-cat > a,
.clean_accordion_wrapper > ul > li.clean-accordion-focus > a,
.clean_accordion_wrapper > ul > li.clean-submenu-indicator-minus > a,
.clean_accordion_wrapper > ul > li.recently-clicked > a {
    background-color: rgb(214 214 214 / 80%) !important;
}

/* Remove blue click highlight */
.clean_accordion_wrapper .recently-clicked > a {
    background-color: transparent !important;
}

/* ========================================
   CART / MINI-CART - HIDE QUANTITY CONTROLS
   ======================================== */

/* Hide quantity controls in mini-cart and cart */
.wc-block-components-quantity-selector {
    display: none !important;
}

/* ========================================
   IMAGE UPLOAD FIELD
   ======================================== */

.kandyz-image-upload-wrapper {
    margin: 20px 0;
}

.kandyz-image-upload-wrapper label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.kandyz-image-upload-wrapper input[type="file"] {
    display: block;
    padding: 8px;
    border: 2px dashed #ccc;
    border-radius: 4px;
    width: 100%;
    cursor: pointer;
    background: #fafafa;
}

.kandyz-image-upload-wrapper input[type="file"]:hover {
    border-color: #999;
    background: #f5f5f5;
}

.kandyz-image-preview-inner {
    display: inline-block;
    position: relative;
    margin-top: 10px;
}

.kandyz-image-preview-inner img {
    max-width: 150px;
    max-height: 150px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px;
    display: block;
}

.kandyz-remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

.kandyz-remove-image:hover {
    background: #c0392b;
}

@media (max-width: 781px) {
    .kandyz-image-preview-inner img {
        max-width: 120px;
        max-height: 120px;
    }
}

