/**
 * Glogglz WooCommerce Styles
 * 
 * Single product, cart, checkout styles
 * Shop page styles are in shop.css
 * 
 * @package Glogglz
 * @since 1.0.0
 */

/* ==========================================================================
   SINGLE PRODUCT
   ========================================================================== */
/* Note: We use custom gl-product templates instead of default WooCommerce layout */
/* The gl-product-hero__grid handles the gallery + summary layout */

/* 
 * Hide default WooCommerce product gallery - using custom gl-gallery
 * !important is INTENTIONALLY kept here because:
 * - WooCommerce core injects inline styles on these elements
 * - Flexslider plugin adds its own display rules
 * - This is a deliberate override to show our custom gallery instead
 */
.woocommerce-product-gallery,
.woocommerce-product-gallery__wrapper,
.woocommerce-product-gallery__image,
.woocommerce-product-gallery__trigger,
.flex-viewport,
.flex-control-thumbs,
.flex-control-nav {
    display: none !important;
}

/* Hide default WooCommerce summary when using custom template */
.single-product .product > .entry-summary {
    display: none;
}

/* Product Summary */
.entry-summary {
    padding: 24px 0;
}

.product_title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin: 0 0 16px;
}

/* Price */
.entry-summary .price {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--gl-brand);
    margin-bottom: 24px;
}

.entry-summary .price del {
    color: var(--gl-gray-500);
    font-weight: 400;
    font-size: 1.25rem;
    margin-right: 12px;
}

/* Short Description */
.woocommerce-product-details__short-description {
    color: var(--gl-gray-700);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 24px;
}

/* Add to Cart Form */
.cart {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 32px;
}

/* Quantity */
.quantity {
    display: flex;
    align-items: center;
    background: var(--gl-white);
    border: 1px solid var(--gl-border);
    border-radius: var(--gl-radius-xl);
    overflow: hidden;
}

.quantity .qty {
    width: 60px;
    padding: 14px;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--gl-gray-900);
    font-size: 1rem;
    font-weight: 600;
    -moz-appearance: textfield;
}

.quantity .qty::-webkit-outer-spin-button,
.quantity .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Single Add to Cart Button */
.single_add_to_cart_button {
    flex: 1;
    min-width: 200px;
    padding: 16px 32px;
    background: var(--gl-brand);
    color: var(--gl-gray-900);
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    border-radius: var(--gl-radius-xl);
    cursor: pointer;
    transition: all var(--gl-transition-base);
}

.single_add_to_cart_button:hover {
    background: var(--gl-brand-light);
    box-shadow: var(--gl-shadow-brand);
    transform: translateY(-2px);
}

.single_add_to_cart_button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Variations */
.variations {
    width: 100%;
    margin-bottom: 24px;
}

.variations tr {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.variations .label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gl-gray-700);
}

.variations select {
    width: 100%;
    padding: 14px 40px 14px 16px;
    background: var(--gl-white);
    border: 1px solid var(--gl-border);
    border-radius: var(--gl-radius-lg);
    color: var(--gl-gray-900);
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.variations select:focus {
    outline: none;
    border-color: var(--gl-brand);
}

/* Product Meta */
.product_meta {
    padding-top: 24px;
    border-top: 1px solid var(--gl-border);
    font-size: 0.875rem;
    color: var(--gl-gray-400);
}

.product_meta > span {
    display: block;
    margin-bottom: 8px;
}

.product_meta a {
    color: var(--gl-brand);
}

/* ==========================================================================
   PRODUCT TABS
   ========================================================================== */
.woocommerce-tabs {
    margin-top: 64px;
}

.woocommerce-tabs .tabs {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    border-bottom: 1px solid var(--gl-border);
}

.woocommerce-tabs .tabs li {
    margin-bottom: -1px;
}

.woocommerce-tabs .tabs li a {
    display: block;
    padding: 16px 24px;
    color: var(--gl-gray-400);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all var(--gl-transition-base);
}

.woocommerce-tabs .tabs li a:hover {
    color: var(--gl-gray-900);
}

.woocommerce-tabs .tabs li.active a {
    color: var(--gl-brand);
    border-bottom-color: var(--gl-brand);
}

.woocommerce-tabs .panel {
    color: var(--gl-gray-700);
    line-height: 1.7;
}

.woocommerce-tabs .panel h2 {
    display: none;
}

/* ==========================================================================
   RELATED PRODUCTS
   ========================================================================== */
.related.products,
.upsells.products {
    margin-top: 80px;
}

.related.products > h2,
.upsells.products > h2 {
    font-size: 1.5rem;
    margin-bottom: 32px;
    text-align: center;
}

/* ==========================================================================
   NOTICES
   ========================================================================== */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: var(--gl-radius-lg);
    font-size: 0.9375rem;
}

