/**
 * ALLCP Product Page Styles
 * 
 * Responsive single product layout with:
 * - 2-column grid (gallery + buybox) on desktop
 * - Stacked on mobile
 * - Sticky buybox
 * - Modern clean design
 */

/* ============================================================
   Root & Container
   ============================================================ */

.allcp-product-page {
    width: 100%;
    padding: 2rem 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================================
   Breadcrumb
   ============================================================ */

.allcp-product__breadcrumb {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.allcp-product__breadcrumb .woocommerce-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.allcp-product__breadcrumb .woocommerce-breadcrumb a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s;
}

.allcp-product__breadcrumb .woocommerce-breadcrumb a:hover {
    color: #0052a3;
    text-decoration: underline;
}

/* ============================================================
   Main Product Wrapper (Gallery + Buybox)
   ============================================================ */

.allcp-product__main-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 2.5rem 0;
    align-items: flex-start;
}

@media (max-width: 1024px) {
    .allcp-product__main-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ============================================================
   Gallery Section
   ============================================================ */

.allcp-product__gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.allcp-gallery__container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.allcp-gallery__main-wrapper {
    position: sticky;
    top: 2rem;
    z-index: 10;
}

@media (max-width: 1024px) {
    .allcp-gallery__main-wrapper {
        position: static;
    }
}

.allcp-gallery__main {
    width: 100%;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 450px;
    overflow: visible;
    aspect-ratio: 1;
}

.allcp-gallery__main-img {
    max-width: 100%;
    height: auto;
    display: block;
}

.allcp-gallery__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0f0 0%, #fafafa 100%);
    color: #999;
}

/* Thumbnails Grid */
.allcp-gallery__thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75rem;
    padding: 0;
    margin-top: 1.5rem;
}

.allcp-gallery__thumb {
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid #e5e7eb;
    border-radius: 4px;
    background-color: #f9fafb;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.allcp-gallery__thumb:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.allcp-gallery__thumb.active {
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

.allcp-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
   Buy Box Section
   ============================================================ */

.allcp-product__buybox {
    display: flex;
    flex-direction: column;
}

.allcp-buybox__inner {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 2rem;
    overflow: visible;
}

@media (max-width: 1024px) {
    .allcp-buybox__inner {
        position: static;
    }
}

/* Meta Info */
.allcp-buybox__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 5px;
    padding: 5px;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.85rem;
}

