/**
 * SINGLE PRODUCT PAGE STYLES
 * Migrated from prototype: /prototypy/light/product.html
 * Using kadence-child production variables
 */

/* ============================================
   GLOBAL LAYOUT - HORIZONTAL PADDING
   ============================================ */

/* Add horizontal and vertical padding to all sections */
.kb-row-layout-wrap .kt-row-column-wrap {
    padding-left: 40px !important;
    padding-right: 40px !important;
}

/* Vertical padding for main sections */
.kb-row-layout-id216_e1accd-44,
.kb-row-layout-id216_ba349b-5c,
.kb-row-layout-id216_99a4a1-5c {
    padding-top: 80px !important;
    padding-bottom: 80px !important;
}

/* ============================================
   PRODUCT INFO - TITLE & PRICE
   ============================================ */

/* H1 Title - from prototype */
.kwt-title-wrap h1.product_title,
.product_title.entry-title {
    font-size: 48px !important;
    margin-bottom: 20px !important;
    color: var(--strongest-text) !important;
    font-family: 'Gotham', sans-serif !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

/* Price - from prototype */
.kwt-price-wrap .price,
.price.kwt-price-wrap {
    font-size: 36px !important;
    color: var(--accent) !important;
    margin-bottom: 30px !important;
    font-weight: 700 !important;
    font-family: 'Gotham', sans-serif !important;
}

.price.kwt-price-wrap .woocommerce-Price-amount {
    font-size: 36px !important;
    color: var(--accent) !important;
}

/* Short description */
.kwt-excerpt-wrap,
.woocommerce-product-details__short-description {
    font-size: 15px !important;
    line-height: 1.8 !important;
    color: var(--medium-text) !important;
    margin-bottom: 40px !important;
    padding-bottom: 40px !important;
    border-bottom: 1px solid var(--border-light) !important;
}

/* ============================================
   STICKY GALLERY (Desktop)
   ============================================ */

@media (min-width: 1024px) {
    .kb-row-layout-wrap .kadence-column.inner-column-1,
    .kb-row-layout-wrap .wp-block-kadence-column:first-child {
        position: sticky;
        top: 100px;
        height: fit-content;
    }
}

/* ============================================
   LAYOUT ADJUSTMENT: 40/50 SPLIT (Desktop/Tablet)
   ============================================ */

/* Desktop i Tablet - 40% galeria, 50% info */
@media (min-width: 768px) {
    .kb-row-layout-id216_e1accd-44 > .kt-row-column-wrap {
        display: grid !important;
        grid-template-columns: 40% 50% !important;
    }

    /* Backup z większą specificity */
    div.kb-row-layout-id216_e1accd-44 > .kt-row-column-wrap.kt-has-2-columns {
        display: grid !important;
        grid-template-columns: 40% 50% !important;
    }

    /* Upewnij się że kolumny nie overflowują */
    .kb-row-layout-id216_e1accd-44 .wp-block-kadence-column {
        min-width: 0 !important;
        overflow: hidden !important;
    }
}

/* Duże ekrany (1400px+) - 40% galeria, 60% info */
@media (min-width: 1400px) {
    .kb-row-layout-id216_e1accd-44 > .kt-row-column-wrap {
        grid-template-columns: 40% 60% !important;
    }

    div.kb-row-layout-id216_e1accd-44 > .kt-row-column-wrap.kt-has-2-columns {
        grid-template-columns: 40% 60% !important;
    }
}

/* Mobile - jedna kolumna (100%) */
@media (max-width: 767px) {
    .kb-row-layout-id216_e1accd-44 > .kt-row-column-wrap {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    div.kb-row-layout-id216_e1accd-44 > .kt-row-column-wrap.kt-has-2-columns {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   GALLERY IMAGES BACKGROUND & ASPECT RATIO
   ============================================ */

/* Product gallery wrapper - 9:16 aspect ratio container */
.woocommerce-product-gallery__wrapper {
    background: #ffffff !important;
    border-radius: 0 !important;
    position: relative !important;
    width: 100% !important;
    padding-bottom: 177.78% !important; /* 9:16 ratio = 16/9 * 100 */
    height: 0 !important;
    overflow: hidden !important;
}

/* Gallery image wrapper - absolute positioning inside */
.woocommerce-product-gallery__image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Link inside gallery image - fill container */
.woocommerce-product-gallery__image > a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

/* Main product image - object-fit contain for full visibility */
.woocommerce-product-gallery__image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

/* Ensure no extra spacing from img tag */
.woocommerce-product-gallery__image img:not(.zoomImg) {
    vertical-align: top !important;
    line-height: 0 !important;
}

/* Zoom image background */
.woocommerce div.product div.images .woocommerce-product-gallery__wrapper .zoomImg {
    background: #ffffff !important;
    opacity: 0;
}

/* Thumbnails (miniatury) container */
.woocommerce-product-gallery ol li {
    background: #ffffff !important;
    border: 1px solid var(--border-light) !important;
}

/* Gallery thumbnails - fix styling */
.woocommerce div.product div.images .flex-control-thumbs {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    margin-top: 20px !important;
    margin-left: 0 !important;
    padding: 0 !important;
    position: static !important;
    left: auto !important;
    transform: none !important;
    max-width: 100% !important;
    width: 100% !important;
    background: transparent !important;
}

.woocommerce div.product div.images .flex-control-thumbs li {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    background: transparent !important;
    flex: 0 0 calc(25% - 8px) !important;
    max-width: calc(25% - 8px) !important;
}

.woocommerce div.product div.images .flex-control-thumbs li:first-child {
    width: auto !important;
    padding-left: 0 !important;
}

.woocommerce div.product div.images .flex-control-thumbs li img {
    width: 100% !important;
    height: auto !important;
    border: 2px solid var(--border-light) !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    background: #ffffff !important;
}

.woocommerce div.product div.images .flex-control-thumbs li img:hover,
.woocommerce div.product div.images .flex-control-thumbs li img.flex-active {
    border-color: var(--accent) !important;
}

/* ============================================
   PRODUCT DETAILS TABLE
   ============================================ */

.product-details-table {
    background-color: #f5f1ed;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 40px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--strongest-text);
}

.detail-value {
    color: var(--medium-text);
}

/* ============================================
   HIDE STOCK INFO
   ============================================ */

.kwt-add-to-cart-wrap .stock,
p.stock {
    display: none !important;
}

/* ============================================
   QUANTITY SELECTOR
   ============================================ */

.kwt-add-to-cart-wrap .quantity,
form.cart .quantity {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    margin-bottom: 30px !important;
    padding: 20px 0 !important;
    justify-content: flex-start !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    width: auto !important;
    max-width: none !important;
    float: none !important;
}

.kwt-add-to-cart-wrap .quantity .screen-reader-text,
form.cart .quantity .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Quantity controls wrapper (created by JS) */
.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    background-color: white;
}

/* + and - buttons */
.qty-btn {
    width: 40px;
    height: 40px;
    background-color: var(--subtle-background) !important;
    border: none !important;
    cursor: pointer;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: var(--strongest-text) !important;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
}

.qty-btn:hover {
    background-color: var(--accent) !important;
    color: white !important;
    box-shadow: none !important;
}

.qty-btn:focus {
    background-color: var(--subtle-background) !important;
    color: var(--strongest-text) !important;
    outline: none !important;
    box-shadow: none !important;
}

.qty-btn:focus:hover {
    background-color: var(--accent) !important;
    color: white !important;
}

.qty-btn:active {
    transform: scale(0.95) !important;
}

.qty-btn:active:hover {
    background-color: var(--accent) !important;
    color: white !important;
}

/* Quantity input field */
.quantity-controls input.qty,
.quantity-controls input[type="number"] {
    width: 60px;
    height: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    font-size: 14px;
    font-weight: 600;
    color: var(--strongest-text);
    background-color: white;
    transition: all 0.3s ease;
}

.quantity-controls input.qty:focus,
.quantity-controls input[type="number"]:focus {
    outline: none !important;
    color: var(--strongest-text) !important;
    background-color: var(--subtle-background) !important;
    box-shadow: none !important;
}

/* Remove spinner arrows */
.quantity-controls input[type="number"]::-webkit-inner-spin-button,
.quantity-controls input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-controls input[type="number"] {
    -moz-appearance: textfield;
}

/* ============================================
   ADD TO CART BUTTON
   ============================================ */

.kwt-add-to-cart-wrap .single_add_to_cart_button {
    background-color: var(--strongest-text) !important;
    color: white !important;
    border: 2px solid var(--strongest-text) !important;
    padding: 18px 40px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-family: 'Gotham', sans-serif !important;
    margin-bottom: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    width: 100% !important;
}

.kwt-add-to-cart-wrap .single_add_to_cart_button:hover {
    background-color: transparent !important;
    border-color: var(--strongest-text) !important;
    color: var(--strongest-text) !important;
}

/* ============================================
   DELIVERY INFO BOX
   ============================================ */

.delivery-info {
    background-color: #f5f1ed;
    padding: 30px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.delivery-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.delivery-item i {
    font-size: 24px;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 3px;
}

.delivery-item strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--strongest-text);
    margin-bottom: 5px;
}

.delivery-item p {
    font-size: 13px;
    color: var(--medium-text);
    line-height: 1.5;
    margin: 0;
}

/* ============================================
   PRODUCT TABS STYLING
   ============================================ */

/* Section 1: Gallery + Product Info - jasny beż */
.kb-row-layout-id216_e1accd-44 {
    background-color: var(--subtle-background) !important;
}

/* Section 2: Tabs - ciemniejszy beż */
.kb-row-layout-id216_ba349b-5c {
    background-color: #f5f1ed !important;
    margin-top: 0 !important;
    border-top: 1px solid var(--border-light) !important;
}

/* Section 3: Related Products - jasny beż */
.kb-row-layout-id216_99a4a1-5c {
    background-color: var(--subtle-background) !important;
}

/* Related Products Header */
.related.products h2,
.kwt-related-wrap h2 {
    font-family: 'Gotham', sans-serif !important;
    font-size: 36px !important;
    font-weight: 700 !important;
    color: var(--strongest-text) !important;
    margin-bottom: 50px !important;
    text-align: left !important;
    line-height: 1.2 !important;
}

/* Tabs navigation */
.kwt-tabs-wrap .tabs.wc-tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--border-light) !important;
    margin-bottom: 50px !important;
}

