/**
 * Accore Product Sidebar Styles
 * Based on Figma design node 27:238
 *
 * @package Accore
 */

/* ==========================================================================
   Product Sidebar (Slide-in from right)
   ========================================================================== */

/* Overlay */
.agui-product-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10000;
}

.agui-product-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Panel - 390px width per Figma */
.agui-product-sidebar {
    position: fixed;
    top: 0;
    right: -390px;
    width: 390px;
    max-width: 90vw;
    height: 100vh;
    background-color: #f3f3ee;
    border-left: 1px solid rgba(19, 52, 59, 0.15);
    box-shadow: -18px 0px 17.9px 0px rgba(0, 0, 0, 0.05);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    overflow: hidden;
}

.agui-product-sidebar.is-open {
    right: 0;
}

/* Prevent body scroll when product sidebar is open */
body.agui-product-sidebar-open {
    overflow: hidden;
}

/* Header - minimal with just close button */
.agui-product-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 24px;
    background: #f3f3ee;
}

.agui-product-sidebar__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #13343b;
    transition: all 0.2s ease;
}

.agui-product-sidebar__close:hover {
    background: rgba(19, 52, 59, 0.08);
}

.agui-product-sidebar__close svg {
    width: 20px;
    height: 20px;
}

/* Body */
.agui-product-sidebar__body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    padding: 0 32px 32px;
}

/* Loading State */
.agui-product-sidebar__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 48px 32px;
    text-align: center;
}

.agui-product-sidebar__loading p {
    margin-top: 16px;
    color: rgba(19, 52, 59, 0.6);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.agui-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(78, 11, 98, 0.15);
    border-top-color: #4e0b62;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Product Detail Content */
.agui-product-sidebar__content {
    padding: 0;
}

.agui-product-detail {
    display: flex;
    flex-direction: column;
}

/* Product Image - Rounded corners per Figma */
.agui-product-detail__gallery {
    margin-bottom: 24px;
}

.agui-product-gallery__main {
    position: relative;
    width: 100%;
    aspect-ratio: 1.5;
    border: 0.5px solid rgba(19, 52, 59, 0.13);
    border-radius: 10px;
    background: #fff;
}
.agui-product-gallery__main-image {
	width: 100%;
	height: auto;
	display: block;
    border-radius: 10px;
}

/* Product Info Section */
.agui-product-detail__info {
    padding: 0;
}

/* Product Title - 24px Bold per Figma */
.agui-product-detail__title {
    font-family: 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #13343b;
    line-height: 36px;
    letter-spacing: 0.08px;
    margin: 0 0 16px 0;
}

/* Delivery Info - Per Figma */
.agui-product-detail__delivery {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.61;
    color: #4e0b62;
    opacity: 0.67;
    margin-bottom: 24px;
}

.agui-product-detail__delivery strong {
    font-weight: 700;
    text-decoration: underline;
}

.agui-product-detail__delivery span {
    font-weight: 700;
}

/* Price Display */
.agui-product-detail__price {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #13343b;
    margin-bottom: 16px;
}

.agui-product-detail__price del {
    font-size: 16px;
    font-weight: 400;
    color: rgba(19, 52, 59, 0.5);
    margin-right: 8px;
}

/* Buttons Row - Per Figma: Buy Now (primary purple) + Add to cart (underlined text) */
.agui-product-detail__buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

/* Buy Now Button - Purple background per Figma #4e0b62 */
.agui-btn--buy-now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 32px;
    background: #4e0b62;
    color: #ffffff;
    font-family: 'Roboto', 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.16px;
    line-height: 32px;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.agui-btn--buy-now:hover {
    background: #3d0950;
}

.agui-btn--buy-now:active {
    background: #2e073d;
}

/* Add to Cart - Text link style with underline per Figma */
.agui-btn--add-to-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0;
    min-width: 100px; /* Prevent shrinking during loading */
    background: transparent;
    color: #13343b;
    font-family: 'Roboto', 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.16px;
    line-height: 32px;
    text-align: center;
    text-decoration: underline;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease; /* Only transition color, not width */
    white-space: nowrap;
}

.agui-btn--add-to-cart:hover {
    color: #4e0b62;
}

/* Button Loading States */
.agui-btn--buy-now:disabled,
.agui-btn--add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.agui-btn--buy-now.is-loading,
.agui-btn--add-to-cart.is-loading {
    position: relative;
    color: transparent;
}

.agui-btn--buy-now.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.agui-btn--add-to-cart.is-loading {
    min-width: 100px; /* Maintain width during loading */
}

.agui-btn--add-to-cart.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(19, 52, 59, 0.2);
    border-top-color: #13343b;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Smart Summary Section - Per Figma */
.agui-product-detail__summary {
    font-family: 'Inter', sans-serif;
    color: #13343b;
    letter-spacing: 0.08px;
}

.agui-product-detail__summary-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 12px 0;
    color: #13343b;
}

.agui-product-detail__summary-list {
    list-style: disc;
    margin: 0;
    padding-left: 20px;
}

.agui-product-detail__summary-list li {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 10px;
    color: #13343b;
}

.agui-product-detail__summary-list li:last-child {
    margin-bottom: 0;
}

.agui-product-detail__summary-list strong {
    font-weight: 700;
}

/* Short Description fallback */
.agui-product-detail__short-desc {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: #13343b;
    letter-spacing: 0.08px;
    margin-bottom: 16px;
}

/* Product Description */
.agui-product-detail__description {
    font-family: 'Inter', sans-serif;
    color: #13343b;
    letter-spacing: 0.08px;
}

.agui-product-detail__description h3 {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 12px 0;
    color: #13343b;
}

.agui-product-detail__description p {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: #13343b;
    margin-bottom: 10px;
}

.agui-product-detail__description ul,
.agui-product-detail__description ol {
    list-style: disc;
    margin: 0;
    padding-left: 20px;
}

.agui-product-detail__description li {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: #13343b;
    margin-bottom: 10px;
}

.agui-product-detail__description strong {
    font-weight: 700;
}

/* Out of Stock */
.agui-product-detail__out-of-stock {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #d32f2f;
    padding: 12px 16px;
    background: rgba(211, 47, 47, 0.08);
    border-radius: 8px;
    text-align: center;
    margin-bottom: 24px;
}

/* Success Message Toast */
.agui-product-success {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 14px 20px;
    background: #4caf50;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10002;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
.agui-cart-sidebar__item-meta {
	margin: auto;
	margin-bottom: 0;
	margin-left: 0;
}
/* Product Slider Item Hover Effects */
.agui-products-slider__item img {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.agui-products-slider__item img:hover {
    transform: scale(1.05);
}

.agui-products-slider__item:active {
    transform: scale(0.98);
}

/* Responsive */
@media (max-width: 768px) {
    .agui-product-sidebar {
        width: 100%;
        max-width: 100vw;
        right: -100%;
    }

    .agui-product-sidebar__header {
        padding: 12px 16px;
    }

    .agui-product-sidebar__body {
        padding: 0 20px 20px;
    }

    .agui-product-detail__title {
        font-size: 20px;
        line-height: 28px;
    }

    .agui-product-detail__buttons {
        flex-direction: column;
        gap: 12px;
    }

    .agui-btn--buy-now {
        width: 100%;
    }

    .agui-btn--add-to-cart {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .agui-product-sidebar__body {
        padding: 0 16px 16px;
    }

    .agui-product-detail__title {
        font-size: 18px;
        line-height: 26px;
    }
}