.allcp-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.allcp-meta-label {
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.allcp-meta-value {
    color: #1f2937;
    font-weight: 500;
}

/* Title */
.allcp-buybox__title {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1f2937;
    margin: 0;
}

@media (max-width: 768px) {
    .allcp-buybox__title {
        font-size: 1.5rem;
    }
}

/* Price */
.allcp-buybox__price {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.allcp-buybox__price .price {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
}

.allcp-buybox__price .woocommerce-Price-amount {
    color: #1f2937;
}

.allcp-buybox__price .woocommerce-Price-currencySymbol {
    font-size: 1.5rem;
}

/* Stock Status */
.allcp-buybox__stock {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.allcp-buybox__stock .stock {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

.allcp-buybox__stock .in-stock {
    background-color: #d1fae5;
    color: #065f46;
}

.allcp-buybox__stock .out-of-stock {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Highlights */
.allcp-buybox__highlights {
    padding: 1.25rem;
    background-color: #f9fafb;
    border-radius: 4px;
    line-height: 1.6;
    color: #374151;
}

.allcp-highlights-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.allcp-highlights-list li {
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.allcp-highlights-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #0666cc;
    font-weight: bold;
}

/* Add to Cart Form */
.allcp-buybox__add-to-cart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-top: 1px solid #f3f4f6;
    padding-top: 1rem;
}

.allcp-buybox__add-to-cart form.cart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.allcp-buybox__add-to-cart .quantity {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    width: fit-content;
    overflow: hidden;
    background-color: white;
}

.allcp-buybox__add-to-cart .quantity input.qty {
    width: 60px;
    border: none;
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-weight: 600;
}

.allcp-buybox__add-to-cart .quantity input.qty:focus {
    outline: none;
    background-color: #f9fafb;
}

.allcp-buybox__add-to-cart .quantity button {
    width: 40px;
    height: 100%;
    border: none;
    background-color: #f3f4f6;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.allcp-buybox__add-to-cart .quantity button:hover {
    background-color: #e5e7eb;
}

.allcp-buybox__add-to-cart .single_add_to_cart_button,
.allcp-buybox__add-to-cart .button {
    padding: 0.875rem 1.5rem;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.allcp-buybox__add-to-cart .single_add_to_cart_button:hover,
.allcp-buybox__add-to-cart .button:hover {
    background-color: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.allcp-buybox__add-to-cart .single_add_to_cart_button:active,
.allcp-buybox__add-to-cart .button:active {
    transform: translateY(0);
}

.allcp-buybox__add-to-cart .single_add_to_cart_button:disabled,
.allcp-buybox__add-to-cart .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Source Link */
.allcp-buybox__source {
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

.allcp-source-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #0066cc;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.allcp-source-link:hover {
    color: #0052a3;
    text-decoration: underline;
}

.allcp-icon-external {
    display: inline-block;
    font-size: 0.8rem;
}

/* ============================================================
   Product Sections
   ============================================================ */

.allcp-product__sections {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin: 3rem 0;
    border-top: 2px solid #e5e7eb;
    padding-top: 2.5rem;
    overflow: visible;
}

@media (max-width: 768px) {
    .allcp-product__sections {
        gap: 2rem;
        margin: 2rem 0;
        padding-top: 1.5rem;
    }
}

.allcp-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: visible;
}

.allcp-section__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #0066cc;
    display: inline-block;
}

@media (max-width: 768px) {
    .allcp-section__title {
        font-size: 1.25rem;
    }
}

.allcp-section__content {
    line-height: 1.7;
    color: #374151;
    font-size: 1rem;
    overflow: visible;
}

/* Description Content */
.allcp-description-content {
    line-height: 1.8;
}

.allcp-description-content p {
    margin-bottom: 1rem;
}

.allcp-description-content h2,
.allcp-description-content h3,
.allcp-description-content h4 {
    margin: 1.5rem 0 0.75rem;
    color: #1f2937;
}

.allcp-description-content ul,
.allcp-description-content ol {
    margin: 1rem 0 1rem 1.5rem;
}

.allcp-description-content li {
    margin-bottom: 0.5rem;
}

/* Specs Table */
.allcp-specs-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    overflow: visible;
}

.allcp-specs-table__row {
    border-bottom: 1px solid #e5e7eb;
}

.allcp-specs-table__row:last-child {
    border-bottom: none;
}

.allcp-specs-table__row:nth-child(odd) {
    background-color: #f9fafb;
}

.allcp-specs-table__label {
    padding: 1rem;
    font-weight: 600;
    color: #1f2937;
    width: 35%;
    vertical-align: top;
}

.allcp-specs-table__value {
    padding: 1rem;
    color: #374151;
    vertical-align: top;
}

@media (max-width: 768px) {
    .allcp-specs-table {
        display: block;
    }

    .allcp-specs-table tbody {
        display: block;
    }

    .allcp-specs-table__row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        padding: 1rem;
        background-color: white !important;
        border: 1px solid #e5e7eb;
        border-radius: 4px;
        margin-bottom: 0.75rem;
    }

    .allcp-specs-table__label {
        width: 100%;
        padding: 0;
        background-color: transparent;
        font-size: 0.875rem;
    }

    .allcp-specs-table__value {
        width: 100%;
        padding: 0;
        text-align: right;
        font-weight: 600;
    }
}

/* Box Contents */
.allcp-box-contents {
    background-color: #f9fafb;
    padding: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid #0066cc;
    overflow: visible;
}

.allcp-box-contents p {
    margin-bottom: 0.75rem;
}

.allcp-box-contents ul,
.allcp-box-contents ol {
    margin: 1rem 0 1rem 1.5rem;
}

.allcp-box-contents li {
    margin-bottom: 0.5rem;
}

/* Shipping Content */
.allcp-shipping-content {
    background-color: #eff6ff;
    padding: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid #0066cc;
    overflow: visible;
}

.allcp-shipping-content p {
    margin-bottom: 0.75rem;
}

/* Warranty Content */
.allcp-warranty-content {
    background-color: #fef3c7;
    padding: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid #f59e0b;
    color: #92400e;
    overflow: visible;
}

.allcp-warranty-content p {
    margin-bottom: 0.75rem;
    color: #92400e;
}

.allcp-warranty-content strong {
    color: #78350f;
}

/* Reviews Section */
.allcp-section-reviews {
    background-color: #f9fafb;
    padding: 1.5rem;
    border-radius: 4px;
}

/* ============================================================
   Responsive Adjustments
   ============================================================ */

@media (max-width: 768px) {
    .allcp-product-page {
        padding: 1rem 0;
    }

    .container {
        padding: 0 1rem;
    }

    .allcp-product__breadcrumb {
        margin-bottom: 1.5rem;
        font-size: 0.85rem;
    }

    .allcp-product__main-wrapper {
        gap: 1.5rem;
        margin: 1.5rem 0;
    }

    .allcp-buybox__inner {
        padding: 1.5rem;
        gap: 1rem;
    }

    .allcp-gallery__main {
        min-height: 300px;
    }

    .allcp-gallery__thumbnails {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ============================================================
   Accessibility
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .allcp-gallery__thumb,
    .allcp-gallery__main-wrapper,
    .allcp-buybox__add-to-cart .single_add_to_cart_button,
    .allcp-source-link {
        transition: none;
    }
}

/* Focus states for keyboard navigation */
.allcp-gallery__thumb:focus,
.allcp-source-link:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* ============================================================
   Print Styles
   ============================================================ */

@media print {
    .allcp-product__breadcrumb,
    .allcp-buybox__inner,
    .allcp-section-reviews,
    .allcp-buybox__source {
        display: none;
    }

    .allcp-product__main-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .allcp-product-page {
        padding: 0;
    }
}
/* ============================================================
   MOBILE & TABLET OPTIMIZATIONS
   ============================================================ */

/* MOBILE: Extra Small (max-width: 479px) */
@media (max-width: 479px) {
    .allcp-product-page {
        padding: 1rem 0;
    }

    .container {
        padding: 0 0.75rem;
    }

    .allcp-product__main-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 1.5rem 0;
    }

    .allcp-product__gallery {
        gap: 0.75rem;
    }

    .allcp-gallery__main {
        min-height: 280px;
    }

    .allcp-gallery__thumbnails {
        gap: 0.5rem;
    }

    .allcp-gallery__thumb {
        max-width: 60px;
        border-radius: 4px;
    }

    .allcp-buybox {
        position: static !important;
    }

    .allcp-buybox__inner {
        padding: 1rem;
        border: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .allcp-buybox__meta {
        margin: 5px;
        padding: 5px;
        margin-bottom: 0.8rem;
    }

    .allcp-meta-item {
        margin-bottom: 0.6rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .allcp-meta-label {
        min-width: 70px;
        font-weight: 600;
    }

    .allcp-buybox__title {
        font-size: 1.4rem;
        line-height: 1.2;
        margin-bottom: 0.8rem;
    }

    .allcp-buybox__price {
        font-size: 1.3rem;
        font-weight: bold;
        color: #d72f4d;
    }

    .allcp-buybox__price-stock {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        gap: 0.5rem;
    }

    .allcp-buybox__highlights {
        margin: 1rem 0;
        padding: 0.8rem;
        background: #f9f9f9;
        border-radius: 4px;
    }

    .allcp-highlights-list {
        margin: 0;
        padding-left: 1.2rem;
    }

    .allcp-highlights-list li {
        margin-bottom: 0.4rem;
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .single_add_to_cart_button {
        width: 100% !important;
        padding: 0.8rem !important;
        font-size: 1rem !important;
        min-height: 44px;
    }

    /* Section Styles */
    .allcp-section {
        padding: 1.2rem;
        margin-top: 1.5rem;
    }

    .allcp-section__title {
        font-size: 1.25rem;
        margin-bottom: 0.8rem;
    }

    .allcp-section__content {
        font-size: 0.95rem;
    }

    /* Specs Table */
    .allcp-specs-table {
        font-size: 0.9rem;
    }

    .allcp-specs-table__label {
        width: 45%;
        word-break: break-word;
    }

    .allcp-specs-table__value {
        word-break: break-word;
    }

    .allcp-specs-table tr {
        display: flex;
        gap: 1rem;
        border-bottom: 1px solid #e0e0e0;
        padding: 0.6rem 0;
    }

    /* Related Products */
    .allcp-related-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.8rem !important;
    }

    .allcp-related-product-card {
        border-radius: 8px;
    }

    .allcp-related-product-card div[style*="padding"] {
        padding: 0.8rem !important;
    }

    .allcp-related-product-card h3 {
        font-size: 0.9rem;
        margin: 0 0 0.5rem 0;
    }

    .allcp-related-product-card p {
        font-size: 1rem !important;
    }

    /* Breadcrumb */
    .allcp-product__breadcrumb {
        margin-bottom: 1rem;
        padding-bottom: 0.8rem;
        font-size: 0.85rem;
    }
}

/* MOBILE: Small (480px - 599px) */
@media (min-width: 480px) and (max-width: 599px) {
    .allcp-gallery__main {
        min-height: 300px;
    }

    .allcp-gallery__thumb {
        max-width: 70px;
    }

    .allcp-buybox__title {
        font-size: 1.5rem;
    }

    .allcp-section {
        padding: 1.3rem;
    }

    .allcp-section__title {
        font-size: 1.3rem;
    }

    .allcp-related-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* TABLET: Medium (600px - 899px) */
@media (min-width: 600px) and (max-width: 899px) {
    .allcp-product-page {
        padding: 1.5rem 0;
    }

    .container {
        padding: 0 1rem;
    }

    .allcp-product__main-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin: 2rem 0;
    }

    .allcp-gallery__main {
        min-height: 350px;
    }

    .allcp-gallery__thumb {
        max-width: 80px;
    }

    .allcp-buybox {
        position: sticky;
        top: 80px;
        background: #fff;
        padding: 1.5rem;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .allcp-buybox__title {
        font-size: 1.6rem;
    }

    .allcp-section {
        padding: 1.5rem;
        margin-top: 2rem;
    }

    .allcp-section__title {
        font-size: 1.5rem;
    }

    .allcp-related-products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.5rem !important;
    }
}

/* TABLET: Large (900px - 1023px) */
@media (min-width: 900px) and (max-width: 1023px) {
    .allcp-product__main-wrapper {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }

    .allcp-gallery__main {
        min-height: 400px;
    }

    .allcp-gallery__main-wrapper {
        position: sticky;
        top: 80px;
    }

    .allcp-related-products-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* DESKTOP: Large (1024px+) */
@media (min-width: 1024px) {
    .allcp-product__main-wrapper {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .allcp-gallery__main {
        min-height: 500px;
    }

    .allcp-related-products-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* LANDSCAPE MOBILE */
@media (max-width: 768px) and (orientation: landscape) {
    .allcp-product__main-wrapper {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .allcp-gallery__main {
        min-height: 280px;
    }

    .allcp-buybox__title {
        font-size: 1.3rem;
    }

    .allcp-section__title {
        font-size: 1.2rem;
    }
}