.kwt-tabs-wrap .tabs.wc-tabs li {
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
}

.kwt-tabs-wrap .tabs.wc-tabs li a {
    background-color: transparent !important;
    border: none !important;
    padding: 18px 40px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    color: var(--medium-text) !important;
    transition: all 0.3s ease !important;
    border-bottom: 3px solid transparent !important;
    margin-bottom: -2px !important;
    font-family: 'Gotham', sans-serif !important;
    text-decoration: none !important;
}

.kwt-tabs-wrap .tabs.wc-tabs li a:hover {
    color: var(--strongest-text) !important;
}

.kwt-tabs-wrap .tabs.wc-tabs li.active a {
    color: var(--strongest-text) !important;
    border-bottom: 4px solid var(--accent) !important;
    border-bottom-width: 4px !important;
    font-weight: 700 !important;
}

/* Tab focus state for accessibility */
.kwt-tabs-wrap .tabs.wc-tabs li a:focus-visible {
    outline: none !important;
    background-color: var(--subtle-background) !important;
}

/* Tab content */
.kwt-tabs-wrap .woocommerce-Tabs-panel {
    max-width: 900px;
    animation: fadeIn 0.3s ease;
}

/* Remove Kadence default padding-top and border-top */
.woocommerce div.product .kwt-tabs-wrap .woocommerce-tabs .woocommerce-Tabs-panel.panel {
    padding-top: 0 !important;
    border-top: none !important;
    margin-top: 0 !important;
}

