/* ── AGT Product Card — Frontend Styles ───────────────────────────────────── */

.agt-product-card {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    text-align:     center;
    width:          100%;
	height:         100%;
	padding-bottom: 20px;
}

/* ── Flip card ────────────────────────────────────────────────────────────── */

.agt-product-card__flip {
    perspective: 1000px;
    width:       100%;
    max-width:   320px;
    /* Height is driven by the image aspect ratio — set per project if needed */
    cursor:      default;
}

/* Only show flip cursor when a back image exists */
.agt-product-card__flip--has-back {
    cursor: pointer;
}

.agt-product-card__flip-inner {
    position:        relative;
    width:           100%;
    padding-bottom:  133%; /* default 3:4 aspect ratio — adjust to match your book images */
    transform-style: preserve-3d;
    transition:      transform 0.6s ease;
}

/* Desktop hover flip */
.agt-product-card__flip--has-back:hover .agt-product-card__flip-inner {
    transform: rotateY( 180deg );
}

/* Touch tap flip */
.agt-product-card__flip--has-back.is-flipped .agt-product-card__flip-inner {
    transform: rotateY( 180deg );
}

.agt-product-card__front,
.agt-product-card__back {
    position:            absolute;
    inset:               0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow:            hidden;
    border-radius:       4px;
}

.agt-product-card__front img,
.agt-product-card__back img {
    width:       100%;
    height:      100%;
    object-fit:  cover;
    display:     block;
}

.agt-product-card__back {
    transform: rotateY( 180deg );
}

/* ── Card body ────────────────────────────────────────────────────────────── */


.agt-product-card__body {
    width:          100%;
    padding:        16px 0 0;
    display:        flex;
    flex-direction: column;
    flex:           1;
}

.agt-product-card__title {
    font-size:   1.1rem;
    font-weight: 600;
    margin:      0 0 8px;
    line-height: 1.3;
}

.agt-product-card__price {
    font-size:   1rem;
    font-weight: 700;
    margin:      0 0 10px;
    color:       inherit;
}

.agt-product-card__price .woocommerce-Price-amount {
    color: inherit;
	font-weight: bold;
}

.agt-product-card__desc {
    font-size:   inherit;
    line-height: inherit;
    margin:      0 10px 14px;
    color:       inherit;
}

.agt-product-card__desc p:last-child {
    margin-bottom: 0;
}

/* ── Button ───────────────────────────────────────────────────────────────── */

.agt-product-card__btn {
    display:         inline-block;
    padding:         10px 24px;
    background:      #1a1a1a;
    color:           #fff;
    text-decoration: none;
    border-radius:   4px;
    font-size:       0.9rem;
    font-weight:     600;
    letter-spacing:  0.02em;
    transition:      background 0.2s, transform 0.1s;
    cursor:          pointer;
}

.agt-product-card__btn:hover {
    background: #333;
    color:      #fff;
    transform:  translateY( -1px );
}

.agt-product-card__btn:active {
    transform: translateY( 0 );
}

.agt-product-card__price,
.wp-block-button {
    margin-top: auto;
}

/* ── Empty/error state ────────────────────────────────────────────────────── */

.agt-product-card--empty {
    padding:    24px;
    background: #f8f8f8;
    border:     1px dashed #ccc;
    color:      #888;
    font-size:  0.9rem;
    text-align: center;
}

/* ── Alignment helpers ────────────────────────────────────────────────────── */

.agt-product-card.alignleft  { margin-right: auto; }
.agt-product-card.alignright { margin-left:  auto; }
.agt-product-card.aligncenter { margin: 0 auto; }

/* ── Reduced motion ───────────────────────────────────────────────────────── */

@media ( prefers-reduced-motion: reduce ) {
    .agt-product-card__flip-inner {
        transition: none;
    }
}