.woocommerce-message {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--gl-success);
    color: var(--gl-success);
}

.woocommerce-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--gl-info);
    color: var(--gl-info);
}

.woocommerce-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--gl-error);
    color: var(--gl-error);
    list-style: none;
    padding-left: 20px;
}

.woocommerce-message a,
.woocommerce-info a {
    color: inherit;
    text-decoration: underline;
}

/* ==========================================================================
   OUT OF STOCK
   ========================================================================== */
.stock.out-of-stock {
    color: var(--gl-error);
    font-weight: 600;
    margin-bottom: 16px;
}

.stock.in-stock {
    color: var(--gl-success);
    font-weight: 600;
    margin-bottom: 16px;
}

/* ==========================================================================
   ORDERING DROPDOWN (if needed on category pages)
   ========================================================================== */
.woocommerce-ordering select {
    padding: 10px 40px 10px 16px;
    background: var(--gl-white);
    border: 1px solid var(--gl-border);
    border-radius: var(--gl-radius-lg);
    color: var(--gl-gray-900);
    font-size: 0.9375rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.woocommerce-ordering select:focus {
    outline: none;
    border-color: var(--gl-brand);
}

/* ==========================================================================
   STICKY ADD TO CART BAR
   ========================================================================== */
.gl-sticky-atc-wrapper {
    position: relative;
}

.gl-sticky-atc-intersector {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.gl-sticky-atc {
    position: fixed;
    top: -100px;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--gl-white);
    border-top: 1px solid var(--gl-border);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.1);
    transition: top 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.gl-sticky-atc.is-visible {
    top: 0;
    opacity: 1;
    visibility: visible;
}

.admin-bar .gl-sticky-atc.is-visible {
    top: 32px;
}

.gl-sticky-atc__content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 0;
}

.gl-sticky-atc__image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: var(--gl-radius-lg);
    overflow: hidden;
    background: var(--gl-gray-100);
}

.gl-sticky-atc__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gl-sticky-atc__info {
    flex: 1;
    min-width: 0;
}

.gl-sticky-atc__title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--gl-gray-900);
    margin: 0 0 4px;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gl-sticky-atc__price {
    font-size: 1.125rem;
    font-weight: 900;
    color: var(--gl-ocean);
}

.gl-sticky-atc__price del {
    color: var(--gl-gray-500);
    font-weight: 400;
    font-size: 0.875rem;
    margin-right: 8px;
}

.gl-sticky-atc__form {
    flex-shrink: 0;
}

.gl-sticky-atc__form-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gl-sticky-atc__form-inner .quantity {
    margin: 0;
}

.gl-sticky-atc__form-inner .single_add_to_cart_button {
    min-width: 180px;
    padding: 12px 24px;
    font-size: 0.9375rem;
}

/* Hide variations table in sticky bar */
.gl-sticky-atc__form-inner .variations {
    display: none;
}

/* Mobile */
@media (max-width: 768px) {
    .gl-sticky-atc__content {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .gl-sticky-atc__image {
        width: 50px;
        height: 50px;
    }
    
    .gl-sticky-atc__info {
        flex: 1 1 auto;
        min-width: 0;
    }
    
    .gl-sticky-atc__title {
        font-size: 0.875rem;
    }
    
    .gl-sticky-atc__price {
        font-size: 1rem;
    }
    
    .gl-sticky-atc__form {
        flex: 1 1 100%;
    }
    
    .gl-sticky-atc__form-inner {
        width: 100%;
    }
    
    .gl-sticky-atc__form-inner .single_add_to_cart_button {
        flex: 1;
        min-width: 0;
    }
}