/* Remove mobile border on tabs */
@media screen and (max-width: 719px) {
    .woocommerce div.product .woocommerce-tabs {
        border: none !important;
        margin-bottom: 0 !important;
    }
}

.kwt-tabs-wrap .woocommerce-Tabs-panel h2 {
    font-size: 28px !important;
    margin-bottom: 25px !important;
    color: var(--strongest-text) !important;
    font-family: 'Gotham', sans-serif !important;
}

.kwt-tabs-wrap .woocommerce-Tabs-panel p {
    font-size: 15px !important;
    line-height: 1.8 !important;
    color: var(--strong-text) !important;
    margin-bottom: 0 !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   PRODUCT ATTRIBUTES TABLE
   ============================================ */

.woocommerce-product-attributes.shop_attributes {
    width: 100% !important;
    border: none !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    background-color: white !important;
    margin: 0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.woocommerce-product-attributes.shop_attributes tbody {
    background-color: white !important;
}

/* First row top padding */
.woocommerce-product-attributes-item:first-child .woocommerce-product-attributes-item__label,
.woocommerce-product-attributes-item:first-child .woocommerce-product-attributes-item__value {
    padding-top: 30px !important;
}

/* Last row bottom padding */
.woocommerce-product-attributes-item:last-child .woocommerce-product-attributes-item__label,
.woocommerce-product-attributes-item:last-child .woocommerce-product-attributes-item__value {
    padding-bottom: 30px !important;
}

.woocommerce-product-attributes-item {
    background-color: white !important;
    transition: background-color 0.2s ease !important;
    border-bottom: 1px solid var(--border-light) !important;
}

.woocommerce-product-attributes-item:last-child {
    border-bottom: none !important;
}

/* Label cell (th) */
.woocommerce-product-attributes-item__label {
    font-family: 'Gotham', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--strongest-text) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    padding: 12px 30px 12px 30px !important;
    text-align: left !important;
    background-color: transparent !important;
    border: none !important;
    width: 40% !important;
}

/* Value cell (td) */
.woocommerce-product-attributes-item__value {
    font-family: 'Gotham', sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    font-style: italic !important;
    color: var(--medium-text) !important;
    padding: 12px 30px 12px 30px !important;
    text-align: right !important;
    background-color: transparent !important;
    border: none !important;
}

/* Remove paragraph margins and padding inside cells */
.woocommerce-product-attributes-item__label p,
.woocommerce-product-attributes-item__value p {
    margin: 0 !important;
    padding: 0 !important;
    font-style: italic !important;
    font-size: 14px !important;
    color: var(--medium-text) !important;
}

/* ============================================
   RESPONSIVE - MOBILE & TABLET
   ============================================ */

@media (max-width: 768px) {
    /* Add horizontal padding to all sections */
    .kb-row-layout-wrap .kt-row-column-wrap {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    /* Unstick gallery */
    .kb-row-layout-wrap .kadence-column.inner-column-1,
    .kb-row-layout-wrap .wp-block-kadence-column:first-child {
        position: static !important;
    }

    /* Title smaller */
    .kwt-title-wrap h1.product_title,
    .product_title.entry-title {
        font-size: 32px !important;
    }

    /* Price smaller */
    .kwt-price-wrap .price,
    .price.kwt-price-wrap {
        font-size: 28px !important;
    }

    /* Reduce padding */
    .product-details-table,
    .delivery-info {
        padding: 20px;
    }

    /* Delivery info stacks better */
    .delivery-item {
        gap: 12px;
    }

    .delivery-item i {
        font-size: 20px;
    }

    /* Tabs padding */
    .kwt-tabs-wrap .tabs.wc-tabs li a {
        padding: 14px 20px !important;
        font-size: 12px !important;
    }

    /* Vertical padding for sections on tablet */
    .kb-row-layout-id216_e1accd-44,
    .kb-row-layout-id216_ba349b-5c,
    .kb-row-layout-id216_99a4a1-5c {
        padding-top: 60px !important;
        padding-bottom: 60px !important;
    }

    /* Related products header */
    .related.products h2,
    .kwt-related-wrap h2 {
        font-size: 28px !important;
        margin-bottom: 40px !important;
    }

    /* Product attributes table - mobile adjustments */
    .woocommerce-product-attributes-item__label,
    .woocommerce-product-attributes-item__value {
        font-size: 13px !important;
        padding: 10px 20px !important;
    }

    .woocommerce-product-attributes-item:first-child .woocommerce-product-attributes-item__label,
    .woocommerce-product-attributes-item:first-child .woocommerce-product-attributes-item__value {
        padding-top: 20px !important;
    }

    .woocommerce-product-attributes-item:last-child .woocommerce-product-attributes-item__label,
    .woocommerce-product-attributes-item:last-child .woocommerce-product-attributes-item__value {
        padding-bottom: 20px !important;
    }
}

@media (max-width: 480px) {
    /* Increase horizontal padding on mobile */
    .kb-row-layout-wrap .kt-row-column-wrap {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .delivery-info {
        padding: 15px;
        gap: 15px;
    }

    .kwt-add-to-cart-wrap .single_add_to_cart_button {
        padding: 14px 20px !important;
        font-size: 13px !important;
    }

    /* Title even smaller on mobile */
    .kwt-title-wrap h1.product_title,
    .product_title.entry-title {
        font-size: 28px !important;
    }

    /* Price smaller on mobile */
    .kwt-price-wrap .price,
    .price.kwt-price-wrap {
        font-size: 24px !important;
    }

    /* Vertical padding for sections on mobile */
    .kb-row-layout-id216_e1accd-44,
    .kb-row-layout-id216_ba349b-5c,
    .kb-row-layout-id216_99a4a1-5c {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }

    /* Related products header */
    .related.products h2,
    .kwt-related-wrap h2 {
        font-size: 24px !important;
        margin-bottom: 30px !important;
    }

    /* Product attributes table - smaller mobile */
    .woocommerce-product-attributes-item__label,
    .woocommerce-product-attributes-item__value {
        font-size: 12px !important;
        padding: 10px 15px !important;
    }

    .woocommerce-product-attributes-item:first-child .woocommerce-product-attributes-item__label,
    .woocommerce-product-attributes-item:first-child .woocommerce-product-attributes-item__value {
        padding-top: 15px !important;
    }

    .woocommerce-product-attributes-item:last-child .woocommerce-product-attributes-item__label,
    .woocommerce-product-attributes-item:last-child .woocommerce-product-attributes-item__value {
        padding-bottom: 15px !important;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.qty-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ============================================
   FIX WOOCOMMERCE CONFLICTS
   ============================================ */

/* Ensure add to cart button works */
.kwt-add-to-cart-wrap form.cart {
    margin: 0 !important;
}

.kwt-add-to-cart-wrap .cart button[type="submit"] {
    pointer-events: all !important;
}
